public function setDefaultCommand($name = null) { if ($name !== null && !isset($this->commands[$name])) { throw new ConsoleException("Command '{$name}' does not exist"); } $this->defaultCommand = $name; }