| Conditions | 5 |
| Paths | 7 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function process(ContainerBuilder $container): void |
||
| 19 | { |
||
| 20 | if (!$container->hasDefinition(self::COLLECTOR_SVC_ID)) { |
||
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | $collector = $container->findDefinition(self::COLLECTOR_SVC_ID); |
||
| 25 | $mappersDefinitions = $container->findTaggedServiceIds(self::MAPPER_TAG); |
||
| 26 | $queue = new \SplPriorityQueue(); |
||
| 27 | |||
| 28 | foreach ($mappersDefinitions as $mapperId => $mapperTags) { |
||
| 29 | foreach ($mapperTags as $tagAttributes) { |
||
| 30 | $priority = $tagAttributes['priority'] ?? 0; |
||
| 31 | $queue->insert($mapperId, $priority); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | $mappers = []; |
||
| 36 | foreach ($queue as $mapperId) { |
||
| 37 | $mappers[] = new Reference($mapperId); |
||
| 38 | } |
||
| 39 | |||
| 40 | $collector->replaceArgument(0, $mappers); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |