From: Raphaƫl Gertz Date: Tue, 14 Oct 2025 15:01:14 +0000 (+0200) Subject: Replace future abstract Node with EmptyNode and Nodes X-Git-Tag: 0.5.7~2 X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/788b26c7448da2f3625411555d8c3fcb43cad4ee?ds=inline Replace future abstract Node with EmptyNode and Nodes Replace AssignNameExpression with AssignContextVariable --- diff --git a/Parser/TokenParser.php b/Parser/TokenParser.php index 7d73117..a1fe4c5 100644 --- a/Parser/TokenParser.php +++ b/Parser/TokenParser.php @@ -26,8 +26,10 @@ use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\RouterInterface; use Twig\Error\Error; -use Twig\Node\Expression\AssignNameExpression; +use Twig\Node\Expression\Variable\AssignContextVariable; use Twig\Node\Node; +use Twig\Node\Nodes; +use Twig\Node\EmptyNode; use Twig\Node\SetNode; use Twig\Node\TextNode; use Twig\Source; @@ -245,7 +247,7 @@ class TokenParser extends AbstractTokenParser { #throw new Error('Empty inputs token', $token->getLine(), $stream->getSourceContext()); //Send an empty node without inputs - return new Node(); + return new EmptyNode(); } //Check filters @@ -329,13 +331,13 @@ class TokenParser extends AbstractTokenParser { } //Set name in context key - $ref = new AssignNameExpression($this->token, $token->getLine()); + $ref = new AssignContextVariable($this->token, $token->getLine()); //Set output in context value $value = new TextNode($asset, $token->getLine()); //Send body with context set - return new Node([ + return new Nodes([ //This define name in twig template by prepending $context[''] = ''; new SetNode(true, $ref, $value, $token->getLine(), $this->getTag()), //The tag captured body