Update
This commit is contained in:
@@ -272,22 +272,6 @@ final class ServiceLocator implements ContainerInterface
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->isInterfaceOrAbstractClass($classNameInParams))
|
||||
{
|
||||
if (!isset($this->services[$classNameInParams]))
|
||||
{
|
||||
throw new ServiceNotFoundException(
|
||||
"For {$className} error in params: {$classNameInParams} (abstract or interface) is not registered in ServiceLocator"
|
||||
);
|
||||
}
|
||||
|
||||
[$classOrClosure] = $this->services[$classNameInParams];
|
||||
if (is_string($classOrClosure))
|
||||
{
|
||||
$classNameInParams = $classOrClosure;
|
||||
}
|
||||
}
|
||||
|
||||
$paramsForClass[] = $this->get($classNameInParams);
|
||||
}
|
||||
|
||||
@@ -359,11 +343,4 @@ final class ServiceLocator implements ContainerInterface
|
||||
{
|
||||
return !isset($this->services[$id]);
|
||||
}
|
||||
|
||||
private function isInterfaceOrAbstractClass(string $className): bool
|
||||
{
|
||||
return
|
||||
interface_exists($className)
|
||||
|| (class_exists($className) && (new ReflectionClass($className))->isAbstract());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user