You are here

public function Command::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Command/Command.php \Symfony\Component\Console\Command\Command::__construct()

Constructor.

Parameters

string|null $name The name of the command; passing null means it must be set in configure():

Throws

\LogicException When the command name is empty

1 call to Command::__construct()
GenerateProxyClassCommand::__construct in core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php
Constructs a new GenerateProxyClassCommand instance.
3 methods override Command::__construct()
BarCommand::__construct in vendor/symfony/http-kernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php
Constructor.
Foo5Command::__construct in vendor/symfony/console/Tests/Fixtures/Foo5Command.php
Constructor.
GenerateProxyClassCommand::__construct in core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php
Constructs a new GenerateProxyClassCommand instance.

File

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

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function __construct($name = null) {
  $this->definition = new InputDefinition();
  if (null !== $name) {
    $this
      ->setName($name);
  }
  $this
    ->configure();
  if (!$this->name) {
    throw new \LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
  }
}