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

Breadcrumb

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

function TraceableCommand::run

Overrides Command::run

File

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

Class

TraceableCommand
@internal

Namespace

Symfony\Component\Console\Command

Code

public function run(InputInterface $input, OutputInterface $output) : int {
    $this->input = $input;
    $this->output = $output;
    $this->arguments = $input->getArguments();
    $this->options = $input->getOptions();
    $event = $this->stopwatch
        ->start($this->getName(), 'command');
    try {
        $this->exitCode = parent::run($input, $output);
    } finally {
        $event->stop();
        if ($output instanceof ConsoleOutputInterface && $output->isDebug()) {
            $output->getErrorOutput()
                ->writeln((string) $event);
        }
        $this->duration = $event->getDuration() . ' ms';
        $this->maxMemoryUsage = ($event->getMemory() >> 20) . ' MiB';
        if ($this->isInteractive) {
            $this->extractInteractiveInputs($input->getArguments(), $input->getOptions());
        }
    }
    return $this->exitCode;
}
RSS feed
Powered by Drupal