File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
DependencyInjection/CompilerPass Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 33namespace Prokl \BitrixOrdinaryToolsBundle ;
44
55use Prokl \BitrixOrdinaryToolsBundle \DependencyInjection \BitrixOrdinaryToolsExtension ;
6+ use Prokl \BitrixOrdinaryToolsBundle \DependencyInjection \CompilerPass \TwigTunerCompilerPass ;
67use Prokl \BitrixOrdinaryToolsBundle \DependencyInjection \CompilerPass \WarmersConfiguratorCompilerPass ;
78use Symfony \Component \DependencyInjection \ContainerBuilder ;
89use Symfony \Component \HttpKernel \Bundle \Bundle ;
@@ -35,5 +36,6 @@ public function build(ContainerBuilder $container) : void
3536 parent ::build ($ container );
3637
3738 $ container ->addCompilerPass (new WarmersConfiguratorCompilerPass ());
39+ $ container ->addCompilerPass (new TwigTunerCompilerPass ());
3840 }
3941}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Prokl \BitrixOrdinaryToolsBundle \DependencyInjection \CompilerPass ;
4+
5+ use Prokl \BitrixOrdinaryToolsBundle \Services \Twig \TwigRuntimesBag ;
6+ use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
7+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
8+
9+ /**
10+ * Class TwigTunerCompilerPass
11+ * @package Prokl\BitrixOrdinaryToolsBundle\DependencyInjection\CompilerPass
12+ *
13+ * @since 11.08.2021
14+ */
15+ final class TwigTunerCompilerPass implements CompilerPassInterface
16+ {
17+ /**
18+ * {@inheritdoc}
19+ */
20+ public function process (ContainerBuilder $ container )
21+ {
22+ if ($ container ->hasParameter ('twig.runtimes_export ' )
23+ &&
24+ !$ container ->getParameter ('twig.runtimes_export ' )
25+ ) {
26+ $ container ->removeDefinition (TwigRuntimesBag::class);
27+ }
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments