function Command::__construct
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
28 calls to Command::__construct()
- CompleteCommand::__construct in vendor/
symfony/ console/ Command/ CompleteCommand.php - CompleteCommand::__construct in vendor/
symfony/ console/ Command/ CompleteCommand.php - DebugCommand::__construct in vendor/
symfony/ serializer/ Command/ DebugCommand.php - DebugCommand::__construct in vendor/
symfony/ validator/ Command/ DebugCommand.php - DebugCommand::__construct in vendor/
symfony/ serializer/ Command/ DebugCommand.php
15 methods override Command::__construct()
- CompleteCommand::__construct in vendor/
symfony/ console/ Command/ CompleteCommand.php - DebugCommand::__construct in vendor/
symfony/ serializer/ Command/ DebugCommand.php - DebugCommand::__construct in vendor/
symfony/ validator/ Command/ DebugCommand.php - GenerateProxyClassCommand::__construct in core/
lib/ Drupal/ Core/ Command/ GenerateProxyClassCommand.php - Constructs a new GenerateProxyClassCommand instance.
- GenerateTheme::__construct in core/
lib/ Drupal/ Core/ Command/ GenerateTheme.php - GenerateTheme constructor.
File
-
vendor/
symfony/ console/ Command/ Command.php, line 80
Class
- Command
- Base class for all commands.
Namespace
Symfony\Component\Console\CommandCode
public function __construct(?string $name = null) {
$this->definition = new InputDefinition();
if (null === $name && null !== ($name = static::getDefaultName())) {
$aliases = explode('|', $name);
if ('' === ($name = array_shift($aliases))) {
$this->setHidden(true);
$name = array_shift($aliases);
}
$this->setAliases($aliases);
}
if (null !== $name) {
$this->setName($name);
}
if ('' === $this->description) {
$this->setDescription(static::getDefaultDescription() ?? '');
}
$this->configure();
}