Skip to content

Commit 766ae29

Browse files
committed
bug symfony#22401 [3.2] Prevent double registrations related to tag priorities (nicolas-grekas)
This PR was merged into the 3.2 branch. Discussion ---------- [3.2] Prevent double registrations related to tag priorities | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - symfony#22396 and symfony#22399 on 3.2 Commits ------- ec6a2f9 [3.2] Prevent double registrations related to tag priorities
2 parents 79d2c0e + ec6a2f9 commit 766ae29

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ private function findAndSortTaggedServices($tagName, ContainerBuilder $container
4040
{
4141
$services = array();
4242

43-
foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tags) {
44-
foreach ($tags as $attributes) {
45-
$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
46-
$services[$priority][] = new Reference($serviceId);
47-
}
43+
foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $attributes) {
44+
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
45+
$services[$priority][] = new Reference($serviceId);
4846
}
4947

5048
if ($services) {

0 commit comments

Comments
 (0)