2.1.34
Major new features ๐
- Optimized performance ๐๏ธ
- Caching of reflection objects and resolved PHPDocs
- Many raw performance optimization tweaks in analyser code (thanks @staabm!)
- Projects typically see 25 % to 40 % faster analysis times. Please test this release and report back, we're looking forward to your numbers as well!
- Utilization of Fibers for more precise analysis (PHP 8.1+)
- Code like
doFoo($a = 1, $a)will see better type inference for 2nd call argument. - When a rule hooked onto MethodCall AST node asks for
$scope->getType($node->args[1]), without Fibers it getsmixed, because$scopesees the state before the method call. - Fibers allow PHPStan to "pause" the execution of the rule until the precise type of
$node->args[1]is available in the analyser. - When the 2nd argument is processed, the execution of the rule is resumed and
$scope->getType($node->args[1])sees1as the type, notmixed. - Solves 10 reported issues: https://github.com/phpstan/phpstan/issues/12234, https://github.com/phpstan/phpstan/issues/11982, https://github.com/phpstan/phpstan/issues/11386, https://github.com/phpstan/phpstan/issues/11079, https://github.com/phpstan/phpstan/issues/10612, https://github.com/phpstan/phpstan/issues/9652, https://github.com/phpstan/phpstan/issues/8936, https://github.com/phpstan/phpstan/issues/12663, https://github.com/phpstan/phpstan/issues/12735, https://github.com/phpstan/phpstan/issues/13353
- Code like