Summary
Drupal 11 object-oriented hook implementations must keep the framework-required method signature whether or not every parameter is used. RemoveUnusedPublicMethodParameterRector sees the unused parameter and removes it, which breaks the hook.
Two downstream Vortex sites on different teams hit this independently.
Details
Add a scoped skip rather than a blanket one, so the rule stays active everywhere the signature is genuinely the author's to choose:
RemoveUnusedPublicMethodParameterRector::class => [
// Object-oriented hook implementations must keep the framework-required
// signature even when a parameter is unused.
__DIR__ . '/web/modules/custom/*/src/Hook/*',
],
One downstream site scoped it to the Hook directory as above; another disabled the rule globally. The scoped form is the one to adopt.
Worth settling in the same pass:
- Whether the same reasoning applies to other framework-fixed signatures, such as event subscriber methods and plugin
create() factories.
- Whether the path pattern should cover custom themes as well as custom modules.
Summary
Drupal 11 object-oriented hook implementations must keep the framework-required method signature whether or not every parameter is used.
RemoveUnusedPublicMethodParameterRectorsees the unused parameter and removes it, which breaks the hook.Two downstream Vortex sites on different teams hit this independently.
Details
Add a scoped skip rather than a blanket one, so the rule stays active everywhere the signature is genuinely the author's to choose:
One downstream site scoped it to the
Hookdirectory as above; another disabled the rule globally. The scoped form is the one to adopt.Worth settling in the same pass:
create()factories.