phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Extension for PHPStan to allow analysis of Drupal code.

Results 161 phpstan-drupal issues
Sort by recently updated
recently updated
newest added

# Bug report On ^1.2 version, decorating a service using autowiring feature without explicit `class` for decorator, leads to an error: ``` [19-Dec-2023 10:55:19 UTC] PHP Warning: Undefined array key...

bug

# Feature request See: - https://www.drupal.org/project/drupal/issues/3162827 - https://www.drupal.org/project/drupal/issues/3197773

enhancement

# Feature request I had a custom class that extended Drupal\Core\Routing\RouteSubscriberBase. The old code had: ``` public static function getSubscribedEvents(): { ``` which was not compatible with D10 RouteSubscriberBase's ```...

enhancement

# Bug report When an `EntityQuery::accessCheck()` call is chained with other methods it is not detected. This is similar to #437 but possibly requires a different fix. ### Code snippet...

bug
entity query

# Bug report This is very similar to when \Drupal::entityQuery() is checked for accessCheck() ### Code snippet that reproduces the problem ```php $nodes = \Drupal::entityQueryAggregate('node')->execute(); ```

bug

# Feature request Consequence of https://github.com/mglaman/phpstan-drupal/pull/610/ This caused ContainerInterace::has to be "always true", which may lead developers to removing `if ($container->has()` checks, causing actual bugs. Especially around conditional dependencies. Slack...

enhancement

# Feature request GroupLegacyScope marks anything with `@group legacy` as deprecated. This should only work for test classes.

enhancement

# Feature request When developers work with Yaml the autocomplete from IDEs often suggests `Yaml::parse` which will give them the Symfony component and they may be unaware of the existence...

enhancement

# Bug report Fix the crash reported in #640 when loading `.api.php` files

bug

# Feature request Added as part of https://github.com/mglaman/phpstan-drupal/pull/641, there needs to be documentation for using it and what the options are.

enhancement