From ec6a2f9ebaaeaf7c1855d308d2dbe3365f4679db Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 12 Apr 2017 17:25:29 +0200 Subject: [PATCH] [3.2] Prevent double registrations related to tag priorities --- .../Compiler/PriorityTaggedServiceTrait.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php b/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php index 83f6014c39357..64c041e93f3a7 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php @@ -40,11 +40,9 @@ private function findAndSortTaggedServices($tagName, ContainerBuilder $container { $services = array(); - foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tags) { - foreach ($tags as $attributes) { - $priority = isset($attributes['priority']) ? $attributes['priority'] : 0; - $services[$priority][] = new Reference($serviceId); - } + foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $attributes) { + $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; + $services[$priority][] = new Reference($serviceId); } if ($services) {