![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/laminas/laminas-di/src/ |
<?php declare(strict_types=1); namespace Laminas\Di; use Laminas\Di\Exception\InvalidServiceConfigException; use Psr\Container\ContainerInterface; use function class_exists; use function is_string; class GeneratedInjectorDelegator { /** * @psalm-suppress MixedAssignment Laminas config is an untyped array - types should be ensured internally * @psalm-suppress MixedArrayAccess Laminas config is an untyped array - types should be ensured internally * @param string $name * @param callable():InjectorInterface $callback */ public function __invoke(ContainerInterface $container, $name, callable $callback): InjectorInterface { $config = $container->has('config') ? $container->get('config') : []; $aotConfig = $config['dependencies']['auto']['aot'] ?? []; $namespace = ! isset($aotConfig['namespace']) || $aotConfig['namespace'] === '' ? 'Laminas\Di\Generated' : $aotConfig['namespace']; if (! is_string($namespace)) { throw new InvalidServiceConfigException('Provided namespace is not a string.'); } $injector = $callback(); $generatedInjector = $namespace . '\\GeneratedInjector'; if (class_exists($generatedInjector)) { /** @psalm-var class-string<InjectorInterface> $generatedInjector */ return new $generatedInjector($injector); } return $injector; } }