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 91812e2

Browse filesBrowse files
committed
Iterating through all the tags on the service
1 parent e579aac commit 91812e2
Copy full SHA for 91812e2

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ public function process(ContainerBuilder $container)
3838
$container->getDefinition('serializer')->replaceArgument(1, $encoders);
3939
}
4040

41-
private function findAndSortTaggedServices($tag, $container)
41+
private function findAndSortTaggedServices($tag_name, $container)
4242
{
4343
// Find tagged services
4444
$servs = array();
45-
foreach ($container->findTaggedServiceIds($tag) as $serviceId => $value) {
46-
$priority = isset($value[0]['priority']) ? $value[0]['priority'] : 0;
47-
$servs[$priority][] = new Reference($serviceId);
45+
foreach ($container->findTaggedServiceIds($tag_name) as $serviceId => $tags) {
46+
foreach($tags as $tag) {
47+
$priority = isset($tag['priority']) ? $tag['priority'] : 0;
48+
$servs[$priority][] = new Reference($serviceId);
49+
}
4850
}
4951

5052
// Sort them
@@ -53,7 +55,7 @@ private function findAndSortTaggedServices($tag, $container)
5355
// Flatten the array
5456
$services = array();
5557
array_walk_recursive($servs, function($a) use (&$services) { $services[] = $a; });
56-
58+
5759
return $services;
5860
}
5961
}

0 commit comments

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