diff --git a/src/Visitor/Twig/Worker.php b/src/Visitor/Twig/Worker.php index 6a2c467..484f117 100644 --- a/src/Visitor/Twig/Worker.php +++ b/src/Visitor/Twig/Worker.php @@ -36,9 +36,9 @@ public function work(Node $node, SourceCollection $collection, callable $getAbso $this->stack[] = $node; if ($node instanceof FilterExpression && $node->getNode('node') instanceof ConstantExpression) { $domain = null; - if ('trans' === $node->getNode('filter')->getAttribute('value')) { + if ('trans' === $node->getAttribute('twig_callable')->getName()) { $domain = $this->getReadDomainFromArguments($node->getNode('arguments'), 1); - } elseif ('transchoice' === $node->getNode('filter')->getAttribute('value')) { + } elseif ('transchoice' === $node->getAttribute('twig_callable')->getName()) { $domain = $this->getReadDomainFromArguments($node->getNode('arguments'), 2); } @@ -83,7 +83,7 @@ private function extractContextFromJoinedFilters(): array if (!$this->stack[$i] instanceof FilterExpression) { break; } - $name = $this->stack[$i]->getNode('filter')->getAttribute('value'); + $name = $this->stack[$i]->getAttribute('twig_callable')->getName(); if ('trans' === $name) { break; } elseif ('desc' === $name) {