Releases: shipmonk-rnd/phpstan-rules
Releases · shipmonk-rnd/phpstan-rules
2.6.0
New features
- forbidCheckedExceptionInYieldingMethod: denies throwing checked exception within yielding methods are those gets thrown upon iteration, not within method call (#109)
- forbidProtectedEnumMethod: disallows protected methods on enums as those are not extendable anyway (#108)
2.5.1
2.5.0
2.4.1
2.4.0
New features
- enforceEnumMatchRule: new rule enforcing usage of
match ($enum)
instead of exhaustive elseifs for enums (#94)- it tries to improve "too smart" enum analysis of PHPStan 1.10+, see reasoning
- forbidAssignmentNotMatchingVarDoc: ability to allow narrowing by config
allowNarrowing: true
(#92)- see differences with new native PHPStan check in readme
- forbidUselessNullableReturn: support also functions and closures (#97, #99)
- enforceListReturn: support also functions (#96)
Fixes
- forbidUnusedException: fix false positive within match arm (#90)
Improvements
Dependencies
phpstan/phpstan
now requires at least 1.10.0 (was 1.9.1, see #84)
2.3.1
2.3.0
New features
- enforceListReturn: prefer
@return list<T>
over@return array<T>
where possible (#76) - forbidIdenticalClassComparison: deny
===
,!==
for configured objects (useful forDateTimeInterface
,Brick/Money
and similar)
Fixes
- forbidCustomFunctions: proper config validation (#83)
- forbidUnusedException: fix false positive within ternary or yield (#79)
- forbidUnusedMatch: fix false positive within ternary (#79)
- uselessPrivatePropertyNullabilityRule: fix false positive with non-typehinted properties (#78)
- uselessNullableReturn: fix false positive with
return;
(#82)
Dependencies:
phpstan/phpstan
now requires at least 1.9.1 (was 1.8.7, see #76)
2.2.0
New features
- installable by extension-installer, see official docs how to use it (#72)
2.1.1
2.1.0
New features:
- forbidCast: denies casting you configure - by default only
(object)
,(array)
and(unset)
- enforceNativeReturnTypehint: enforces usage of native return typehints if supported by your PHP version
- forbidPhpDocNullabilityMismatchWithNativeTypehint: denies invalid phpdocs without null when native type contains null
- forbidNullInInterpolatedString: disallows using nullable expressions within double-quoted strings like
"Hi $name!"
Fixes:
- forbidUnusedMatchResult: Do not report if all arms contain assignment.