Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Builder / Param.php
index 3e6e0f772e8c28a100127cd519446e577db7abe1..c029e748b74988b90f62754984a46f7cc4fb0681 100644 (file)
@@ -16,6 +16,8 @@ class Param extends PhpParser\BuilderAbstract
 
     protected $byRef = false;
 
+    protected $variadic = false;
+
     /**
      * Creates a parameter builder.
      *
@@ -65,6 +67,17 @@ class Param extends PhpParser\BuilderAbstract
         return $this;
     }
 
+    /**
+     * Make the parameter variadic
+     *
+     * @return $this The builder instance (for fluid interface)
+     */
+    public function makeVariadic() {
+        $this->variadic = true;
+
+        return $this;
+    }
+
     /**
      * Returns the built parameter node.
      *
@@ -72,7 +85,7 @@ class Param extends PhpParser\BuilderAbstract
      */
     public function getNode() {
         return new Node\Param(
-            $this->name, $this->default, $this->type, $this->byRef
+            $this->name, $this->default, $this->type, $this->byRef, $this->variadic
         );
     }
 }