think\console\Command::getDefinition PHP 메소드

getDefinition() 공개 메소드

获取参数定义
public getDefinition ( ) : Definition
리턴 think\console\input\Definition
    public function getDefinition()
    {
        return $this->definition;
    }

Usage Example

예제 #1
0
 /**
  * 添加一个指令
  * @param Command $command
  * @return Command
  */
 public function add(Command $command)
 {
     $command->setConsole($this);
     if (!$command->isEnabled()) {
         $command->setConsole(null);
         return null;
     }
     if (null === $command->getDefinition()) {
         throw new \LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
     }
     $this->commands[$command->getName()] = $command;
     foreach ($command->getAliases() as $alias) {
         $this->commands[$alias] = $command;
     }
     return $command;
 }