Skip to content

2.1.34

Choose a tag to compare

@phpstan-bot phpstan-bot released this 19 Jan 19:53
· 466 commits to 2.1.x since this release
070ba75

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 gets mixed, because $scope sees 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]) sees 1 as the type, not mixed.
    • Solves 10 reported issues: #12234, #11982, #11386, #11079, #10612, #9652, #8936, #12663, #12735, #13353

Improvements πŸ”§

Bugfixes πŸ›

Performance 🏎️

Function signature fixes πŸ€–

Internals πŸ”

  • Remove unused baseline-7.3.neon file (#4622), thanks @staabm!
  • Update PHPStan packages (#4621, #4625), thanks @staabm!
  • Tests: Use Stubs instead of Mocks (#4626), thanks @staabm!
  • Allow PHPUnit 12 (#4624), thanks @staabm!
  • Fix mutation testing (#4631), thanks @staabm!
  • Prevent double normalization of FuncCall nodes (#4637), thanks @staabm!
  • Simplify MutatingScope->compareVariableTypeHolders() (#4641), thanks @staabm!
  • Ignore by identifier instead of plain error (#4652), thanks @staabm!
  • ResultCacheManager - do not invalidate cache when switching Blackfire extension on/off (phpstan/phpstan-src@97c30ca)
  • Simplify NodeScopeResolver->processImmediatelyCalledCallable() (#4698), thanks @staabm!
  • Fix PHPStorm inspection errors (#4700), thanks @staabm!
  • More precise Type->getCallableParametersAcceptors() return type (#4713) (#4713), thanks @staabm!
  • Added native return types (#4732), thanks @staabm!
  • Simplify PhpClassReflectionExtension (#4741), thanks @staabm!
  • Fix typo in test data (#4743), thanks @takaram!
  • EnumCaseObjectType enumCaseName is readonly (#4745), thanks @staabm!
  • Simplify ContainerDynamicReturnTypeExtension (#4755), thanks @staabm!
  • Split MutatingScope->resolveType() into smaller methods (#4759) (#4759), thanks @staabm!
  • Split MutatingScope->resolveType() into smaller methods - part 2 (#4760) (#4760), thanks @staabm!
  • MemoizingReflector: more precise types (#4762), thanks @staabm!
  • Simplify TypeCombinator->processArrayTypes() (#4769) (#4769), thanks @staabm!
  • Drop MutatingScope->rememberConstructorScope() (#4768), thanks @staabm!
  • IntersectionType: Extract describeType() method (#4776), thanks @staabm!
  • More precise types (#4772), thanks @staabm!