You are here

protected function Command::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Command/Command.php \Symfony\Component\Console\Command\Command::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

See also

setCode()

1 call to Command::execute()
Command::run in vendor/symfony/console/Command/Command.php
Runs the command.
14 methods override Command::execute()
DbCommandBaseTester::execute in core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
Executes the current command.
DbDumpCommand::execute in core/lib/Drupal/Core/Command/DbDumpCommand.php
Executes the current command.
DbImportCommand::execute in core/lib/Drupal/Core/Command/DbImportCommand.php
Executes the current command.
Foo1Command::execute in vendor/symfony/console/Tests/Fixtures/Foo1Command.php
Executes the current command.
Foo2Command::execute in vendor/symfony/console/Tests/Fixtures/Foo2Command.php
Executes the current command.

... See full list

File

vendor/symfony/console/Command/Command.php, line 161

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  throw new \LogicException('You must override the execute() method in the concrete command class.');
}