Beispiel #1
0
 /**
  * Set the argument's value
  *
  * @param array $argv
  * @param Argument $argument
  * @param int $key
  * @param string|null $value
  *
  * @return array The new $argv
  */
 protected function setArgumentValue($argv, $argument, $key, $value)
 {
     // Arguments are given the value true if they only need to
     // be defined on the command line to be set.
     if ($argument->noValue()) {
         $argument->setValue(true);
         return $argv;
     }
     if (is_null($value)) {
         // If the value wasn't previously defined in "key=value"
         // format then define it from the next command argument.
         $argument->setValue($argv[++$key]);
         unset($argv[$key]);
         return $argv;
     }
     $argument->setValue($value);
     return $argv;
 }