getDefinition() public method

获取参数定义
public getDefinition ( ) : Definition
return think\console\input\Definition
Exemplo n.º 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;
 }