Releases: shipmonk-rnd/phpstan-rules
Releases · shipmonk-rnd/phpstan-rules
2.0.1
2.0.0
Major changes 🎉
- Much easier setup. Just include
vendor/shipmonk/phpstan-rules/rules.neon
in your codebase; no need to register all rules, visitors and tags as before (#44)- Also, you can easily enable/disable rules one by one like this:
includes:
- vendor/shipmonk/phpstan-rules/rules.neon
parameters:
shipmonkRules:
allowNamedArgumentOnlyInAttributes:
enabled: false
New features
- New rule
ForbidNullInAssignOperationsRule
: checking no null is involved in+=, *=
etc - Improved
ForbidAssignmentNotMatchingVarDocRule
: added option to allow type narrowing for individual var docs by/** @var Type allow-narrowing */
, thx @MartinMystikJonas (#45)
Improvements
ForbidFetchOnMixedRule
andForbidMethodCallOnMixedRule
does not make sense on level9, so it gets autodisabled in that case (#38)
Error message changes
ForbidAssignmentNotMatchingVarDocRule
now reports type narrowing with different message (#45)
1.2.0
New features
- New rule
EnforceReadonlyPublicPropertyRule
for protecting all your public properties by requiring readonly modifier - New rule
ForbidAssignmentNotMatchingVarDocRule
that verifies if the assignment to the variable with inline phpdoc matches the type - New rule
ForbidUnusedMatchResultRule
detecting forgotten usage of match result - New rule
ForbidNullInBinaryOperationsRule
to ensure no null value is involved in binary operations - New rule
ForbidVariableTypeOverwritingRule
denying type change when overwriting variables
1.1.1
1.1.0
New features:
RequirePreviousExceptionPassRule
can be checking more cases whenreportEvenIfExceptionIsNotAcceptableByRethrownOne
option is used- New rule
AllowComparingOnlyComparableTypesRule
for strict usage of <,>,<=,>=,<=> - New rule
BackedEnumGenericsRule
allowing to hack generics intoBackedEnum
in PHP 8.1 - New rule
ForbidEnumInFunctionArgumentsRule
checking dangerous usage of enums in array functions likearray_diff
,sort
,implode
and much more - New rule
ForbidCustomFunctionsRule
allowing you to deny method calls as you need, e.g.: uselessReflectionProperty::setAccessible
on PHP 8.1
Dependencies
phpstan/phpstan
now requires at least 1.8.1 (was 1.5.6, see #15)