Skip to content

Commit ac8256b

Browse files
author
Robin Chalas
committed
[TwigBridge] Fix deprecation on twig 2.9
1 parent 2774705 commit ac8256b

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)