This commit is contained in:
root
2025-11-13 19:52:28 +03:00
parent 8aeeb05b7d
commit 807dec3b6c
4646 changed files with 163445 additions and 626017 deletions

View File

@@ -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());
}
}