Extension for PHPStan to allow analysis of Drupal code.
MIT License
Bot releases are visible (Hide)
Published by mglaman over 1 year ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.27...1.1.28
Published by mglaman over 1 year ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.26...1.1.27
Published by mglaman almost 2 years ago
PHPStan\Type\Constant\ConstantArrayType::findTypeAndMethodName()
call by @mxr576 in https://github.com/mglaman/phpstan-drupal/pull/485
EntityReferenceFieldItemListInterface::referencedEntities
to work with generic by @dpi in https://github.com/mglaman/phpstan-drupal/pull/478
EntityQueryWithoutAccessRule
rule message to use full Drupal message by @goba in https://github.com/mglaman/phpstan-drupal/pull/469
REQUEST_TIME
pushed to 11.0.0 removal by @mglaman in https://github.com/mglaman/phpstan-drupal/pull/491
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.25...1.1.26
Published by mglaman over 2 years ago
Quick patch release following up on the RequestStack forward compatibility shim work in https://github.com/mglaman/phpstan-drupal/pull/446. This reduces the noise by only reporting an error when using the method deprecated in Symfony 5 and removed in Symfony 6.
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.24...1.1.25
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.23...1.1.24
Published by mglaman over 2 years ago
Includes a hotfix for 1.1.22 to fix SymfonyCmfRoutingInClassMethodSignatureRule
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.22...1.1.23
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.21...1.1.22
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.20...1.1.21
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.19...1.1.20
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.18...1.1.19
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.17...1.1.18
Published by mglaman over 2 years ago
Fixes with #409 allow using PHPStan without the rich node parser.
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.16...1.1.17
Published by mglaman over 2 years ago
rules.neon
by @mglaman in https://github.com/mglaman/phpstan-drupal/pull/389
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.15...1.1.16
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.14...1.1.15
Published by mglaman over 2 years ago
rules
out of services
by @mglaman in https://github.com/mglaman/phpstan-drupal/pull/375
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.13...1.1.14
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.12...1.1.13
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.11...1.1.12
Published by mglaman over 2 years ago
Field types provided by Drupal core have been stubbed to provide @property
annotations. If you have a field value and it has been type hinted, PHPStan will not complain about accessing a non-existent property.
Example:
// EntityReferenceItem.
$entity_reference_field = $node->get('field_entity_reference')->first();
assert($entity_reference_field instanceof EntityReferenceItem);
assertType(EntityReferenceItem::class, $entity_reference_field);
assertType('int|string', $entity_reference_field->target_id);
assertType('Drupal\Core\Entity\EntityInterface', $entity_reference_field->entity);
Drupal 9.3.x and 9.4.x deprecated more global constants. The rule to check for these has been updated.
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.10...1.1.11
Published by mglaman over 2 years ago
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.9...1.1.10
Published by mglaman almost 3 years ago
This relaxes the constraints so that phpstan-drupal can be installed on the Drupal 10.0.x branch.
Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.8...1.1.9