[3.2] Prevent double registrations related to tag priorities

This commit is contained in:
Nicolas Grekas 2017-04-12 17:25:29 +02:00
parent 0834f133ec
commit ec6a2f9eba

View File

@ -40,11 +40,9 @@ trait PriorityTaggedServiceTrait
{ {
$services = array(); $services = array();
foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tags) { foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $attributes) {
foreach ($tags as $attributes) { $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$priority = isset($attributes['priority']) ? $attributes['priority'] : 0; $services[$priority][] = new Reference($serviceId);
$services[$priority][] = new Reference($serviceId);
}
} }
if ($services) { if ($services) {