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

After reading https://mglaman.dev/blog/better-static-analysis-entity-type-storages-phpstan-drupal-110 I got the inspiration for adding bundle entity support. See https://www.drupal.org/node/3191609. Would this be possible?

enhancement
help wanted

In larger projects it's possible that modules are already enabled and thus that a class exists. However, it's possible that when the module being worked on is installed in a...

The `get` method returns `object|false` and the object always has a `data` property. The cache object should have the following properties: * data * created * tags * valid *...

Well, this a PR that kinda solves our specific problem and it is related to: https://github.com/mglaman/drupal-check/pull/98 and https://www.drupal.org/project/drupal/issues/2943172 I understand this PR is probably not going to be merged as-is...

enhancement

I'm using `phpstan-drupal` with `phpstan-deprecation-modules`, and it doesn't appear to be flagging up usage of deprecated hooks. Specifically, I have an implementation of `hook_search_api_results_alter` in a custom module that is...

DrupalWTF

We cannot analyze `services.yml` provided by modules. PHPStan can only determine if a service uses a deprecated interface in its constructor or fetches deprecated services via a container injection method...

I have seen this issue quite a few times in custom code: `$url->getRouteName()` is called to check whether it's a certain entity route -- but if the url points to...

Running phpstan with phpstan-Drupal 1.0.3 I am receiving the error Drupal\sqlsrv\Driver\Database\sqlsrv\Connection::isTemporaryTable() should return bool but return statement is missing. As you can see, the function has a return annotation and...

Right now there are no errors if you call `entity.manager` from the service container in D9. That is because we do not error when there is a service miss. We...

enhancement

Even if we run Drupal Check on every change request, the following was missed when we did a Drupal 8.9 -> 9.2 update: ![image](https://user-images.githubusercontent.com/1755573/135082912-924cf897-9122-40ab-ad49-6be4983ea620.png) https://www.drupal.org/node/2572493 Possibly Tomas Votruba already solved...