think\console\input\Definition::getArgumentRequiredCount PHP Method

getArgumentRequiredCount() public method

获取必填的参数的数量
    public function getArgumentRequiredCount()
    {
        return $this->requiredCount;
    }

Usage Example

Example #1
0
 /**
  * 验证输入
  * @throws \RuntimeException
  */
 public function validate()
 {
     if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
         throw new \RuntimeException('Not enough arguments.');
     }
 }