Skip to content

Commit e236c06

Browse files
committed
fix compatibility with Twig 3.12 and 4.0
1 parent 14b1b4d commit e236c06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function enterNode(Node $node, Environment $env): Node
6161
return $node;
6262
}
6363

64-
if ($node instanceof FilterExpression && 'trans' === $node->getNode('filter')->getAttribute('value')) {
64+
if ($node instanceof FilterExpression && 'trans' === ($node->hasAttribute('twig_callable') ? $node->getAttribute('twig_callable')->getName() : $node->getNode('filter')->getAttribute('value'))) {
6565
$arguments = $node->getNode('arguments');
6666
if ($this->isNamedArguments($arguments)) {
6767
if (!$arguments->hasNode('domain') && !$arguments->hasNode(1)) {

0 commit comments

Comments
 (0)