/** * @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; }
/** * @test * @dataProvider malformedSlashes * @param string $broken * @param string $good */ public function shouldReplaceTwoBackSlashes($broken, $good) { //given $this->_path(Config::getPrefixSystem() . $broken); //when $path = $this->uri->getPathWithoutPrefix(); //then $this->assertEquals($good, $path); }
public static function traceHttpRequest($params) { $uri = new Uri(); $requestDetails = $uri->getPathWithoutPrefix() . '#' . FrontController::$requestId; Session::push('stats_queries', $requestDetails, 'request_params', $params); }