Symfony\Component\Console\Command\Command::getDefinition PHP Метод

getDefinition() публичный Метод

Gets the InputDefinition attached to this Command.
public getDefinition ( ) : Symfony\Component\Console\Input\InputDefinition
Результат Symfony\Component\Console\Input\InputDefinition An InputDefinition instance
    public function getDefinition()
    {
        return $this->definition;
    }

Usage Example

 /**
  * @param Command $command
  * @param InputInterface $input
  */
 protected function addOptionsToCommand(Command $command, InputInterface $input)
 {
     $inputDefinition = $command->getApplication()->getDefinition();
     $inputDefinition->addOption(new InputOption(self::DISABLE_OPTIONAL_LISTENERS, null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, sprintf('Disable optional listeners, "%s" to disable all listeners, ' . 'command "%s" shows all listeners', self::ALL_OPTIONAL_LISTENERS_VALUE, OptionalListenersCommand::NAME)));
     $command->mergeApplicationDefinition();
     $input->bind($command->getDefinition());
 }
All Usage Examples Of Symfony\Component\Console\Command\Command::getDefinition