public static nameExists ( string $name, Exception $cause = null ) : static | ||
$name | string | The command name. |
$cause | Exception | The exception that caused this exception. |
Résultat | static | The created exception. |
public static function nameExists($name, Exception $cause = null)
{
return new static(sprintf('A command named "%s" exists already.', $name), self::NAME_EXISTS, $cause);
}
private function validateCommandName(CommandConfig $config) { $name = $config->getName(); if (!$name) { throw CannotAddCommandException::nameEmpty(); } if ($this->commands->contains($name)) { throw CannotAddCommandException::nameExists($name); } }