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

Breadcrumb

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

function FactoryCommandLoader::get

Overrides CommandLoaderInterface::get

File

vendor/symfony/console/CommandLoader/FactoryCommandLoader.php, line 37

Class

FactoryCommandLoader
A simple command loader using factories to instantiate commands lazily.

Namespace

Symfony\Component\Console\CommandLoader

Code

public function get(string $name) : Command {
    if (!isset($this->factories[$name])) {
        throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name));
    }
    $factory = $this->factories[$name];
    return $factory();
}

API Navigation

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