From c394f4990b1010d91c5eb9d13d290a4d3ee8b10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 10:36:44 +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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/System/Di/Container.php b/System/Di/Container.php index e2c44634..c5329038 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -124,11 +124,13 @@ class Container extends BaseObject private function resolve($class, $constrict, $config): object { [$reflect, $dependencies] = $this->resolveDependencies($class, $constrict); + if (empty($reflect)) { + throw new NotFindClassException($class); + } foreach ($constrict as $index => $param) { $dependencies[$index] = $param; } - var_dump($reflect); if (!$reflect->isInstantiable()) { throw new NotFindClassException($reflect->getName()); } @@ -173,7 +175,7 @@ class Container extends BaseObject { if (!isset($this->_reflection[$class])) { if (!class_exists($class)) { - return null; + return null; } $reflection = new ReflectionClass($class); if (!$reflection->isInstantiable()) {