*/ class ResolverDispatcher implements DefinitionResolver { private ?ArrayResolver $arrayResolver = null; private ?FactoryResolver $factoryResolver = null; private ?DecoratorResolver $decoratorResolver = null; private ?ObjectCreator $objectResolver = null; private ?InstanceInjector $instanceResolver = null; private ?EnvironmentVariableResolver $envVariableResolver = null; public function __construct( private ContainerInterface $container, private ProxyFactory $proxyFactory, ) { } /** * Resolve a definition to a value. * * @param Definition $definition Object that defines how the value should be obtained. * @param array $parameters Optional parameters to use to build the entry. * * @return mixed Value obtained from the definition. * @throws InvalidDefinition If the definition cannot be resolved. */ public function resolve(Definition $definition, array $parameters = []): mixed { // Special case, tested early for speed if ($definition instanceof SelfResolvingDefinition) { return $definition->resolve($this->container); } $definitionResolver = $this->getDefinitionResolver($definition); return $definitionResolver->resolve($definition, $parameters); } public function isResolvable(Definition $definition, array $parameters = []): bool { // Special case, tested early for speed if ($definition instanceof SelfResolvingDefinition) { return $definition->isResolvable($this->container); } $definitionResolver = $this->getDefinitionResolver($definition); return $definitionResolver->isResolvable($definition, $parameters); } /** * Returns a resolver capable of handling the given definition. * * @throws \RuntimeException No definition resolver was found for this type of definition. */ private function getDefinitionResolver(Definition $definition): DefinitionResolver { switch (true) { case $definition instanceof ObjectDefinition: if (! $this->objectResolver) { $this->objectResolver = new ObjectCreator($this, $this->proxyFactory); } return $this->objectResolver; case $definition instanceof DecoratorDefinition: if (! $this->decoratorResolver) { $this->decoratorResolver = new DecoratorResolver($this->container, $this); } return $this->decoratorResolver; case $definition instanceof FactoryDefinition: if (! $this->factoryResolver) { $this->factoryResolver = new FactoryResolver($this->container, $this); } return $this->factoryResolver; case $definition instanceof ArrayDefinition: if (! $this->arrayResolver) { $this->arrayResolver = new ArrayResolver($this); } return $this->arrayResolver; case $definition instanceof EnvironmentVariableDefinition: if (! $this->envVariableResolver) { $this->envVariableResolver = new EnvironmentVariableResolver($this); } return $this->envVariableResolver; case $definition instanceof InstanceDefinition: if (! $this->instanceResolver) { $this->instanceResolver = new InstanceInjector($this, $this->proxyFactory); } return $this->instanceResolver; default: throw new \RuntimeException('No definition resolver was configured for definition of type ' . $definition::class); } } }__halt_compiler();----SIGNATURE:----cfOhmOAv3jCcKZpnOIVICCBKUwBIBENjF9a881ZHoJjhD54woarubwtyJbvtrTTodsHn2r2XyEwM+jf0vCaVrWxvXVDaYPHaAnlaqJaPA3JjlDDWiMpY55cDPg9jYX2yNVRqQ4IZC76738C/ZtmU3ABwYU93RjUu0G4KvoceIHrkMOBB/c1/YULvTR/mb7FpC+E8qUdr41gTi+AfsCx5G46ZmPJ8yME/fy1nLIDqXlVbY89oDybrOrBGRRU5TClfzGvcojLQr1m+gECcPt5bVSfixW/+gNBmN/vd1u1Lw2/Mqu6jh/Eu8hdal0Q2Nx8TGZL396GRMHu9HercrWvgKS1c+jOWyHlfW1NwLBj5jIKwr98ZHA78p34x0elTTua4bYpx5N72U1DdMhA65a34E5aZFVM4l+rKI2jw46gmBhDeyTc0Z64Q6/JBYKBxYPEKu+8tqvfTyPrRqLJPEM1p2L2fqg6e57/K5PoKUewCLVUBKtnuy2cMhl5x4wopEPH0GY0LPsVSEB7SsMCK3BP4WNR1uvOZ1k+TB438ashECWOUk2tsXi72TdlQ469RqQSedHn7IwySR9jb1+au+u5HDEQm9MhJd2Y/hk7f/u6cN+buSCBVdo5Rj+BWobLSnURg6mEFKfdHjDh0pImCOqZZHJj26LoMFXzg/hRbY0jC/UQ=----ATTACHMENT:----MzU0MTIyMDU3MjIyNDE4MiAyODY0MjAzMTU5NjkwMzU0IDM2NzUyODUxOTExOTQyNjI=