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

https://www.drupal.org/node/3194517 Captured this in Behat tests: ``` Not marking service definitions as public is deprecated in drupal:9.2.0 and is required in drupal:10.0.0. Call $definition->setPublic(TRUE) before calling ::setDefinition(). See https://www.drupal.org/node/3194517: 4x...

enhancement

Similar to #395, make sure shim class is used for forward compatibility.

Fixes https://github.com/mglaman/phpstan-drupal/issues/397

Given \Drupal\Tests\migrate_tools\Functional\MigrateExecutionFormTest ``` private QueryInterface $vocabularyQuery; $this->vocabularyQuery = $this->container->get('entity_type.manager') ->getStorage('taxonomy_term') ->getQuery() ->accessCheck(TRUE); $real_count = $this->vocabularyQuery->count()->execute(); ```

``` /** * Asserts that a select field has a selected option. * * @param string $id * ID of select field to assert. * @param string $option * Option...

Not complete. Also needs a `drupal-service-name` PHPStan type

We can provide custom PHPStan PHPDoc types. This could help us replace the dynamic return type extension DrupalServiceDynamicReturnTypeExtension. This can allow us to validate known service names as arguments. ```...

Don't know if this is something for this project but it seems like it might be able to help. When using DrushStyle with recent versions of Drush 11 you'll run...

bug
Drush

* clone Drupal core * run `composer require` to bump phpstan and phpstan-drupal * run `composer install` * run `cd core && ../vendor/bin/phpstan`