Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
23 | public function process(ContainerBuilder $container) |
||
24 | { |
||
25 | $definition = $container->getDefinition('sculpin_twig.twig'); |
||
26 | |||
27 | // Extensions must always be registered before everything else. |
||
28 | // For instance, global variable definitions must be registered |
||
29 | // afterward. If not, the globals from the extensions will never |
||
30 | // be registered. |
||
31 | $calls = $definition->getMethodCalls(); |
||
32 | $definition->setMethodCalls([]); |
||
33 | foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) { |
||
34 | $definition->addMethodCall('addExtension', [new Reference($id)]); |
||
35 | } |
||
36 | $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls)); |
||
37 | } |
||
38 | } |
||
39 |