Support for deprecated preprocess variables
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 43/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
- Lĩnh vực
- devtools, testing-qa
Hướng nghiên cứu
Read the linked Drupal issue 3458183 and its predecessor 3458587, then inspect how phpstan-drupal analyzes Drupal preprocess hooks. The issue suggests detecting direct $variables['teaser'] access using a list of deprecated variable names, while avoiding matches such as $variables['view_mode'] === 'teaser'. Done means adding useful detection for deprecated preprocess variables with limited false positives; the issue does not name files or tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feature request
Core added support for deprecating Twig variables a couple of years ago, it has not been used much yet, CR is here: https://www.drupal.org/node/3334622
In https://www.drupal.org/project/drupal/issues/3458587 and sub-issues I'm actually trying to use it, of course this immediately runs into limitations.
The support we added in core supports detecting when a deprecated variable is used in a twig template, so that the template author can remove it.
However a lot of custom/contrib preprocess implementations check the value of one preprocess variable to then set the value of another, or overwrite preprocess variables etc. - we don't have any detection for that because it's just array keys.
Alex Pott suggested a phpstan-drupal issue to see if we can add detection. Because the support relies on values of $variables['deprecations'] which is also set in preprocess, it would be extremely difficult for php-stan drupal to dynamically determine this, but we wondered about hardcoding specific variable names like 'teaser' in a list then looking for $variables['teaser'] in any node preprocess hook and notifying if it's found. If we only look for $variables['teaser'] that would reduce false positives like $variables['view_mode'] === 'teaser'. This support would not be perfect, but we could detect the most disruptive changes which would be better than nothing.
https://www.drupal.org/project/drupal/issues/3458183 is the first issue to actually land from the latest round so there is something to try against.
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mglaman/phpstan-drupal
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mglaman/phpstan-drupal#1078 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
mglaman/phpstan-drupal#1079 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Report constraint plugins that break on Drupal 12 because they have no named-arguments constructorCó thể đã có người làm @goba đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
mglaman/phpstan-drupal#1075 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Magic properties: original on entities, name on UserSession and password on User are not reported as deprecatedCó thể đã có người làm @goba đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
mglaman/phpstan-drupal#1074 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
mglaman/phpstan-drupal#1051 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mglaman/phpstan-drupal
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
nikic/PHP-Parser#1187 ·
-
15.0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Icinga/icinga-notifications-web#645 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
OpenMage/magento-lts#5865 ·
Maintainer thường phản hồi trong vòng 3 ngày