Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Command.php

function Command::execute

Same name in this branch
  1. 11.1.x vendor/phpunit/phpunit/src/TextUI/Command/Command.php \PHPUnit\TextUI\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.

Return value

int 0 if everything went fine, or an exit 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.
51 methods override Command::execute()
AboutCommand::execute in vendor/composer/composer/src/Composer/Command/AboutCommand.php
Executes the current command.
ArchiveCommand::execute in vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
Executes the current command.
AuditCommand::execute in vendor/composer/composer/src/Composer/Command/AuditCommand.php
Executes the current command.
BumpCommand::execute in vendor/composer/composer/src/Composer/Command/BumpCommand.php
CheckPlatformReqsCommand::execute in vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php
Executes the current command.

... See full list

File

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

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal