Extensions for PHPStan
To use this extension, require it in Composer:
composer require --dev slam/phpstan-extensions
And include slam-rules.neon in your project's PHPStan config:
includes:
- vendor/slam/phpstan-extensions/conf/slam-rules.neon
SlamPhpStan\UnusedVariableRule
: check for variable inside functions never used after initial assignmentSlamPhpStan\StringToClassRule
: requires strings that refer to classes to be expressed with::class
notationSlamPhpStan\GotoRule
: no goto allowedSlamPhpStan\ClassNotationRule
:- Interfaces must end with "Interface"
- Traits must end with "Trait"
- Abstract classes must start with "Abstract"
- Exceptions must end with "Exception"
SlamPhpStan\PhpUnitFqcnAnnotationRule
: classes found in following PHPUnit annotations must exist:@expectedException
@covers
@coversDefaultClass
@uses