* * @since 5.0 * @author Matthieu Napoli */ class DecoratorResolver implements DefinitionResolver { /** * The resolver needs a container. This container will be passed to the factory as a parameter * so that the factory can access other entries of the container. * * @param DefinitionResolver $definitionResolver Used to resolve nested definitions. */ public function __construct( private ContainerInterface $container, private DefinitionResolver $definitionResolver, ) { } /** * Resolve a decorator definition to a value. * * This will call the callable of the definition and pass it the decorated entry. * * @param DecoratorDefinition $definition */ public function resolve(Definition $definition, array $parameters = []): mixed { $callable = $definition->getCallable(); if (! is_callable($callable)) { throw new InvalidDefinition(sprintf( 'The decorator "%s" is not callable', $definition->getName() )); } $decoratedDefinition = $definition->getDecoratedDefinition(); if (! $decoratedDefinition instanceof Definition) { if (! $definition->getName()) { throw new InvalidDefinition('Decorators cannot be nested in another definition'); } throw new InvalidDefinition(sprintf( 'Entry "%s" decorates nothing: no previous definition with the same name was found', $definition->getName() )); } $decorated = $this->definitionResolver->resolve($decoratedDefinition, $parameters); return $callable($decorated, $this->container); } public function isResolvable(Definition $definition, array $parameters = []): bool { return true; } }__halt_compiler();----SIGNATURE:----pG8/RBNpC9V1lfY2Lvim6TDjPmnVTgjmHpLg697h1eTV2dIoEexw4xRAgGUhuJj4JOKYrioLr9Xb2+Syc4IcDuHFRbh3QTiabU9QDg+GgKJMRYQaKTRYIpAhORV/ZxW8E/zuauZAY7JKRxo4fCf9vaO0aVeZttPbPTMA5b1eHp6e30vDbWYlzXHwg9tNSB8oSgLxNI0QnbI2/eGpeUwddJ0ro5iPexi9loXmB6ebwKVLs40e8qIvnoN2VZjwi5G634AtEX4C4nbSz4c2GEUJIB77VJ00qURKTAwuS3vpwnEdUftpv7704ELM8vpji/P0vR7D/YNHHOiNKh5ogS7Bsf8TNSvPEwSCH3XT5PQXjksZLwd15pS4YhpEog3+VDCEvB/2BZ2Act7FU1XvJjVHI1MFXh3xAtJ0GbdjIVRusdoa5VGNEhmSATJT1lERPg3xhRPRabld4iWRpJhGw+Gm8erNbP6cCs2WNw7Fsir16MekV7m44xUyUROO1HEnnVEKQkM/QiVmJ3CkfLAaYdBlg7voyHSSg9Dwy0/B/o6kk7x7GwTkibJI0RbAUAvKzox378FuO0yJgTP955uhZzIzBwKfQQxOiW9eSFoI8iju2DXQCdNA/0G3GviZ6a4ay/q5gtkgJv5VpsR6ewStA/7M87cb0YDuY/F45eqUMjr9ToM=----ATTACHMENT:----MzIwNjI0NTkzMzYzODA5OCA0MzY3MDcwNTgwMDA1ODY2IDI2Mjc3NjA1NjE1MDE1NDU=