示例#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
文件: Input.php 项目: scrobot/Lumen
 /**
  * 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.');
     }
 }