| Conditions | 4 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | public function process(ContainerBuilder $container) |
||
| 13 | { |
||
| 14 | $resourceCheckers = array(); |
||
| 15 | |||
| 16 | foreach ($container->findTaggedServiceIds('cmobi_rabbitmq.config_cache.resource_checker') as $id => $tags) { |
||
| 17 | $priority = isset($tags[0]['priority']) ? $tags[0]['priority'] : 0; |
||
| 18 | $resourceCheckers[$priority][] = new Reference($id); |
||
| 19 | } |
||
| 20 | |||
| 21 | if (empty($resourceCheckers)) { |
||
| 22 | return; |
||
| 23 | } |
||
| 24 | |||
| 25 | // sort by priority and flatten |
||
| 26 | krsort($resourceCheckers); |
||
| 27 | $resourceCheckers = call_user_func_array('array_merge', $resourceCheckers); |
||
| 28 | |||
| 29 | $container->getDefinition('cmobi_rabbitmq.config_cache_factory')->replaceArgument(0, $resourceCheckers); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |