Releases: shipmonk-rnd/phpstan-rules
Releases · shipmonk-rnd/phpstan-rules
2.10.0
New features
- forbidArithmeticOperationOnNonNumber: deny arithmetic operations like
$a + $b
over non numbers (#180) - forbidIncrementDecrementOnNonInteger: deny
$i++
,$i--
,++$i
,--$i
with any non-integer (#179) - Add error identifiers to all rules: usable in upcoming PHPStan 1.11 (#140)
2.9.2
2.9.1
2.9.0
New features
- enforceIteratorToArrayPreserveKeys: ensure
$preserve_keys
is explicitly set (mitigate data loss / failure risk) (#154) - forbidCheckedExceptionInCallable:
Fixes
- forbidEnumInFunctionArguments: fix false negative when swapped named arguments are used (#155)
- forbidCheckedExceptionInCallable: fix edge case when two equally-named methods are set up as immediately called in different classes (#156)
2.8.0
New features
- forbidFetchOnMixed & forbidMethodCallOnMixed:
- forbidFetchOnMixed: check even class const fetches (#150)
- forbidReturnValueInYieldingMethod: avoid misuse of inaccessible value returned in yielding methods (#152)
2.7.0
New features
- forbidCheckedExceptionInCallableRule: exception tracking elevated to next level (#137) !
- disallows throwing checked exceptions in Closures and First class callables as those just return callback which can be called any time (thus cannot be tracked by phpstan)
- allows configuration of functions/methods where some callable argument is immediatelly called, then any checked exception in such callable is property tracked!
- this is a must if you use something like
EntityManager::transactional
- this is a must if you use something like
Dependencies
phpstan/phpstan
now requires at least 1.10.30 (was 1.10.0, see #137)
2.6.3
2.6.2
2.6.1
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)