Custom rules for phpstan
This package is auto-updated.
Last update: 2022-11-26 18:42:14 UTC
Collection of custom PHPStan rules.
⚠️ This is just a Proof of Concept
composer require --dev brumann/phpstan-rules
To enable all rules with their default configuration you can just include the provided
rules.neon file in your
phpstan.neon like this:
includes: - vendor/brumann/phpstan-rules/rules.neon
If you want to enable only selective rules you can also manually configure the rules in your
is described in the docs: https://github.com/phpstan/phpstan#custom-rules
This Rule ensures that when a constructor argument is an object, type hints are for an appropriate interface, instead of a concrete implementation. Optionally you can provide a list of Interfaces to be ignored.