2.0.3
This release includes improvements and fixes from PHPStan 1.12.12.
Bleeding edge 🔪
- Check that values passed to array_sum/product are castable to number (level 5) (#3658), #11883, thanks @schlndh!
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
Improvements 🔧
- Update BetterReflection with Roave/BetterReflection#1462, thanks @kukulich!
- Sanity checks around hooked properties in interfaces and classes (#3656), thanks @jakubtobiasz!
- Full support for PHP 8.4 is coming soon in PHPStan 2.1
Bugfixes 🐛
- Fix subtracting enums inside
in_array(#3646), #12083, thanks @janedbal! - Last value was not recognized when passing an associative array as an argument (#3668), #11815, thanks @sayuprc!
- Update PhpStorm stubs (#3683), #12132
Function signature fixes 🤖
- 3rd parameter of htmlentities and htmlspecialchars allows null (#3644), thanks @sreichel!
- Update curl_setopt string values and allow nullable (#3634), thanks @xPaw!* bccomp: more precise return type (#3647), thanks @claudepache!
Internals 🔍
- FunctionCallParametersCheck: Add native parameter type (#3641), thanks @staabm!
- Refactor TryRemove/Accepts for DateTime|DateTimeImmutable and Exception|Error (#3654), thanks @VincentLanglet!
- Implement
Scope::getPhpVersion()(#3642), thanks @staabm! - Non-capturing catch support detection is scope PHP-version dependent (#3663), #12114, thanks @staabm!
- Remove shortArraySyntax definition in
Printer::__construct()(#3680), thanks @samsonasik!