From 788b26c7448da2f3625411555d8c3fcb43cad4ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 14 Oct 2025 17:01:14 +0200 Subject: [PATCH] Replace future abstract Node with EmptyNode and Nodes Replace AssignNameExpression with AssignContextVariable --- Parser/TokenParser.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- 2.41.3