From d23ef414386e23a8c39fa008ea81919bcbbd04a2 Mon Sep 17 00:00:00 2001 From: Gordon Franke Date: Mon, 30 Sep 2024 14:26:45 +0200 Subject: [PATCH] feat: Twig\Node\Expression\FilterExpression use attribute instate of node --- src/Visitor/Twig/Worker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) {