/** * Add the given route to the arrays of routes. * * @param \Routing\Route $route * @return void */ protected function addToCollections($route) { $domainAndUri = $route->domain() . $route->getUri(); foreach ($route->methods() as $method) { $this->routes[$method][$domainAndUri] = $route; } $this->allRoutes[$method . $domainAndUri] = $route; }
/** * Validate a given rule against a route and request. * * @param \Routing\Route $route * @param \Http\Request $request * @return bool */ public function matches(Route $route, Request $request) { return in_array($request->getMethod(), $route->methods()); }