think\console\Input::getFirstArgument PHP 메소드

getFirstArgument() 공개 메소드

获取第一个参数
public getFirstArgument ( ) : string | null
리턴 string | null
    public function getFirstArgument()
    {
        foreach ($this->tokens as $token) {
            if ($token && '-' === $token[0]) {
                continue;
            }
            return $token;
        }
        return null;
    }

Usage Example

예제 #1
0
파일: Console.php 프로젝트: GDdark/cici
 /**
  * 获取指令的基础名称
  * @param Input $input
  * @return string
  */
 protected function getCommandName(Input $input)
 {
     return $input->getFirstArgument();
 }