* * @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:----nMa2rv6q+QL+m5xsaWdKpzYt5x++wdrsA+6mHTqAyQNQweiWjTCoQcv6r/VknZksXu7S1bhtxeU/1RhgIcUcDrQCbWpRbm9mdSapUYuIqfitLwqJJawalWo0yiS3pjtzLwgEBfXc4F1T/yre9LS4cHgh216JUK6uKh21iuRS5HNud6domgjVvq39H/QIM8yUGEmJly5FHOucsX6avCKijmBmJM60qHjN3Z6hcVTxh8ZdzLNz9iMtnaU4lksQSUnq9+B+9Ja44aj3TkRDFiTSQ0uLtqD7VPY5XGilFyve8+BiWptv/iUaoOi3YRz5/pWpMV2lqtbJY/BDECIP7wXF2OtnICrXGvx411HxpZ/DzZ1aKPoJV5WGgG7LOsI1mdIcLpmrhqLi3Pq8JoMiLtpVsOTiybF33i73/E1qvuUIwt/ebYFDWK11ksPi9S8/jxcexYyskf3X/tcKNr+k+QIMsW16mxd8KPuVOQjO7Jp/FoP7qCRvbOF9LimLvE7BpgRdhZk55640a/o4kRxIFPNO2olxTPglHR0uNRvkm95ioR7eVXMWIq6xV6riLesGVtnRxIXncICM/bJm/IdOVC8Kbd1Ss/QBuLJo5L4S2OLmPpktbLzneklA/XJZqBXqeRk3OwI0qC3s5Yna54SdPc+1S9M3fkmcJFiWIPQwZsDXr3o=----ATTACHMENT:----OTc0MzU4NTk0MTAxMzU5MCA0NjQ0NzcyMDU2NTU1MTc3IDkxNzI4NjQ1OTMxOTA4MTQ=