Skip to content

2.2.10

Latest

Choose a tag to compare

@phpstan-bot phpstan-bot released this 30 Aug 12:47
Immutable release. Only release title and notes can be modified.
36d1509

This release brings improved performance and reduced memory consumption, mainly thanks to:

  • Forking parallel workers where available:
    • Instead of spawning processes with proc_open(), they are forked with pcntl_fork(), saving time to bootstrap PHPStan
    • This requires PHPStan Turbo extension (already present if you install PHPStan with Composer) and non-Windows OS
  • Deduped objects held in memory by BetterReflection
  • Turbo extension-accelerated directories symbols scanning which allowed us to remove caching of this data and locking in worker processes

Feel free to comment how PHPStan 2.2.9 vs. 2.2.10 perform on your project! 🚀

Bleeding edge 🔪

  • Check written case of single-part class names imported with use statements (#6271), #12827, thanks @janedbal!

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 🔧

  • Notify in CI when a full analysis ran without a pre-existing result cache for more than 60 seconds (#5954), #14881, thanks @staabm!
  • Emit node callbacks after the node's results are stored and drop FNSR introduced in 2.1.34 (#6248)
  • Report peak memory per process instead of a summed total (#6297)

Bugfixes 🐛

  • Return the operand from union() for equal array operands, not just identical ones (#6257), thanks @AJenbo!
  • Preserve surviving offsets when popping or shifting a list (#6274)
  • Account for deduplicated trait errors per using-class context (#6280), #14932
  • Revert "Consult bootstrap-registered custom autoloaders only after the static source locators (#6069)" (#6292), #15102
  • Run StubFilesExtensions only after bootstrapFiles have been executed (#6284), #15120

Performance 🏎️

  • Use LruCache for the other three least-recently-used caches (#6240), thanks @SanderMuller!
  • Replay the recorded fixpoint pass instead of repeating the final loop walk (#6249)
  • Fork parallel workers (instead of spawning) whenever the turbo extension is active (#6260)
  • Intern TypeCombinator results in turbo (#6261), thanks @AJenbo!
  • Bound ObjectType's static caches with a shared LRU over description keys (#6289), #15119
  • Update BetterReflection
  • Scan directories natively, and drop the cache and lock behind it (#6304)

Function signature fixes 🤖

  • Clean out redundant stub overwrites (#6243), thanks @AJenbo!
  • Make SensitiveParameterValue generic (#6272), thanks @JanTvrdik!
  • Fix simplexml_import_dom() parameter type on PHP 8.4 (#6290), thanks @janedbal!

Internals 🔍

  • Fix incorrect casing (#6244), thanks @AJenbo!
  • Introduce StmtHandler (#6247)
  • Feed engine gatherers from NodeScopeResolver frames instead of wrapping node callbacks (#6258)
  • Replay scope-deriving mutators in NodeCallbackScope answers (#6259)
  • Ignore the turbo version constant in the typos check (#6270), thanks @SanderMuller!
  • Migrate a deprecated isSubclassOf call (#6268), thanks @AJenbo!
  • Guard against null in getNameScope (#6267), thanks @AJenbo!
  • Remove unused variables (#6266), thanks @AJenbo!
  • CS for build/PHPStan/ (phpstan/phpstan-src@bbd64b4)
  • Run bootstrapFiles per forked worker instead of inheriting the parent's (#6264)
  • phar.yml - get quicker to commit step (phpstan/phpstan-src@ccbde4b)
  • Price enum case values through InitializerExprTypeResolver in EnumSanityRule (#6275)
  • Extract function-call scope effects into FuncCallScopeEffectsHelper (#6279)
  • Cover the facade-alias shape with an e2e project (#6265), thanks @SanderMuller!
  • Use early exit when collecting the registered class loaders (#6282), thanks @SanderMuller!
  • Cover the loader shapes the reverted autoloader attempts broke (#6293), thanks @SanderMuller!