Thanks to visit codestin.com
Credit goes to github.com

Skip to content

2.1.55

Latest

Choose a tag to compare

@phpstan-bot phpstan-bot released this 18 May 11:59
· 810 commits to 2.2.x since this release
9eaac38

This release fixes 55 issues! πŸŽ‰

Bleeding edge πŸ”ͺ

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 πŸ”§

Bugfixes πŸ›

Performance 🏎️

  • Lazily initialize AggregateSourceLocator to speedup bootstrapping (#5577), thanks @staabm!
  • PhpFileCleaner: Use strcspn instead of regex for fast-skip in clean() (#5600), thanks @staabm!
  • Cap cumulative unroll factor when nesting unrolled constant-array foreach (#5614), #14590
  • DateFunctionReturnTypeHelper: prevent unnecessary TypeCombinator::union() (#5629), thanks @staabm!
  • Memoize ArrayType::isList() (#5680), thanks @staabm!

Function signature fixes πŸ€–

Internals πŸ”

  • Add bench for PhpDocInheritanceResolver speedup from #4829 (phpstan/phpstan-src@d34f7cc)
  • Added regression test (#5585), #9004, thanks @staabm!
  • Remove dead code from FileExcluder (#5598), thanks @staabm!
  • Compiler - update Box + dependencies (#5601)
  • Simplify compiler/box/composer.json (phpstan/phpstan-src@37e8fe0)
  • Extract Type::makeListMaybe() for sort functions that drop list-ness (#5611)
  • Extract Type::mapValueType(callable) for "same keys, transformed values" (#5611)
  • Extract Type::changeKeyCaseArray(?int) for array_change_key_case (#5611)
  • Extract Type::filterArrayRemovingFalsey() for array_filter no-callback path (#5611)
  • Extract Type::mapKeyType(callable) and use it alongside mapValueType in NodeScopeResolver (#5611)
  • Add Type::makeAllArrayKeysOptional() for preg_replace* array fast path (#5611)
  • Extract Type::toBitwiseNotType() for ~$x (#5612)
  • Extract Type::toGetClassResultType() for get_class($x) (#5612)
  • Extract Type::toClassConstantType() for $x::class (#5612)
  • Extract Type::toObjectTypeForInstanceofCheck() for instanceof RHS (#5612)
  • Extract Type::toObjectTypeForIsACheck() for is_a($x, $class, $allowString) (#5612)
  • Inline one-line wrappers around polymorphic Type methods (#5613)
  • Test result-cache restore does not trigger reflection (#5617), thanks @staabm!
  • Test result-cache restore does not trigger reflection in all 1st party extensions (#5618), thanks @staabm!
  • Remove dead code in StrContainingTypeSpecifyingExtension (#5626), thanks @staabm!
  • Merge NSRT and rule test fixtures for bug-14582 into a single file (#5604), #14582, thanks @VincentLanglet!
  • Introduce MutatingScope::getCallableParameterType (#5635), thanks @VincentLanglet!
  • Introduce MaybeStringTypeTrait (#5642), thanks @VincentLanglet!
  • Added regression test (#5652), #14569, thanks @staabm!
  • IntersectionType::toPhpDocNode - check empty types (phpstan/phpstan-src@bfa881c)
  • Introduce Process interface and ProcessBase for parallel workers (#5663)
  • Extract WorkerRunner from WorkerCommand (#5663)
  • Add pcntl_fork() parallel worker path (#5663)
  • Introduce ProcessPromise interface for the PHPStan Pro worker (#5663)
  • Extract FixerWorkerRunner from FixerWorkerCommand (#5663)
  • Add pcntl_fork() PHPStan Pro worker path (#5663)
  • Print parallel worker mechanism via DiagnoseExtension (#5663)
  • Experiment: fork parallel workers via pcntl_fork() (phpstan/phpstan-src#5663)
    • Mostly broken because of PHAR file pointer shared between process forks
    • Opt-in behaviour with env var PHPSTAN_PARALLEL_FORK=1
    • Looking for an idea for a fix from the community
  • Add regression test for circular class constant PHPDoc type references (#5685), #9172, thanks @VincentLanglet and @staabm!