$defaultTheme being set via a Trait is not discovered.
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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);
- Lenguaje dominante
- PHP
- Estrellas
- 208
- Forks
- 88
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 15
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mglaman/phpstan-drupal
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
mglaman/phpstan-drupal#1078 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
mglaman/phpstan-drupal#1079 ·
Los mantenedores suelen responder en 1 día
-
Report constraint plugins that break on Drupal 12 because they have no named-arguments constructorPosiblemente ocupada @goba la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
mglaman/phpstan-drupal#1075 ·
Los mantenedores suelen responder en 1 día
-
Magic properties: original on entities, name on UserSession and password on User are not reported as deprecatedPosiblemente ocupada @goba la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
mglaman/phpstan-drupal#1074 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
mglaman/phpstan-drupal#1051 ·
Los mantenedores suelen responder en 1 día
Todos los issues de mglaman/phpstan-drupal
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
nikic/PHP-Parser#1187 ·
-
15.0
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Icinga/icinga-notifications-web#645 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
OpenMage/magento-lts#5865 ·
Los mantenedores suelen responder en 3 días