You are here

protected function HelpCommand::execute in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Command/HelpCommand.php \Symfony\Component\Console\Command\HelpCommand::execute()

Executes the current command.

This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.

Parameters

InputInterface $input An InputInterface instance:

OutputInterface $output An OutputInterface instance:

Return value

null|int null or 0 if everything went fine, or an error code

Throws

\LogicException When this abstract method is not implemented

Overrides Command::execute

See also

setCode()

File

vendor/symfony/console/Command/HelpCommand.php, line 73

Class

HelpCommand
HelpCommand displays the help for a given command.

Namespace

Symfony\Component\Console\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  if (null === $this->command) {
    $this->command = $this
      ->getApplication()
      ->find($input
      ->getArgument('command_name'));
  }
  if ($input
    ->getOption('xml')) {
    @trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED);
    $input
      ->setOption('format', 'xml');
  }
  $helper = new DescriptorHelper();
  $helper
    ->describe($output, $this->command, array(
    'format' => $input
      ->getOption('format'),
    'raw_text' => $input
      ->getOption('raw'),
  ));
  $this->command = null;
}