| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 1 | public function process(ContainerBuilder $container) |
|
| 24 | { |
||
| 25 | 1 | $registryDefinition = $container->getDefinition('postman.request_parser.chain'); |
|
| 26 | |||
| 27 | 1 | $requestParsers = []; |
|
| 28 | 1 | foreach ($container->findTaggedServiceIds('postman.request_parser') as $serviceId => $tags) { |
|
| 29 | 1 | $attributes = $container->getDefinition($serviceId)->getTag('postman.request_parser'); |
|
| 30 | 1 | $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; |
|
| 31 | 1 | $requestParsers[$priority][] = new Reference($serviceId); |
|
| 32 | 1 | } |
|
| 33 | 1 | krsort($requestParsers); |
|
| 34 | |||
| 35 | 1 | $registryDefinition->replaceArgument(0, call_user_func_array('array_merge', $requestParsers)); |
|
| 36 | 1 | } |
|
| 37 | } |
||
| 38 |