Skip to content

Review DeprecatedHookImplementation for removal #963

@mglaman

Description

@mglaman

Background

src/Rules/Deprecations/DeprecatedHookImplementation.php was added in November 2023 but has never been registered in rules.neon or extension.neon. It silently does nothing for users of this package.

Problems

  1. Never registered — the rule is not wired into any neon config, so no one is getting its checks.
  2. Hardcoded and stale — the only specific deprecation it detects is hook_field_widget_multivalue_form_alter (a Drupal 9→10 deprecation), hardcoded with a @todo acknowledging the approach is not extensible or intelligent.
  3. Superseded — Drupal 10+ hook deprecations are better handled via the Hook attribute system, which is already covered by other rules in this project.

Proposed resolution

Either:

  • Remove src/Rules/Deprecations/DeprecatedHookImplementation.php and its test tests/src/Rules/DeprecatedHookImplementationTest.php — the rule has never been active and the hardcoded hook it targets is an obsolete D9→D10 migration concern.
  • Or register and rewrite it using a data-driven approach if detecting deprecated procedural hook implementations is still a desired feature.

Given the narrow scope and the stale hardcoded logic, removal is the cleaner path unless there is a concrete plan to generalize it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions