$defaultTheme being set via a Trait is not discovered.
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
- 35/100
Hướng nghiên cứu
Start by reading the trait example in the issue and the phpstan-drupal rule that checks tests for $defaultTheme; the issue does not name the rule's file or a test. Trace how the analysis discovers that property when it is assigned at runtime through a trait. Done means the rule recognizes this assignment, with a regression test demonstrating the case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug report
First, let me say that I think this is an edge case, so I really don't know if there's value in trying to solve this... would be totally OK if this gets closed as "wontfix".
In my particular issue, when Drupal announced that $defaultTheme must be set for all tests, in my project we started setting this via a trait, but the trait sets the property at runtime. Given this is a very unique use case, I would be happy to just ignore this rule, so I opened #772 which would help me ignore it.
I'm not totally sure if this is a useful bug report for other reasons.. just to consider that the property may be set outside the test itself...?
Code snippet that reproduces the problem
Here is how I set $defaultTheme via trait...
trait ThemeTestTrait {
/**
* {@inheritdoc}
*
* Set all custom tests to use stark by default.
*
* This was introduced in Drupal core v9 where all tests switched from the
* classy theme to an undefined theme.
*
* @see https://www.drupal.org/node/3083055
*/
protected function installDefaultThemeFromClassProperty(ContainerInterface $container): void {
if (!isset($this->defaultTheme)) {
$this->defaultTheme = 'stark';
}
parent::installDefaultThemeFromClassProperty($container);
- 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