think\console\input\Definition::hasArgument PHP 메소드

hasArgument() 공개 메소드

根据名称或位置检查是否具有某个参数
public hasArgument ( string | integer $name ) : boolean
$name string | integer 参数名或者位置
리턴 boolean
    public function hasArgument($name)
    {
        $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
        return isset($arguments[$name]);
    }

Usage Example

예제 #1
0
파일: Input.php 프로젝트: Lofanmi/think
 /**
  * 检查是否存在某个参数
  * @param string|int $name 参数名或位置
  * @return bool
  */
 public function hasArgument($name)
 {
     return $this->definition->hasArgument($name);
 }