Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / console / Input / ArrayInput.php
index af4c204bba30a163940bfbf46333e3932d614a2b..a44b6b2815cbdbc902ba9e2516f8b5579607c2f0 100644 (file)
@@ -57,7 +57,7 @@ class ArrayInput extends Input
     /**
      * {@inheritdoc}
      */
-    public function hasParameterOption($values)
+    public function hasParameterOption($values, $onlyParams = false)
     {
         $values = (array) $values;
 
@@ -66,6 +66,10 @@ class ArrayInput extends Input
                 $v = $k;
             }
 
+            if ($onlyParams && $v === '--') {
+                return false;
+            }
+
             if (in_array($v, $values)) {
                 return true;
             }
@@ -77,11 +81,15 @@ class ArrayInput extends Input
     /**
      * {@inheritdoc}
      */
-    public function getParameterOption($values, $default = false)
+    public function getParameterOption($values, $default = false, $onlyParams = false)
     {
         $values = (array) $values;
 
         foreach ($this->parameters as $k => $v) {
+            if ($onlyParams && ($k === '--' || (is_int($k) && $v === '--'))) {
+                return false;
+            }
+
             if (is_int($k)) {
                 if (in_array($v, $values)) {
                     return true;
@@ -119,6 +127,9 @@ class ArrayInput extends Input
     protected function parse()
     {
         foreach ($this->parameters as $key => $value) {
+            if ($key === '--') {
+                return;
+            }
             if (0 === strpos($key, '--')) {
                 $this->addLongOption(substr($key, 2), $value);
             } elseif ('-' === $key[0]) {