Skip to content

Commit a975d2b

Browse files
minor symfony#31281 [TwigBridge] Fix deprecation on twig 2.9 (chalasr)
This PR was merged into the 3.4 branch. Discussion ---------- [TwigBridge] Fix deprecation on twig 2.9 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes$ | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a should make travis green Commits ------- ac8256b [TwigBridge] Fix deprecation on twig 2.9
2 parents eaba717 + ac8256b commit a975d2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Twig\Node\Node;
2525
use Twig\Node\SetNode;
2626
use Twig\NodeVisitor\AbstractNodeVisitor;
27+
use Twig\TokenParser\ApplyTokenParser;
2728

2829
/**
2930
* @author Fabien Potencier <fabien@symfony.com>
@@ -95,7 +96,8 @@ protected function doEnterNode(Node $node, Environment $env)
9596
protected function doLeaveNode(Node $node, Environment $env)
9697
{
9798
if ($node instanceof TransDefaultDomainNode) {
98-
return false;
99+
// must return null as of Twig 2.9
100+
return class_exists(ApplyTokenParser::class) ? null : false;
99101
}
100102

101103
if ($node instanceof BlockNode || $node instanceof ModuleNode) {

0 commit comments

Comments
 (0)