diff --git a/core/lib/Drupal/Core/Routing/Router.php b/core/lib/Drupal/Core/Routing/Router.php index 6093271..58f6fb3 100644 --- a/core/lib/Drupal/Core/Routing/Router.php +++ b/core/lib/Drupal/Core/Routing/Router.php @@ -24,13 +24,13 @@ * It consists of several steps, of which each are explained in more details * below: * 1. Get a collection of routes which potentially match the current request: - * This is done by the route provider ::getInitialRouteCollection() + * This is done by the route provider, see ::getInitialRouteCollection(). * 2. Filter the collection down further more. For example this filters out - * routes applying to other formats: ::applyRouteFilters() + * routes applying to other formats: See ::applyRouteFilters() * 3. Find the best matching route out of the remaining ones, by applying a - * regex: ::matchCollection() + * regex: See ::matchCollection(). * 4. Enhance the list of route attributes, for example loading entity objects - * : ::applyRouteEnhancers(). + * See ::applyRouteEnhancers(). * * This implementation uses ideas of the following routers: * @@ -48,26 +48,28 @@ class Router extends UrlMatcher implements RequestMatcherInterface, RouterInterf protected $routeProvider; /** + * The list of available enhancers. + * * @var \Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[] */ protected $enhancers = []; /** - * Cached sorted list of enhancers + * Cached sorted list of enhancers. * * @var \Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[] */ protected $sortedEnhancers; /** - * An array of RouteFilterInterface objects. + * The list of available route filters. * * @var \Symfony\Cmf\Component\Routing\NestedMatcher\RouteFilterInterface[] */ protected $filters = []; /** - * Array of RouteFilterInterface objects, sorted. + * Cached sorted list route filters. * * @var \Symfony\Cmf\Component\Routing\NestedMatcher\RouteFilterInterface[] */ @@ -107,7 +109,7 @@ public function __construct(BaseRouteProviderInterface $route_provider, CurrentP * * @return $this */ - public function addRouteEnhancer(BaseRouteEnhancerInterface $route_enhancer, $priority) { + public function addRouteEnhancer(BaseRouteEnhancerInterface $route_enhancer, $priority = 0) { $this->enhancers[$priority][] = $route_enhancer; return $this; }