Conditions | 5 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function process(ContainerBuilder $container) |
||
26 | { |
||
27 | if (!$container->hasDefinition('fos_elastica.config_manager')) { |
||
28 | return; |
||
29 | } |
||
30 | |||
31 | $indexSources = array(); |
||
32 | $indexTemplateSources = array(); |
||
33 | foreach (array_keys($container->findTaggedServiceIds('fos_elastica.config_source')) as $id) { |
||
34 | $tag = $container->findDefinition($id)->getTag('fos_elastica.config_source'); |
||
35 | if (isset($tag[0]['source']) && $tag[0]['source'] === self::SOURCE_TYPE_INDEX_TEMPLATE) { |
||
36 | $indexTemplateSources[] = new Reference($id); |
||
37 | } else { |
||
38 | $indexSources[] = new Reference($id); |
||
39 | } |
||
40 | } |
||
41 | |||
42 | $container->getDefinition('fos_elastica.config_manager')->replaceArgument(0, $indexSources); |
||
43 | $container->getDefinition('fos_elastica.config_manager')->replaceArgument(1, $indexTemplateSources); |
||
44 | } |
||
45 | } |
||
46 |