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

Breadcrumb

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

function TraceableCommand::setCode

Calling parent method is required to be used in {

Overrides Command::setCode

See also

parent::run()}.

1 call to TraceableCommand::setCode()
TraceableCommand::__construct in vendor/symfony/console/Command/TraceableCommand.php

File

vendor/symfony/console/Command/TraceableCommand.php, line 172

Class

TraceableCommand
@internal

Namespace

Symfony\Component\Console\Command

Code

public function setCode(callable $code) : static {
    $this->command
        ->setCode($code);
    return parent::setCode(function (InputInterface $input, OutputInterface $output) use ($code) : int {
        $event = $this->stopwatch
            ->start($this->getName() . '.code');
        $this->exitCode = $code($input, $output);
        $event->stop();
        return $this->exitCode;
    });
}
RSS feed
Powered by Drupal