public function contains($name) { return isset($this->commands[$name]) || isset($this->shortNameIndex[$name]) || isset($this->aliasIndex[$name]); }
private function validateCommandName(CommandConfig $config) { $name = $config->getName(); if (!$name) { throw CannotAddCommandException::nameEmpty(); } if ($this->commands->contains($name)) { throw CannotAddCommandException::nameExists($name); } }