Review DeprecatedHookImplementation for removal

Aperta
#963 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
drupal, php
Ambito
tooling

Direzione di ricerca

Read src/Rules/Deprecations/DeprecatedHookImplementation.php and tests/src/Rules/DeprecatedHookImplementationTest.php, then check rules.neon and extension.neon to confirm the rule is unregistered. The issue favors removing the rule and its test; done means both are removed and the remaining configuration and tests no longer refer to them. The alternative requires a concrete plan to generalize the rule.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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.

Lingua principale
PHP
Stelle
208
Fork
88
Merge medio
2g 17h
PR unite (30g)
15

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mglaman/phpstan-drupal

Tutte le issue di mglaman/phpstan-drupal

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.