Skip to content

Commit 42e6fae

Browse files
authored
feat: Twig\Node\Expression\FilterExpression use attribute instate of node (#177)
1 parent 44d8690 commit 42e6fae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Visitor/Twig/Worker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function work(Node $node, SourceCollection $collection, callable $getAbso
3636
$this->stack[] = $node;
3737
if ($node instanceof FilterExpression && $node->getNode('node') instanceof ConstantExpression) {
3838
$domain = null;
39-
if ('trans' === $node->getNode('filter')->getAttribute('value')) {
39+
if ('trans' === $node->getAttribute('twig_callable')->getName()) {
4040
$domain = $this->getReadDomainFromArguments($node->getNode('arguments'), 1);
41-
} elseif ('transchoice' === $node->getNode('filter')->getAttribute('value')) {
41+
} elseif ('transchoice' === $node->getAttribute('twig_callable')->getName()) {
4242
$domain = $this->getReadDomainFromArguments($node->getNode('arguments'), 2);
4343
}
4444

@@ -83,7 +83,7 @@ private function extractContextFromJoinedFilters(): array
8383
if (!$this->stack[$i] instanceof FilterExpression) {
8484
break;
8585
}
86-
$name = $this->stack[$i]->getNode('filter')->getAttribute('value');
86+
$name = $this->stack[$i]->getAttribute('twig_callable')->getName();
8787
if ('trans' === $name) {
8888
break;
8989
} elseif ('desc' === $name) {

0 commit comments

Comments
 (0)