From 6174d091cc605e6e0c1770e41bc89304f4eb130f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 15 May 2025 15:18:10 +0200 Subject: [PATCH] [DependencyInjection] Fix missing binding for ServiceCollectionInterface when declaring a service subscriber --- .../Compiler/RegisterServiceSubscribersPass.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php b/src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php index 87470c39894e4..89b822bc53b44 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php @@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\TypedReference; use Symfony\Contracts\Service\Attribute\SubscribedService; +use Symfony\Contracts\Service\ServiceCollectionInterface; use Symfony\Contracts\Service\ServiceProviderInterface; use Symfony\Contracts\Service\ServiceSubscriberInterface; @@ -134,6 +135,7 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed $value->setBindings([ PsrContainerInterface::class => new BoundArgument($locatorRef, false), ServiceProviderInterface::class => new BoundArgument($locatorRef, false), + ServiceCollectionInterface::class => new BoundArgument($locatorRef, false), ] + $value->getBindings()); return parent::processValue($value);