Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The RouteProvider has two methods which don't have to be public and they are not on any interface so if someone uses the service they should be not be aware of them anyways. The disruption should be zero.
Proposed resolution
Let's remove those
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#15 | 2609694-15.patch | 2.6 KB | dawehner |
Comments
Comment #2
dawehnerHere is a quick patch.
Comment #3
tim.plunkettLooks great!
Comment #4
chx CreditAttribution: chx commentedComment #7
xjm@chx, @dawehner, @alexpott, and I discussed this issue a bit as an interesting borderline case for #2550249: [meta] Document @internal APIs both explicitly in phpdoc and implicitly in d.o documentation.
I think we need to do one of:
The impressive quantity of failures make me wonder though. :)
Comment #8
tim.plunkettTurns out we use the route provider a lot. I think it's even more impressive the number of tests that passed!
Comment #10
dawehnerThere we go.
Core contributors trying to figure out a "quickfix" patch.
Comment #11
Crell CreditAttribution: Crell at Palantir.net commentedMaking the method protected makes complete sense here, but why inline it entirely? I'm hardly one to object to anonymous functions in general but does this improve or harm readability if the function cannot be examined in isolation?
Otherwise +1 on making these methods less-accessible.
Comment #12
dawehnerWell, its either inline or public, right?
Comment #13
tim.plunkettRight, *sort callbacks cannot be protected.
EDIT: Or can they?!?
https://3v4l.org/A4Mkc
Comment #14
Crell CreditAttribution: Crell at Palantir.net commentedhttps://3v4l.org/pG0M5 - Seems they can be protected. They just need to be accessible from the scope where the usort() is being run.
Comment #15
dawehnerComment #16
chx CreditAttribution: chx commentedWell, let's try. And, for the record, I amended http://php.net/manual/en/language.types.callable.php
Comment #18
tim.plunkettComment #19
Crell CreditAttribution: Crell at Palantir.net commented+1 from me.
Comment #20
xjmSo this doesn't do either of the things @alexpott and I recommended in #7. ;) Changing a method from public to protected is, in general, a BC break. Following the release of 8.0.0, we should not change public methods to protected unless the method is marked internal.
The case for allowing this change RC is:
RouteProviderInterface
Based on that, @effulgentsia and I decided to allow this change during RC. However, this is something of an exception--if it were after 8.0.0, or if they methods were even slightly less obscure, we'd probably lean toward not making the change without full BC.
So, committed and pushed to 8.0.x. Thanks everyone for weighing in on this!