From 2bbf422bb20fbc24acdfcacbe1837d382be88347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 4 Aug 2021 16:57:14 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/Di/Container.php b/System/Di/Container.php index 94a4b2df..d05fdbf0 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -107,7 +107,7 @@ class Container extends BaseObject private function resolve($class, $constrict, $config): object { $reflect = $this->resolveDependencies($class); - if (!$reflect->isInstantiable()) { + if ($reflect->isAbstract() || !$reflect->isInstantiable()) { throw new ReflectionException('Class ' . $class . ' cannot be instantiated'); } $object = $this->newInstance($reflect, $constrict);