*/ class ResolverDispatcher implements DefinitionResolver { /** @var ContainerInterface */ private $container; /** @var ProxyFactory */ private $proxyFactory; private $arrayResolver; private $factoryResolver; private $decoratorResolver; private $objectResolver; private $instanceResolver; private $envVariableResolver; public function __construct(ContainerInterface $container, ProxyFactory $proxyFactory) { $this->container = $container; $this->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. * * @throws InvalidDefinition If the definition cannot be resolved. * * @return mixed Value obtained from the definition. */ public function resolve(Definition $definition, array $parameters = []) { // 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 ' . get_class($definition)); } } } __halt_compiler();----SIGNATURE:----jH3PbhHiV+kn73VzjmOEVkJNAp/AUW9+0z7VJ1f6Fed2Bz5o3p+JxC5Kp5YV3hI5CrzMCifkA9TdDtPwPUdy4KX2mkg1j2aSkP90tnhe8uYtxMIvkjWfZGo66fg7ur2x6fWS2aRUPAFQVzb1IK2Bmw2JE3dGIoPf6NFoKU2XqpBNcNJwg0kpR8tTQqeJw7JecI7u5wxTIwCEt2vztNYgMhFwnpqqMErnuLLtGaQQZX8DLmemzWlkA3g9uc4JDWdnm/0xhhEWFAMoi1+FKgfK4qrarWKlBO6rd0Nup28PkfaBDLwtfBRtyVJ8X52h7SHJBmG9jqmVZYOB56n2a1Wz4YC9/7uqtjLZf8khrX2q+LduTiRvr/VrFw30BAnnwS1bOd08hn2mql+8A10yMrsuynWKx5hM37x1D1V1a74m4WPts5/lCDqbi33BBuqomR2FtjuxnAWphdvPRzuBBi/p0Pm6ypQJ1nJZZABPcL/K1NTNpFBxEN3ILIFa+YnTOGlwNqIzSq4FvPfEDCuGCRCSvbEBQaAfsjaBacDrErni96/ORRe33Kab5b+PlTXUpYmeo9N+fexEXpy6Kn5SWksT+soT0U4EWWZio6O6VoiF5fjFFIHHHwKWFA4tf5LDpP5R1LE+bzpJ+LkFMqCdLRIw96wQOomvDPO1yhHQdyvzoV8=----ATTACHMENT:----ODM3MDA4NTMzMjUwNDIxOCA5Mjg4MjA5MTY0Njc2MDIwIDQ5MzcwNDUwMTQ2MTI0MTQ=