Problem/Motivation
The only use of AccessCheckInterface::applies
in core is in CheckProvider::applies
which treats the return value as boolean. Every implementation of this method in core, that being CsrfRequestHeaderAccessCheck::applies
happens to return a boolean. AccessManagerTest::testSetChecksWithDynamicAccessChecker
has a mock and it returns a boolean. All contrib I can see http://grep.xnddx.ru/search?text=AccessCheckInterface&filename= returns a boolean.
It was a boolean in #1793520: Add access control mechanism for new router system, it was modified to be an array in #2012382: Improve efficiency of access checker matching on routes but it seems to be incorrect there because it was the protected applies
method on AccessManager
which returned an array not the checkers themselves.
If it quacks like a duck and walks like a duck ... is it a duck?
Proposed resolution
Change the doxygen to say it's a boolean.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#3 | 3094993_3.patch | 684 bytes | Ghost of Drupal Past |
Comments
Comment #2
Ghost of Drupal PastComment #3
Ghost of Drupal PastD'oh.
Comment #4
Ghost of Drupal PastComment #5
jhodgdonI agree totally with this assessment. The method definitely returns a Boolean and probably had documentation that was left over from an interim implementation.
Comment #6
Ghost of Drupal PastOooo git archeology is my speciality. I can do that!
Comment #7
alexpottCommitted and pushed 4b0a908f49 to 9.0.x and 4bce492f63 to 8.9.x and 63c64f40e5 to 8.8.x. Thanks!
Backported to 8.8.x as a docs fix.