Skip to content

Commit 905d138

Browse files
bug #60428 [DependencyInjection] Fix missing binding for ServiceCollectionInterface when declaring a service subscriber (nicolas-grekas)
This PR was merged into the 7.2 branch. Discussion ---------- [DependencyInjection] Fix missing binding for ServiceCollectionInterface when declaring a service subscriber | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Looks like we forgot this in #53163 I figured it out when reviewing symfony/symfony-docs#20961 Commits ------- 6174d09 [DependencyInjection] Fix missing binding for ServiceCollectionInterface when declaring a service subscriber
2 parents 4b35f2e + 6174d09 commit 905d138

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\DependencyInjection\Reference;
2121
use Symfony\Component\DependencyInjection\TypedReference;
2222
use Symfony\Contracts\Service\Attribute\SubscribedService;
23+
use Symfony\Contracts\Service\ServiceCollectionInterface;
2324
use Symfony\Contracts\Service\ServiceProviderInterface;
2425
use Symfony\Contracts\Service\ServiceSubscriberInterface;
2526

@@ -134,6 +135,7 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
134135
$value->setBindings([
135136
PsrContainerInterface::class => new BoundArgument($locatorRef, false),
136137
ServiceProviderInterface::class => new BoundArgument($locatorRef, false),
138+
ServiceCollectionInterface::class => new BoundArgument($locatorRef, false),
137139
] + $value->getBindings());
138140

139141
return parent::processValue($value);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy