Splitting this out from #2368275: EntityRouteEnhancer and ContentFormControllerSubscriber implicitly depend on too many services which will reduce the dependency chain of the entity route enhancer. Opening this issue to address the issue more systemically, see the discussion there for more background.

Issue summary

Route enhancers are implemented as event listeners and all of them are run on every request. This is unnecessary since each route enhancer will only apply to a subset of routes. This is problematic as all dependencies together with their chain will have to be initialized, even they aren't used

Proposed solution

Proposed by znerol:

Wrap the existing route enhancers / route filters with a lazy version of them. The lazy version has stored for each route which enhancers/filters apply
to them. Based upon that, you just have to initialize the route filters/enhancers which are actually needed.

Api change

A new interface got introduced:

\Drupal\Core\Routing\Enhancer\RouteEnhancerInterface
and
\Drupal\Core\Routing\RouteFilterInterface

Existing route filters / enhancers will automatically take over all lazy ones, but you can opt out explictly using the 'non_lazy_route_filters' tag.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue priority Critical because of performance
Prioritized changes The main goal of this issue is performance.
Disruption Not disruptive, existing code with continue to work as exactly the same as before
CommentFileSizeAuthor
#90 interdiff.txt3.25 KBdawehner
#90 2368769-90.patch22.5 KBdawehner
#82 2368769-82.patch22.44 KBdawehner
#79 interdiff.txt4.71 KBdawehner
#79 2368769-79.patch22.44 KBdawehner
#77 interdiff.txt529 bytesdawehner
#77 2368769-77.patch23.11 KBdawehner
#73 interdiff.txt1.3 KBdawehner
#73 2368769-73.patch23.08 KBdawehner
#70 2368769-70.patch23.07 KBdawehner
#70 interdiff.txt1.97 KBdawehner
#68 2368769-68.patch22.94 KBdawehner
#68 interdiff.txt4.53 KBdawehner
#66 2368769-66.patch22.9 KBdawehner
#66 interdiff.txt2.09 KBdawehner
#64 2368769-64.patch22.88 KBdawehner
#64 interdiff.txt1 KBdawehner
#62 2368769-62.patch22.93 KBdawehner
#62 interdiff.txt7.4 KBdawehner
#61 2368769-61-do-not-test.patch20.13 KBkgoel
#61 interdiff.txt1.71 KBkgoel
#60 interdiff.txt2.8 KBdawehner
#57 interdiff.txt1.71 KBkgoel
#57 2368769-57.patch18.83 KBkgoel
#55 interdiff.txt1.03 KBkgoel
#55 2368769-55.patch20.13 KBkgoel
#52 interdiff.txt1.32 KBkgoel
#52 2368769-52.patch20.17 KBkgoel
#50 interdiff.txt5.35 KBkgoel
#50 2368769-50.patch20.16 KBkgoel
#47 interdiff.txt1.98 KBkgoel
#47 2368769-47-do-not-test.patch20.26 KBkgoel
#33 2368769-33.patch20.27 KBkgoel
#32 interdiff.txt4.63 KBkgoel
#32 2368769-32.patch20.33 KBkgoel
#29 interdiff.txt8.01 KBkgoel
#29 2368769-29.patch16.9 KBkgoel
#25 interdiff.txt8.58 KBdawehner
#25 2368769-25.patch15.48 KBdawehner
#24 interdiff.txt2.6 KBkgoel
#24 2368769-24.patch14.58 KBkgoel
#22 interdiff.txt720 byteskgoel
#22 2368769-22.patch13.91 KBkgoel
#19 interdiff.txt10.06 KBkgoel
#17 2368769-17.patch13.92 KBkgoel
#16 dont-test-2368769-16.patch13.3 KBkgoel
#13 dont-test-2368769-13.patch9.27 KBkgoel
#12 interdiff.txt2.97 KBkgoel
#12 do-not-test-2368769-12.patch7.31 KBkgoel
#9 interdiff.txt5.93 KBkgoel
#9 do-not-test-route-enhancers-2368769-9.patch7.81 KBkgoel
#5 2368769-5.patch3.41 KBdawehner

Comments

catch’s picture

dawehner’s picture

Assigned: Unassigned » dawehner

I kinda talked with lsmith about that but he seems to be not perfectly comfortable to add this lazyness to CMF.

