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

Breadcrumb

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

function LazyCommand::getCommand

File

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

Class

LazyCommand
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\Console\Command

Code

public function getCommand() : parent {
    if (!$this->command instanceof \Closure) {
        return $this->command;
    }
    $command = $this->command = ($this->command)();
    $command->setApplication($this->getApplication());
    if (null !== $this->getHelperSet()) {
        $command->setHelperSet($this->getHelperSet());
    }
    $command->setName($this->getName())
        ->setAliases($this->getAliases())
        ->setHidden($this->isHidden())
        ->setDescription($this->getDescription());
    // Will throw if the command is not correctly initialized.
    $command->getDefinition();
    return $command;
}
RSS feed
Powered by Drupal