Overview
In writing #3485233-24: Add phpstan-baseline Composer script to root composer.json, I looked at our PHPStan baseline/ignores. It includes:
-
message: '#^Attribute class Drupal\\Core\\Hook\\Attribute\\LegacyRequirementsHook does not exist\.$#'
identifier: attribute.notFound
count: 1
path: canvas.install
… which felt kinda off to see in there.
This was introduced in #3561392: Test Canvas on Drupal 11.3, ~2.5 months ago, to get Canvas to pass tests/CI on 11.3. It seems innocent, right?
🐲 However, reading the docblock for LegacyRequirementsHook:
* Marking requirements hooks as #LegacyRequirementsHook will prevent them
* from running on Drupal 11.3.0 and later.
Manually tested and … sure enough, our requirements hook does not fire on >=11.3!
Proposed resolution
Make it run again.
User interface changes
Comments
Comment #3
wim leersComment #4
wim leersWow, looks like this was simply … unnecessary 😅
Comment #5
wim leersComment #6
penyaskitoIf we can ensure all are converted already, we should be using
(see https://www.drupal.org/node/3498595)
Comment #7
wim leersDiscussed this with @penyaskito; that CR should indeed be implemented by Canvas, but is not actually the scope here. The scope here is to ensure
hook_requirements()actually works on 11.3.For #6, we opened #3588641: Follow core's #3498595 CR and OOPify in Canvas.
Comment #9
penyaskito🚢 See you in #3588641: Follow core's #3498595 CR and OOPify in Canvas
Comment #11
penyaskitoAnd also in #3588685: CI: *.install changes skipping phpunit 🐛