korbeil/phpstan-generic-rules
PHPStan extension that enforces and improves the use of PHP generics. Adds custom rules to catch missing or incorrect template types, invalid generic usages, and helps keep docblocks and type hints consistent for safer, more accurate static analysis.
var_dump, exit or die function callssymfony/var-dumper, you should not have dump or die function callsWe assume that PHPStan is already installed in your project.
To use this extension, require it in Composer:
composer require --dev korbeil/phpstan-generic-rules
If you also install phpstan/extension-installer then you're all set!
If you don't want to use phpstan/extension-installer, include phpstan-strict-rules.neon in your project's PHPStan config:
includes:
- vendor/korbeil/phpstan-generic-rules/extension.neon
You can configure this library with parameters:
parameters:
generic_rules:
never_empty_rule: true # To enable the never empty rule
debug_rule: false # To disable the debug rule
mb_string_rules: false # To disable the mb_string rule
How can I help you explore Laravel packages today?