]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - vendor/twig/twig/lib/Twig/Node/Expression/Call.php
twig implementation
[github/wallabag/wallabag.git] / vendor / twig / twig / lib / Twig / Node / Expression / Call.php
similarity index 95%
rename from inc/3rdparty/Twig/Node/Expression/Call.php
rename to vendor/twig/twig/lib/Twig/Node/Expression/Call.php
index 87b62deb09e69482e6f10aab42a087ec957c3311..dba9b0e6272b8f0bdc0079fd6d68c582b79f52fd 100644 (file)
@@ -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;