/**
* @return RouteRule
* @throws RouterException
*/
public function findRoute()
{
$path = $this->uri->getPathWithoutPrefix();
$requestType = Uri::getRequestType();
$rule = $this->findRouteRule($path, $requestType);
if (!$rule) {
throw new RouterException('No route rule found for HTTP method [' . $requestType . '] and URI [' . $path . ']');
}
$rule->setParameters($path);
return $rule;
}