8000 [TwigBundle] removed Stopwatch Twig extension when the Stopwatch comp… · symfony/symfony@3d4ad0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d4ad0b

Browse files
committed
[TwigBundle] removed Stopwatch Twig extension when the Stopwatch component is not available
1 parent d0792e4 commit 3d4ad0b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,9 @@ public function process(ContainerBuilder $container)
7575
if (class_exists('Symfony\Component\Yaml\Parser')) {
7676
$container->getDefinition('twig.extension.yaml')->addTag('twig.extension');
7777
}
78+
79+
if (class_exists('Symfony\Component\Stopwatch\Stopwatch')) {
80+
$container->getDefinition('twig.extension.debug.stopwatch')->addTag('twig.extension');
81+
}
7882
}
7983
}

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
<service id="twig.extension.yaml" class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false" />
9999

100100
<service id="twig.extension.debug.stopwatch" class="Symfony\Bridge\Twig\Extension\StopwatchExtension" public="false">
101-
<tag name="twig.extension" />
102101
<argument type="service" id="debug.stopwatch" on-invalid="ignore" />
103102
<argument>%kernel.debug%</argument>
104103
</service>

0 commit comments

Comments
 (0)
0