I'll try to subclass the required classes to implement it. Note: We should do the same for route filters as well.
This speeds up things like not requiring AcceptHeaderMatcher for quite a lot of requests. (yes, HTML requests are still kinda special)

znerol’s picture

It might be possible to add one single proxy route enhancer to the dynamic router which then forwards applyRouteEnhancers() to lazy loaded drupal route enhancers. Like this we could avoid subclassing dynamic router.

larowlan’s picture

Pretty sure on admin pages they run more than once because of breadcrumb building, on a deep admin page eg admin/structure/types/manage/page/fields they might even run six times. Hope I'm wrong on that.

dawehner’s picture

StatusFileSize
new3.41 KB

Just posting work so far, not really helpful at all yet.

dawehner’s picture

Assigned: dawehner » Unassigned

There is no reason that I block progress on that issue.

dawehner’s picture

@kgoel wanted to work on this issue, just in case someone wants to directly work on this issue.

larowlan’s picture

@kgoel - still keen to work on this?
I'm willing to take a look too.

kgoel’s picture

StatusFileSize
new7.81 KB
new5.93 KB

Still need to take care route filters and add applies method in ParamConversionEnhancer.php, EntityRouteEnhancer.php, and AuthenticationEnhancer.php

jibran’s picture

  1. +++ b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
    @@ -90,4 +90,16 @@ public static function getSubscribedEvents() {
    +   * Determines if enhancers apply to a route.
    +   *
    +   * @param \Symfony\Component\Routing\Route $route
    +   *  The route to consider attaching to.
    +   *
    +   * @return bool
    +   *   TRUE if the check applies to the passed route, False otherwise.
    
    +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,118 @@
    +   * Determines if enhancers apply to a route.
    +   *
    +   * @param \Symfony\Component\Routing\Route $route
    +   *  The route to consider attaching to.
    +   *
    +   * @return bool
    +   *   TRUE if the check applies to the passed route, False otherwise.
    

    This can be replaced by {inheritdoc}.

  2. +++ b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
    @@ -90,4 +90,16 @@ public static function getSubscribedEvents() {
    +    return True;
    

    TRUE

  3. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,118 @@
    +class LazyRouteEnhancer implements BaseRouteEnhancerInterface, ContainerAwareInterface{
    

    space missing before {

  4. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,118 @@
    +   * @return \Symfony\Cmf\Component\Routing\Enhancer\RouteEnhancerInterface[]|\Drupal\Core\Routing\Enhancer\RouteEnhancerInterface[]
    

    Incomplete docs.

catch’s picture

Status: Active » Needs work

This looks encouraging so far.

kgoel’s picture

StatusFileSize
new7.31 KB
new2.97 KB
kgoel’s picture

StatusFileSize
new9.27 KB
dawehner’s picture

+++ b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
@@ -90,4 +90,10 @@ public static function getSubscribedEvents() {
+   */
+  protected function applies(Route $route) {
+    return ($route->getOption('parameters')) {
+  }
 }

can we cast this to a bool or even use $route->hasOption('parameters') maybe?

kgoel’s picture

Sure, hasOption is better since it returns bool.

kgoel’s picture

StatusFileSize
new13.3 KB
kgoel’s picture

StatusFileSize
new13.92 KB
dawehner’s picture

@kgoel
If possible, try to post interdiffs, even the progress might be small, but it makes it possible to follow your work a bit.

kgoel’s picture

StatusFileSize
new10.06 KB

long interdiff....since the old branch but will keep in mind to post interdiff from now on.

heddn’s picture

+++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
@@ -0,0 +1,98 @@
+use use Symfony\Component\Routing\Exception\RouteNotFoundException;

This will cause a runtime issue.

kgoel’s picture

Thanks Lucas! To be on the safe side, I blame late night patch :p

kgoel’s picture

StatusFileSize
new13.91 KB
new720 bytes
Crell’s picture

This doesn't remove an API, just technically provides an alternate, preferred approach. Non-lazy enhancers would still work, I think. That means there's no API change here, and doesn't solve a *current* significant performance issue (as the big one was already addressed). So... why is this critical? Seems like a major to me.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new14.58 KB
new2.6 KB
dawehner’s picture

Issue tags: +Ghent DA sprint
StatusFileSize
new15.48 KB
new8.58 KB

Worked a bit on adding @todos about the next steps we should do and fixed some small parts on the way.

The last submitted patch, 24: 2368769-24.patch, failed testing.

catch’s picture

Being able to fix this without an API change is good and the patch looks encouraging.

Question then comes down to whether the API addition could go into a patch-level release or only a minor release, and whether high-usage contrib modules are going to have route enhancers with long dependency chains or not. Don't know the exact answer to those questions.

See issue summary of #1744302: [meta] Resolve known performance regressions in Drupal 8 for the 'critical performance issue' criteria.

cilefen’s picture

Has this been profiled to show improved performance? I don't understand why it is critical otherwise. I reviewed some of the comments.

  1. +++ b/core/lib/Drupal/Core/Routing/Enhancer/RouteEnhancerInterface.php
    @@ -0,0 +1,30 @@
    + * An route enhance service to determine route enhance rules for particular
    + * routes.
    

    This should be on one line. What about "Determines route enhance rules."?

  2. +++ b/core/lib/Drupal/Core/Routing/Enhancer/RouteEnhancerInterface.php
    @@ -0,0 +1,30 @@
    +   * Declares whether the route enhancer applies to a specific route or not.
    

    This is a bit wordy for me. What about "Declares if the route enhancer applies to the given route."?

  3. +++ b/core/lib/Drupal/Core/Routing/Enhancer/RouteEnhancerInterface.php
    @@ -0,0 +1,30 @@
    +   *   TRUE if the check applies to the passed route, False otherwise.
    

    "False otherwise" is probably unnecessary.

  4. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,103 @@
    +   * Registers a new Enhancer by Enhancer.
    

    I don't understand what this means.

  5. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,103 @@
    +   * For each route, gets a list of applicable enhancer to the route.
    

    Should be "enhancers to the route".

  6. +++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
    @@ -0,0 +1,98 @@
    +   * Registers a new Filter by Filter.
    

    This is unclear to me.

  7. +++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
    @@ -0,0 +1,98 @@
    +   * For each route, gets a list of applicable enhancer to the route.
    

    "enhancers"

  8. +++ b/core/lib/Drupal/Core/Routing/RouteFilterInterface.php
    @@ -0,0 +1,29 @@
    +   * Declares whether the route filter applies to a specific route or not.
    +   *
    +   * @param \Symfony\Component\Routing\Route $route
    +   *  The route to consider attaching to.
    +   *
    +   * @return bool
    

    Same as above.

kgoel’s picture

StatusFileSize
new16.9 KB
new8.01 KB

Still need to address -

# @todo: We need a event listener which listens to RoutingEvents::ALTER
+ # And asks LazyRouteFilter::setFilters().

Do I need to create a new event listener?

Status: Needs review » Needs work

The last submitted patch, 29: 2368769-29.patch, failed testing.

dawehner’s picture

Do I need to create a new event listener?

A new one is probably a good idea here :)

kgoel’s picture

StatusFileSize
new20.33 KB
new4.63 KB
kgoel’s picture

StatusFileSize
new20.27 KB
kgoel’s picture

Status: Needs work » Needs review

The last submitted patch, 5: 2368769-5.patch, failed testing.

almaudoh’s picture

This could be why the tests are failing:

+++ b/core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php
@@ -0,0 +1,53 @@
+    $this->routeEnhaner->setEnhancers($event->getRouteCollection());

s/routeEnhaner/routeEnhancer/

kgoel’s picture

@almaudoh - Thanks for catching that! However, test is failing because of

route_filter_subscriber:
      class: Drupal\Core\EventSubscriber\RouteFilterSubscriber
        arguments: ['@route_filter']
        tags:
          - { name: event_subscriber }

There is something wrong with registering listener as a service and I am trying to figure out what have I missed here :)

dawehner’s picture

@kgoel
Are you sure its fine to use 4 spaces as intentation instead of 2, as the other part of the file?
Did you tried to put a print statement/debugger into RouteFilterSubscriber::onRequest() and see whether its triggered when you call drush cr?

kgoel’s picture

StatusFileSize
new20.26 KB
new1.98 KB

Fixed space and spell.

dawehner’s picture

Status: Needs work » Needs review

.

kgoel’s picture

Status: Needs review » Needs work

I don't think its called when I tried to run drush cr and this is what I am getting on my local -

PHP Catchable fatal error: Argument 1 passed to Drupal\Core\DrupalKernel::findSitePath() must be an instance of Symfony\Component\HttpFoundation\Request, null given, called in drupal-8/core/includes/utility.inc on line 40 and defined in drupal-8/core/lib/Drupal/Core/DrupalKernel.php on line 307

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new20.16 KB
new5.35 KB

Status: Needs review » Needs work

The last submitted patch, 50: 2368769-50.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new20.17 KB
new1.32 KB

Thanks @dawehner for your help!

Status: Needs review » Needs work

The last submitted patch, 52: 2368769-52.patch, failed testing.

kgoel’s picture

hmmm....I am not sure what's wrong at or around line 649 with arguments in core.services.yml .

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new20.13 KB
new1.03 KB

Status: Needs review » Needs work

The last submitted patch, 55: 2368769-55.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new18.83 KB
new1.71 KB

Status: Needs review » Needs work

The last submitted patch, 57: 2368769-57.patch, failed testing.

cilefen’s picture

In Url::createFromRequest(), line 263, \Drupal::service('router.no_access_checks')->matchRequest($request); returns an array without the '_raw_variables' key set.

dawehner’s picture

StatusFileSize
new2.8 KB

There are various things which have been wrong in my initial patch, see interdiff, ...

kgoel’s picture

StatusFileSize
new1.71 KB
new20.13 KB

I have added route enhancer back for ParamConversionEnhancer.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new7.4 KB
new22.93 KB

Now things install at least

Status: Needs review » Needs work

The last submitted patch, 62: 2368769-62.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1 KB
new22.88 KB

A small fix for the patch, but a great step for the bot.

Status: Needs review » Needs work

The last submitted patch, 64: 2368769-64.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new2.09 KB
new22.9 KB

Priority matters.

Status: Needs review » Needs work

The last submitted patch, 66: 2368769-66.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new4.53 KB
new22.94 KB

Let's fix it + minor nitpicks.

larowlan’s picture

  1. +++ b/core/core.services.yml
    @@ -641,21 +651,31 @@ services:
       route_enhancer.authentication:
         class: Drupal\Core\Routing\Enhancer\AuthenticationEnhancer
         tags:
    -      - { name: route_enhancer, priority: 1000 }
    +      - { name: lazy_route_enhancer, priority: 1000 }
    

    Does this belong as an enhancer (unrelated) - should it be hard-coded like the access subscriber for security reasons?

  2. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,103 @@
    + * For any route request, route listener service takes long response time as
    

    The grammar here is a bit patchy

  3. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,103 @@
    +// @todo Add some simple integration test, which checks some of the _entity_form
    +//   routes to include the expected options.
    

    can we get a follow up for this or do you intend to do it here?

  4. +++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
    @@ -0,0 +1,103 @@
    +        $this->enhancers[$service_id] = $this->container->get($service_id);
    

    is there a chance this could lead to stuff getting serialized inadvertently?

  5. +++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
    @@ -0,0 +1,99 @@
    +
    

    extra space here

dawehner’s picture

StatusFileSize
new1.97 KB
new23.07 KB

Thank you for your review!

Does this belong as an enhancer (unrelated) - should it be hard-coded like the access subscriber for security reasons?

There are various issues around that point. Hard coding is probably not a solution (much like hard coding access made things impossible / much harder)

The grammar here is a bit patchy

Improved a bit.

can we get a follow up for this or do you intend to do it here?

It works, let's just get rid of the todos

is there a chance this could lead to stuff getting serialized inadvertently?

MH, its the same as every other service, ... we rely on the DependencySerializationTrait

dawehner’s picture

Issue summary: View changes

Worked on the issue summary

wim leers’s picture

Status: Needs review » Needs work

Looks good; only one central question:

+++ b/core/core.services.yml
@@ -513,6 +513,16 @@ services:
+  lazy_route_filter:

@@ -646,21 +656,31 @@ services:
+  lazy_route_enhancer:

Why add a new service instead of making the existing one lazy?

I think the answer is what catch said in #27:

Being able to fix this without an API change is good and the patch looks encouraging.

Which is indeed great, but it also makes me question the value like Crell did in #23:

That means there's no API change here, and doesn't solve a *current* significant performance issue (as the big one was already addressed).

It's great that the current patch keeps disruption at zero. But that is not without consequences:

  1. it doesn't actually fix the performance problem, because it allows the same performance-problematic API to be used
  2. it ambiguates the DX: people have to know the difference and when to use which (well, there's no reason to not use the lazy version, but since both exist, they'll have to at least consider both)

If we were to do an API change instead, the entire change would boil down to a single additional method being required, which could even choose to simply return TRUE. IMHO that disruption cost is very low, because the changes are trivial, and doesn't cause a ripple effect in other parts of core. And there'd be no ambiguity in the DX.


  1. +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterLazyRouteEnhancers.php
    @@ -0,0 +1,38 @@
    + * Registers all route enhancers onto the lazy route enhancers.
    

    s/all route/all lazy route/

  2. +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterLazyRouteFilters.php
    @@ -0,0 +1,38 @@
    + * Registers all route filters onto the lazy route filter.
    

    s/all route filters/all lazy route filters/

  3. +++ b/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php
    @@ -90,4 +90,11 @@ public static function getSubscribedEvents() {
    +  public function applies(Route $route) {
    +    return TRUE;
    +  }
    

    Can't this check for the presence of {slugs}?

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new23.08 KB
new1.3 KB

it doesn't actually fix the performance problem, because it allows the same performance-problematic API to be used

This route was chosen, because we don't want to hack the dynamic router of symfony CMF, which is fine.

it doesn't actually fix the performance problem, because it allows the same performance-problematic API to be used

Right, but do you really think that there aren't ton of examples where people can do crap? Just imagine if someone uses a service in a event subscriber, boom!
So what about renaming the tag from lazy_route_enhancer and route_enhancer to non_lazy_route_enhancer?

Can't this check for the presence of {slugs}?

We can't because a lot of code relies on the existance of '_raw_variables' being out there.

wim leers’s picture

So what about renaming the tag from lazy_route_enhancer and route_enhancer to non_lazy_route_enhancer?

I think that'd help a bit.

The DX would still be worse than it is today though, but I guess route enhancers are not very commonly written anyway, and the clarification you suggested would help a bit. What about marking the non-lazy one as deprecated in 9.x? That sends a soft signal, subtly helping people to decide.

We can't because a lot of code relies on the existance of '_raw_variables' being out there.

:(

I couldn't find any code that'd cause problems with this though; either I'm overlooking something, or that big amount of code relying on the existence of _raw_variables doesn't affect us checking for the presence of slugs? And controllers relying on raw variables automatically implies they're not using the upcasted parameter? (Perhaps I'm saying something stupid now, but without diving into routing system internals, I think what I wrote makes sense?)

dawehner’s picture

I couldn't find any code that'd cause problems with this though; either I'm overlooking something, or that big amount of code relying on the existence of _raw_variables doesn't affect us checking for the presence of slugs? And controllers relying on raw variables automatically implies they're not using the upcasted parameter? (Perhaps I'm saying something stupid now, but without diving into routing system internals, I think what I wrote makes sense?)

I don't remember which code broke, but there was certainly quite a lot of it, see earlier fails. It was more generic code than simple controllers,

wim leers’s picture

Any chance that's simply no longer true due to changes in that code?

Other reviewers: do you share the concerns I raised in #72.1? Do you agree that what dawehner proposed in #73 (his lazy vs non-lazy naming proposal) would help?

dawehner’s picture

StatusFileSize
new23.11 KB
new529 bytes

Any chance that's simply no longer true due to changes in that code?

I highly doubt that, but let's try it out.

Status: Needs review » Needs work

The last submitted patch, 77: 2368769-77.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new22.44 KB
new4.71 KB

Let's use the other one, but also rename the tag.

almaudoh’s picture

I agree with #76that using non-lazy would be better. @dawehner in #73 you said "non_lazy_route_enhancer" but in the code #79 you used not_lazy_route_enhancer. If you ask me, I think "non_lazy_xx" sounds better than "not_lazy_xx".

wim leers’s picture

Status: Needs review » Needs work

I have to agree with almaudoh.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new22.44 KB

Meh

dawehner’s picture

Meh

dawehner’s picture

Issue summary: View changes
wim leers’s picture

Issue tags: +Needs change record

I think this needs a CR for the API change+addition? After that, this is RTBC.

dawehner’s picture

Done

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

I clarified the CR further.

No further remarks.

webchick’s picture

Assigned: Unassigned » catch

Awesome. :) Passing this to catch for review, since he's our performance guru.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/core.services.yml
    @@ -525,7 +525,17 @@ services:
    +      - { name: service_collector, tag: non_lazy_route_filter, call: addRouteFilter }
    ...
    +      - { name: non_lazy_route_filter, call: addRouteFilter }
    

    The call here is wrong.

  2. +++ b/core/core.services.yml
    @@ -525,7 +525,17 @@ services:
    +  lazy_route_filter:
    

    let's call this route_filter.lazy_collector

  3. +++ b/core/core.services.yml
    @@ -659,6 +669,16 @@ services:
    +  lazy_route_enhancer:
    

    Let's call this route_enhancer.lazy_collector

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new22.5 KB
new3.25 KB

There we go

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2b1f9f4 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

diff --git a/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
index 1f27b8d..51d0b68 100644
--- a/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
+++ b/core/lib/Drupal/Core/Routing/LazyRouteEnhancer.php
@@ -27,7 +27,7 @@ class LazyRouteEnhancer implements BaseRouteEnhancerInterface, ContainerAwareInt
   use ContainerAwareTrait;
 
   /**
-   * Array of enhancers keyed by service id.
+   * Array of enhancers service IDs.
    *
    * @var array
    */
@@ -40,6 +40,12 @@ class LazyRouteEnhancer implements BaseRouteEnhancerInterface, ContainerAwareInt
    */
   protected $enhancers = NULL;
 
+  /**
+   * Constructs the LazyRouteEnhancer object.
+   *
+   * @param $service_ids
+   *   Array of enhancers service IDs.
+   */
   public function __construct($service_ids) {
     $this->serviceIds = $service_ids;
   }
diff --git a/core/lib/Drupal/Core/Routing/LazyRouteFilter.php b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
index 7c2f404..288e09b 100644
--- a/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
+++ b/core/lib/Drupal/Core/Routing/LazyRouteFilter.php
@@ -25,7 +25,7 @@ class LazyRouteFilter implements BaseRouteFilterInterface, ContainerAwareInterfa
   use ContainerAwareTrait;
 
   /**
-   * Array of filter keyed by service id.
+   * Array of route filter service IDs.
    *
    * @var array
    */
@@ -38,6 +38,12 @@ class LazyRouteFilter implements BaseRouteFilterInterface, ContainerAwareInterfa
    */
   protected $filters = NULL;
 
+  /**
+   * Constructs the LazyRouteEnhancer object.
+   *
+   * @param $service_ids
+   *   Array of route filter service IDs.
+   */
   public function __construct($service_ids) {
     $this->serviceIds = $service_ids;
   }
@@ -48,7 +54,6 @@ public function __construct($service_ids) {
    * @param \Symfony\Component\Routing\RouteCollection $route_collection
    *   A collection of routes to apply filter checks to.
    */
-
   public function setFilters(RouteCollection $route_collection) {
     /** @var \Symfony\Component\Routing\Route $route **/
     foreach ($route_collection as $route) {
diff --git a/core/lib/Drupal/Core/Routing/RouteFilterInterface.php b/core/lib/Drupal/Core/Routing/RouteFilterInterface.php
index f671a2e..bbbee1f 100644
--- a/core/lib/Drupal/Core/Routing/RouteFilterInterface.php
+++ b/core/lib/Drupal/Core/Routing/RouteFilterInterface.php
@@ -16,13 +16,13 @@
 interface RouteFilterInterface extends BaseRouteFilterInterface {
 
   /**
-   * Declaresif the route filter applies to the given route.
+   * Determines if the route filter applies to the given route.
    *
    * @param \Symfony\Component\Routing\Route $route
    *  The route to consider attaching to.
    *
    * @return bool
-   *   TRUE if the check applies to the passed route, False otherwise.
+   *   TRUE if the check applies to the passed route, FALSE otherwise.
    */
   public function applies(Route $route);

Doc fixes made on commit.

  • alexpott committed 2b1f9f4 on 8.0.x
    Issue #2368769 by kgoel, dawehner: All route enhancers are run on every...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.