diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 16:08:25 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 16:08:25 +1000 |
| commit | 9c48084f3b5064d580a5c88a6fe9170599cf8879 (patch) | |
| tree | cfee62fb06abbd182568efa0395be2077a021fca /inc/lib/Twig/Node/Expression/Call.php | |
| parent | 01857d176a2a9a2e3816b9cbf32da0c58f6aac3d (diff) | |
upgrade twig library
Diffstat (limited to 'inc/lib/Twig/Node/Expression/Call.php')
| -rwxr-xr-x[-rw-r--r--] | inc/lib/Twig/Node/Expression/Call.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/lib/Twig/Node/Expression/Call.php b/inc/lib/Twig/Node/Expression/Call.php index 87b62deb..dba9b0e6 100644..100755 --- a/inc/lib/Twig/Node/Expression/Call.php +++ b/inc/lib/Twig/Node/Expression/Call.php @@ -146,7 +146,7 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression if (array_key_exists($name, $parameters)) { if (array_key_exists($pos, $parameters)) { - throw new Twig_Error_Syntax(sprintf('Arguments "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); } $arguments[] = $parameters[$name]; @@ -164,8 +164,8 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression } } - foreach (array_keys($parameters) as $name) { - throw new Twig_Error_Syntax(sprintf('Unknown argument "%s" for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + if (!empty($parameters)) { + throw new Twig_Error_Syntax(sprintf('Unknown argument%s "%s" for %s "%s".', count($parameters) > 1 ? 's' : '' , implode('", "', array_keys($parameters)), $this->getAttribute('type'), $this->getAttribute('name'))); } return $arguments; |
