You are here

protected function Foo3Command::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Fixtures/Foo3Command.php \Foo3Command::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/Tests/Fixtures/Foo3Command.php, line 17

Class

Foo3Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  try {
    try {
      throw new \Exception('First exception <p>this is html</p>');
    } catch (\Exception $e) {
      throw new \Exception('Second exception <comment>comment</comment>', 0, $e);
    }
  } catch (\Exception $e) {
    throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 0, $e);
  }
}