renamed an internal variable

This commit is contained in:
Fabien Potencier
2013-08-03 18:36:32 +02:00
parent b7a54b0101
commit a176fadc04
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -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("'default_argument_values' => array(\n")
->write("'arguments' => 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")
;
+3 -2
View File
@@ -479,7 +479,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
$i = 0;
$args = array();
foreach ($template->macros[$macro]['default_argument_values'] as $name => $value) {
foreach ($template->macros[$macro]['arguments'] 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,7 +499,8 @@ abstract class Twig_Template implements Twig_TemplateInterface
}
if ($namedCount > 0) {
$parameters = array_keys(array_diff_key($namedNames, $template->macros[$macro]['default_argument_values']));
$parameters = array_keys(array_diff_key($namedNames, $template->macros[$macro]['arguments']));
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()));
}