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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Charlie ChX Negyesi created an issue. See original summary.

Ghost of Drupal Past’s picture

Ghost of Drupal Past’s picture

FileSize
684 bytes

D'oh.

Ghost of Drupal Past’s picture

Issue summary: View changes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

I agree totally with this assessment. The method definitely returns a Boolean and probably had documentation that was left over from an interim implementation.

Ghost of Drupal Past’s picture

Issue summary: View changes

probably had documentation that was left over from an interim implementation.

Oooo git archeology is my speciality. I can do that!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 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.

  • alexpott committed 4b0a908 on 9.0.x
    Issue #3094993 by Charlie ChX Negyesi: AccessCheckInterface::applies...

  • alexpott committed 4bce492 on 8.9.x
    Issue #3094993 by Charlie ChX Negyesi: AccessCheckInterface::applies...

  • alexpott committed 63c64f4 on 8.8.x
    Issue #3094993 by Charlie ChX Negyesi: AccessCheckInterface::applies...

Status: Fixed » Closed (fixed)

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