Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2be5821

Browse filesBrowse files
[2.8] Prevent double registrations related to tag priorities
1 parent 6edd08d commit 2be5821
Copy full SHA for 2be5821

File tree

2 files changed

+6
-8
lines changed
Filter options

2 files changed

+6
-8
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/PropertyInfoPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/PropertyInfoPass.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ private function findAndSortTaggedServices($tagName, ContainerBuilder $container
5757
$services = $container->findTaggedServiceIds($tagName);
5858

5959
$sortedServices = array();
60-
foreach ($services as $serviceId => $tags) {
61-
foreach ($tags as $attributes) {
62-
$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
63-
$sortedServices[$priority][] = new Reference($serviceId);
64-
}
60+
foreach ($services as $serviceId => $attributes) {
61+
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
62+
$sortedServices[$priority][] = new Reference($serviceId);
6563
}
6664

6765
if (empty($sortedServices)) {

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PropertyInfoPassTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class PropertyInfoPassTest extends TestCase
2020
public function testServicesAreOrderedAccordingToPriority()
2121
{
2222
$services = array(
23-
'n3' => array('tag' => array()),
24-
'n1' => array('tag' => array('priority' => 200)),
25-
'n2' => array('tag' => array('priority' => 100)),
23+
'n3' => array(array()),
24+
'n1' => array(array('priority' => 200)),
25+
'n2' => array(array('priority' => 100)),
2626
);
2727

2828
$expected = array(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.