protected function getCommandClass($id) { if (isset($this->commands[$id])) { return $this->commands[$id]; } throw new Exception(sprintf("command %s not found in %s", $id, get_called_class())); }