function Command::validateName
Validates a command name.
It must be non-empty and parts can optionally be separated by ":".
Throws
InvalidArgumentException When the name is invalid
2 calls to Command::validateName()
- Command::setAliases in vendor/
symfony/ console/ Command/ Command.php - Sets the aliases for the command.
- Command::setName in vendor/
symfony/ console/ Command/ Command.php - Sets the name of the command.
File
-
vendor/
symfony/ console/ Command/ Command.php, line 658
Class
- Command
- Base class for all commands.
Namespace
Symfony\Component\Console\CommandCode
private function validateName(string $name) : void {
if (!preg_match('/^[^\\:]++(\\:[^\\:]++)*$/', $name)) {
throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name));
}
}