Skip to content

Commit

Permalink
Fix MacroNode $name argument can be overridden
Browse files Browse the repository at this point in the history
Fix #4515
  • Loading branch information
smnandre committed Dec 26, 2024
1 parent c1f7277 commit dc329fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Node/MacroNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function __construct(string $name, Node $body, Node $arguments, int $line
trigger_deprecation('twig/twig', '3.15', \sprintf('Not passing a "%s" instance as the "arguments" argument of the "%s" constructor is deprecated ("%s" given).', ArrayExpression::class, static::class, $arguments::class));

$args = new ArrayExpression([], $arguments->getTemplateLine());
foreach ($arguments as $name => $default) {
$args->addElement($default, new LocalVariable($name, $default->getTemplateLine()));
foreach ($arguments as $n => $default) {
$args->addElement($default, new LocalVariable($n, $default->getTemplateLine()));
}
$arguments = $args;
}
Expand Down

0 comments on commit dc329fd

Please sign in to comment.