Skip to content

Commit 06027b1

Browse files
committed
minor #13232 [TwigBundle] always load the exception listener if the templating.engines is not present (fabpot)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBundle] always load the exception listener if the templating.engines is not present | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | fixes #11876 partially | License | MIT | Doc PR | n/a This PR removes (partially) the dependency of TwigBundle on FrameworkBundle. If FrameworkBundle is not registered, the Twig exception listener is always registered (this change was part of #13143 but as it is now totally independent, I've created a new PR). Commits ------- 30ba9df [TwigBundle] always load the exception listener if the templating.engines is not present
2 parents 85bb180 + 9e7fc19 commit 06027b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

DependencyInjection/Compiler/ExceptionListenerPass.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ public function process(ContainerBuilder $container)
2828
}
2929

3030
// register the exception controller only if Twig is enabled
31-
$engines = $container->getParameter('templating.engines');
32-
if (!in_array('twig', $engines)) {
33-
$container->removeDefinition('twig.exception_listener');
31+
if ($container->hasParameter('templating.engines')) {
32+
$engines = $container->getParameter('templating.engines');
33+
if (!in_array('twig', $engines)) {
34+
$container->removeDefinition('twig.exception_listener');
35+
}
3436
}
3537
}
3638
}

0 commit comments

Comments
 (0)