From: Fabien Potencier Date: Wed, 2 Oct 2013 19:46:45 +0000 (+0200) Subject: Revert "added an exception when a macro re-uses the same argument name twice" X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c3e05f3bac232bfd321dd37f211504368e1d0736;p=konrad%2Ftwig.git Revert "added an exception when a macro re-uses the same argument name twice" This reverts commit b7a54b01017becf7f3b90beadc71536b58e2299a. --- diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index 9deab09..8f85745 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -482,7 +482,7 @@ class Twig_ExpressionParser $value = $this->parsePrimaryExpression(); if (!$this->checkConstantExpression($value)) { - throw new Twig_Error_Syntax('A default value for an argument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $this->parser->getFilename()); } } else { $value = $this->parseExpression(); @@ -497,10 +497,6 @@ class Twig_ExpressionParser if (null === $name) { $args[] = $value; } else { - if ($definition && isset($args[$name])) { - throw new Twig_Error_Syntax(sprintf('Arguments cannot contain the same argument name more than once ("%s" is defined twice).', $name), $token->getLine(), $this->parser->getFilename()); - } - $args[$name] = $value; } }