From 524e4062b58215ef8731f3a0606fbaf434bda7f2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 2 Oct 2013 21:46:38 +0200 Subject: [PATCH] Revert "renamed an internal variable" This reverts commit a176fadc042bbfa09b0f304bef9ec89850f6e06f. --- lib/Twig/Node/Module.php | 4 ++-- lib/Twig/Template.php | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Twig/Node/Module.php b/lib/Twig/Node/Module.php index 224410a..551458a 100644 --- a/lib/Twig/Node/Module.php +++ b/lib/Twig/Node/Module.php @@ -249,7 +249,7 @@ class Twig_Node_Module extends Twig_Node ->addIndentation()->repr($name)->raw(" => array(\n") ->indent() ->write("'method' => ")->repr($node->getAttribute('method'))->raw(",\n") - ->write("'arguments' => array(\n") + ->write("'default_argument_values' => array(\n") ->indent() ; foreach ($node->getNode('arguments') as $argument => $value) { @@ -257,7 +257,7 @@ class Twig_Node_Module extends Twig_Node } $compiler ->outdent() - ->write("),\n") + ->write(")\n") ->outdent() ->write("),\n") ; diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index a42fab2..a27b801 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -479,7 +479,7 @@ abstract class Twig_Template implements Twig_TemplateInterface $i = 0; $args = array(); - foreach ($template->macros[$macro]['arguments'] as $name => $value) { + foreach ($template->macros[$macro]['default_argument_values'] as $name => $value) { if (isset($namedNames[$name])) { if ($i < $positionalCount) { throw new Twig_Error_Runtime(sprintf('Argument "%s" is defined twice for macro "%s" defined in the template "%s".', $name, $macro, $template->getTemplateName())); @@ -499,8 +499,7 @@ abstract class Twig_Template implements Twig_TemplateInterface } if ($namedCount > 0) { - $parameters = array_keys(array_diff_key($namedNames, $template->macros[$macro]['arguments'])); - + $parameters = array_keys(array_diff_key($namedNames, $template->macros[$macro]['default_argument_values'])); throw new Twig_Error_Runtime(sprintf('Unknown argument%s "%s" for macro "%s" defined in the template "%s".', count($parameters) > 1 ? 's' : '' , implode('", "', $parameters), $macro, $template->getTemplateName())); } -- 1.7.2.5