routes = $collection; $context = new RequestContext(); $context->fromRequest($request); $this->setContext($context); return $this->match($request->getPathInfo()); } /** * {@inheritdoc} */ protected function getAttributes(Route $route, $name, array $attributes) { if ($route instanceof RouteObjectInterface && is_string($route->getRouteKey())) { $name = $route->getRouteKey(); } $attributes[RouteObjectInterface::ROUTE_NAME] = $name; $attributes[RouteObjectInterface::ROUTE_OBJECT] = $route; return $this->mergeDefaults($attributes, $route->getDefaults()); } }