function Command::setAliases
Sets the aliases for the command.
Parameters
string[] $aliases An array of aliases for the command:
Return value
$this
Throws
InvalidArgumentException When an alias is invalid
1 call to Command::setAliases()
- Command::__construct in vendor/
symfony/ console/ Command/ Command.php
File
-
vendor/
symfony/ console/ Command/ Command.php, line 574
Class
- Command
- Base class for all commands.
Namespace
Symfony\Component\Console\CommandCode
public function setAliases(iterable $aliases) : static {
$list = [];
foreach ($aliases as $alias) {
$this->validateName($alias);
$list[] = $alias;
}
$this->aliases = \is_array($aliases) ? $aliases : $list;
return $this;
}