public function getParams() { if ($this->params === null) { throw new \BadMethodCallException("Cannot get params from a route that has not been matched yet"); } return $this->params; }