Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
12 | 5 | public function process(ContainerBuilder $container) |
|
13 | { |
||
14 | 5 | $extractors = array(); |
|
15 | |||
16 | 5 | foreach ($container->findTaggedServiceIds('incenteev_translation_checker.extractor') as $id => $tags) { |
|
17 | 4 | $extractors[] = new Reference($id); |
|
18 | 5 | } |
|
19 | |||
20 | // If there is only one configured extractor, skip the chain one |
||
21 | 5 | if (1 === count($extractors)) { |
|
22 | 3 | $container->setAlias('incenteev_translation_checker.extractor', new Alias((string) $extractors[0], $container->getAlias('incenteev_translation_checker.extractor')->isPublic())); |
|
23 | |||
24 | 3 | return; |
|
25 | } |
||
26 | |||
27 | 2 | $container->getDefinition('incenteev_translation_checker.extractor.chain')->replaceArgument(0, $extractors); |
|
28 | 2 | } |
|
29 | } |
||
30 |