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

Đang mở
#862 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
drupal, php

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
PHP
Star
208
Fork
88
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mglaman/phpstan-drupal

Tất cả issue của mglaman/phpstan-drupal

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.