Conditions | 4 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function process(ContainerBuilder $container): void |
||
20 | { |
||
21 | if (!$container->hasDefinition('admin.context.manager')) { |
||
22 | return; |
||
23 | } |
||
24 | |||
25 | $contexts = []; |
||
26 | foreach ($container->findTaggedServiceIds('admin.context') as $id => $tags) { |
||
27 | $priority = $tags[0]['priority'] ?? 0; |
||
28 | $contexts[$priority][] = $container->findDefinition($id); |
||
29 | } |
||
30 | |||
31 | if (empty($contexts)) { |
||
32 | return; |
||
33 | } |
||
34 | krsort($contexts); |
||
35 | $contexts = array_merge(...$contexts); |
||
36 | |||
37 | $container->findDefinition('admin.context.manager')->replaceArgument(0, $contexts); |
||
38 | } |
||
39 | } |
||
40 |