Support for deprecated route names and RouteMatch::getRouteName()

Aperta
#862 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
drupal, php

Direzione di ricerca

Read the Drupal issues linked in the description to understand the proposed deprecation support and replacement method. Then inspect how phpstan-drupal currently handles route deprecations and RouteMatch::getRouteName(). The issue leaves open whether to detect deprecated names in comparisons or warn on string comparisons, so done requires settling that behavior and adding matching analysis and coverage.

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

Descrizione

enhancement

Feature request

In https://www.drupal.org/project/drupal/issues/2723579 we realised that although we have deprecation support for routes, this doesn't work for RouteMatch::getRouteName() because that only returns a string for the current route.

We wondered whether it would be feasible to detect in phpstan when RouteMatch::getRouteName() is compared against a (hard coded) list of routes, and then point to the replacement route.

There is also https://www.drupal.org/project/drupal/issues/3506653 , which would provide a way to trigger a deprecation if a deprecated route name is used. But because there are valid reasons to get the current route name other than comparison, we wouldn't be able to deprecated RouteMatch::getRouteName() entirely.

However, if the hard-coded list of deprecated routes is not really viable, maybe phpstan could warn when the result of RouteMatch::getRouteName() is compared to a string, and recommend the new method instead?

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.