From 9db887f7de4b6f8445a905fd435a78e937fa1ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 19:59:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Di/Container.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/System/Di/Container.php b/System/Di/Container.php index 71bf69ef..aec6a5c0 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -119,10 +119,11 @@ class Container extends BaseObject private function resolve($class, $constrict, $config): object { [$reflect, $dependencies] = $this->resolveDependencies($class); - if (!empty($constrict)) { - foreach ($constrict as $index => $param) { - $dependencies[$index] = $param; + foreach ($constrict as $index => $param) { + if (is_array($param)) { + continue; } + $dependencies[$index] = $param; } if (!$reflect->isInstantiable()) { throw new Exception($reflect->getName() . ' con\'t instantiable');