Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function process(DI\ContainerBuilder $container) |
||
10 | { |
||
11 | if ($container->hasDefinition('profiler') === false) { |
||
12 | return; |
||
13 | } |
||
14 | |||
15 | $definition = new DI\Definition("PommProject\\SymfonyBridge\\Controller\\PommProfilerController", [ |
||
16 | new DI\Reference('router'), |
||
17 | new DI\Reference('profiler'), |
||
18 | new DI\Reference('twig'), |
||
19 | new DI\Reference('pomm') |
||
20 | ]); |
||
21 | $definition->setPublic(true); |
||
22 | $container->setDefinition('pomm.controller.profiler', $definition); |
||
23 | |||
24 | $definition = new DI\Definition( |
||
25 | "PommProject\\PommBundle\\Twig\\Extension\\ProfilerExtension", |
||
26 | [new DI\Reference('twig.loader.filesystem')] |
||
27 | ); |
||
28 | //we run after the twig tags are collected so we need to manually do what twig compiler pass does |
||
29 | $twig = $container->getDefinition('twig'); |
||
30 | $twig->addMethodCall('addExtension', [new DI\Reference('pomm.twig_extension')]); |
||
31 | |||
32 | $container->setDefinition('pomm.twig_extension', $definition); |
||
33 | } |
||
34 | } |
||
35 |