Skip to content

Commit

Permalink
bug #4516 Fix MacroNode $name argument can be overridden (smnandre)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

Fix MacroNode $name argument can be overridden

Fix #4515

Commits
-------

dc329fd Fix MacroNode $name argument can be overridden
  • Loading branch information
fabpot committed Dec 26, 2024
2 parents c1f7277 + dc329fd commit 681af9d
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 681af9d

Please sign in to comment.