8000 bug #48482 [DependencyInjection] Revert "bug #48027 Don't autoconfigu… · symfony/symfony@3b75e0a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b75e0a

Browse files
bug #48482 [DependencyInjection] Revert "bug #48027 Don't autoconfigure tag when it's already set with attributes" (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] Revert "bug #48027 Don't autoconfigure tag when it's already set with attributes" | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | | Tickets | Fix #48388 | License | MIT | Doc PR | - Reverting #48027, which is a regression. Commits ------- bd2780a Revert "bug #48027 [DependencyInjection] Don't autoconfigure tag when it's already set with attributes (nicolas-grekas)"
2 parents 7e30473 + bd2780a commit 3b75e0a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function processDefinition(ContainerBuilder $container, string $id, Defi
129129
foreach ($instanceofTags[$i] as $k => $v) {
130130
if (null === $definition->getDecoratedService() || \in_array($k, $tagsToKeep, true)) {
131131
foreach ($v as $v) {
132-
if ($definition->hasTag($k) && (!$v || \in_array($v, $definition->getTag($k)))) {
132+
if ($definition->hasTag($k) && \in_array($v, $definition->getTag($k))) {
133133
continue;
134134
}
135135
$definition->addTag($k, $v);

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ static function (ChildDefinition $definition, CustomAutoconfiguration $attribute
883883
$definition->addTag('app.custom_tag', get_object_vars($attribute) + ['class' => $reflector->getName()]);
884884
}
885885
);
886-
$container->registerForAutoconfiguration(TaggedService1::class)->addTag('app.custom_tag');
887886

888887
$container->register('one', TaggedService1::class)
889888
->setPublic(true)

0 commit comments

Comments
 (0)
0