Пример #1
0
 /**
  * Validates the input.
  *
  * @throws \RuntimeException When not enough arguments are given
  */
 protected function validate()
 {
     if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
         throw new \RuntimeException('Not enough arguments.');
     }
     foreach ($this->arguments as $name => $value) {
         $this->arguments[$name] = call_user_func($this->definition->getArgument($name)->getFilter(), $value);
     }
     foreach ($this->options as $name => $value) {
         $this->options[$name] = call_user_func($this->definition->getOption($name)->getFilter(), $value);
     }
 }
Пример #2
0
 /**
  * Validates the input.
  *
  * @throws \RuntimeException When not enough arguments are given
  */
 public function validate()
 {
     if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
         throw new \RuntimeException('Not enough arguments.');
     }
 }