Improvements 🔧
- Precise try-catch-finally analysis (#481), thanks @rainbow-alex for the kick-off of this feature!
- Dependent types - understand truthy BooleanOr and falsey BooleanAnd scope (phpstan/phpstan-src@2c42ef1), #4733, #4326, #987, #4215, #4695
- Dependent types - save conditional expression after variable assignment (phpstan/phpstan-src@56ae015), #2977, #3190
Bleeding edge 🔪
- Consistent remembering and forgetting returned values (phpstan/phpstan-src@d4edc59)
- Report dead catch with exception that is not thrown in the try block - level 4 (phpstan/phpstan-src@ce9299c)
- Rule for detecting overwriting exit points in finally - level 4 (phpstan/phpstan-src@3f712be)
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon
:
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
- Fixed detecting method signature compatibility (phpstan/phpstan-src@8f0150d), #4729
- Fixed inferring template types from ThisType (phpstan/phpstan-src@a843d87), #4725
- More robust PHPDoc parsing (phpstan/phpstan-src@5d37113), #4731
- Support the
$foo ?? false
pattern when making sure variable exists (phpstan/phpstan-src@c4cc668), #560 mt_rand
andrand
are not pure (phpstan/phpstan-src@edc8446)random_int
andrandom_bytes
are not deterministic (phpstan/phpstan-src@f36fa71), #4190- Invalidate
is_file()
calls and similar only afterclearstatcache()
(phpstan/phpstan-src@bcc8d61) - Invalidate object state after passing to impure function (phpstan/phpstan-src@f92b95e), #3203
- BaselineNeonErrorFormatter: Sort output by file and pattern (#483), thanks @dktapps!
- Match expression - do not complain about void in arm body (phpstan/phpstan-src@90e49f7, phpstan/phpstan-src@2c0dda3), #4292
- Fix merging scopes with narrowed constant types (phpstan/phpstan-src@42d0b36), #4434
- Allow phpVersion up to 80099 (phpstan/phpstan-src@4db2e14), #4762
- Fix Access to an undefined static property in
Closure::bind
(#489), thanks @VincentLanglet! - Add
array_sum()
dynamic return type extension (#490), thanks @VincentLanglet! - Fix
NativeMethodReflection::hasSideEffects()
(phpstan/phpstan-src@98fb540), #4231, #4287 - TypeSpecifier - support IntegerRangeType with
count()
(phpstan/phpstan-src@7b417c7), #4700 - Improved performance (phpstan/phpstan-src@dbe08a6, phpstan/phpstan-src@626f72a, phpstan/phpstan-src@1463c57, phpstan/phpstan-src@91f477f), #4723
- Fix problem with generics and inheritance, #4008, #3546
- Fix native static return typehint when entering class method (phpstan/phpstan-src@baa371e), #4795
Function signature fixes 🤖
- Fix function-map for PDOStatement pass-by-reference functions (#480), thanks @jaylinski!
- Add uopz 6.x functions (#482), thanks @zonuexe!