minor #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
-------
ac8256ba9c
[TwigBridge] Fix deprecation on twig 2.9
This commit is contained in:
commit
a975d2ba84
@ -24,6 +24,7 @@ use Twig\Node\ModuleNode;
|
|||||||
use Twig\Node\Node;
|
use Twig\Node\Node;
|
||||||
use Twig\Node\SetNode;
|
use Twig\Node\SetNode;
|
||||||
use Twig\NodeVisitor\AbstractNodeVisitor;
|
use Twig\NodeVisitor\AbstractNodeVisitor;
|
||||||
|
use Twig\TokenParser\ApplyTokenParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
@ -95,7 +96,8 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
|||||||
protected function doLeaveNode(Node $node, Environment $env)
|
protected function doLeaveNode(Node $node, Environment $env)
|
||||||
{
|
{
|
||||||
if ($node instanceof TransDefaultDomainNode) {
|
if ($node instanceof TransDefaultDomainNode) {
|
||||||
return false;
|
// must return null as of Twig 2.9
|
||||||
|
return class_exists(ApplyTokenParser::class) ? null : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
|
if ($node instanceof BlockNode || $node instanceof ModuleNode) {
|
||||||
|
Reference in New Issue
Block a user