This commit is contained in:
2021-08-04 16:57:14 +08:00
parent 3ccc313fe5
commit 2bbf422bb2
+1 -1
View File
@@ -107,7 +107,7 @@ class Container extends BaseObject
private function resolve($class, $constrict, $config): object private function resolve($class, $constrict, $config): object
{ {
$reflect = $this->resolveDependencies($class); $reflect = $this->resolveDependencies($class);
if (!$reflect->isInstantiable()) { if ($reflect->isAbstract() || !$reflect->isInstantiable()) {
throw new ReflectionException('Class ' . $class . ' cannot be instantiated'); throw new ReflectionException('Class ' . $class . ' cannot be instantiated');
} }
$object = $this->newInstance($reflect, $constrict); $object = $this->newInstance($reflect, $constrict);