Skip to content

Commit 86f4ac3

Browse files
minor #27691 [DI] Cleanup unused service_subscriber.locator tag (ro0NL)
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Cleanup unused service_subscriber.locator tag | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes-ish | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Cleanup internal DI tag `container.service_subscriber.locator` so it's _not_ reported as unused tag, i.e.: ``` Tag "container.service_subscriber.locator" was defined on service(s) "App\Controller\MainController", "translation.warmer", "router.cache_warmer", "twig.cache_warmer", "twig.template_cache_warmer", but was never used. Did you mean "container.service_subscriber", "container.service_locator"? ``` Commits ------- 8e060fa45d [DI] Cleanup unused service_subscriber.locator tag
2 parents ca7423f + ad6d968 commit 86f4ac3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Compiler/ResolveServiceSubscribersPass.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ protected function processValue($value, $isRoot = false)
3535
}
3636

3737
$serviceLocator = $this->serviceLocator;
38-
$this->serviceLocator = $value->hasTag('container.service_subscriber.locator') ? $value->getTag('container.service_subscriber.locator')[0]['id'] : null;
38+
$this->serviceLocator = null;
39+
40+
if ($value->hasTag('container.service_subscriber.locator')) {
41+
$this->serviceLocator = $value->getTag('container.service_subscriber.locator')[0]['id'];
42+
$value->clearTag('container.service_subscriber.locator');
43+
}
3944

4045
try {
4146
return parent::processValue($value);

0 commit comments

Comments
 (0)