Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
11 | 2 | public function process(ContainerBuilder $container) |
|
12 | { |
||
13 | 2 | if (!$container->has('handlebars.helper')) { |
|
14 | 1 | return; |
|
15 | } |
||
16 | |||
17 | 1 | $definition = $container->findDefinition( |
|
18 | 1 | 'handlebars.helper' |
|
19 | ); |
||
20 | |||
21 | 1 | $taggedServices = $container->findTaggedServiceIds( |
|
22 | 1 | 'handlebars.helper' |
|
23 | ); |
||
24 | 1 | foreach ($taggedServices as $id => $tags) { |
|
25 | 1 | foreach ($tags as $tag) { |
|
26 | 1 | $definition->addMethodCall( |
|
27 | 1 | 'addHelper', |
|
28 | 1 | array($tag['id'], new Reference($id)) |
|
29 | ); |
||
30 | } |
||
31 | } |
||
32 | 1 | } |
|
33 | } |
||
34 |