| Conditions | 6 |
| Paths | 9 |
| Total Lines | 24 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 2 | public function process(ContainerBuilder $container) |
|
| 29 | { |
||
| 30 | 2 | if ($container->has('runopencode.exchange_rate.registry.processors')) { |
|
| 31 | |||
| 32 | 1 | $definition = $container->findDefinition('runopencode.exchange_rate.registry.processors'); |
|
| 33 | |||
| 34 | 1 | $processors = array(); |
|
| 35 | |||
| 36 | 1 | foreach ($container->findTaggedServiceIds('runopencode.exchange_rate.processor') as $id => $tags) { |
|
| 37 | |||
| 38 | 1 | foreach ($tags as $attributes) { |
|
| 39 | 1 | $processors[$id] = !empty($attributes['priority']) ? (int)$attributes['priority'] : 0; |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 1 | asort($processors); |
|
| 44 | |||
| 45 | 1 | foreach ($processors as $id => $processor) { |
|
| 46 | 1 | $definition->addMethodCall('add', array( |
|
| 47 | 1 | new Reference($id) |
|
| 48 | )); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | 2 | } |
|
| 52 | } |
||
| 53 |