chore(deps): update dependency phpstan/phpstan to v2 #31

Open
renovate-bot wants to merge 1 commit from renovate/major-phpstan-packages into main
Collaborator

This PR contains the following updates:

Package Type Update Change
phpstan/phpstan require-dev major ^0.12.29 -> ^2.0.0

Release Notes

phpstan/phpstan (phpstan/phpstan)

v2.1.18

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v2.1.17

Compare Source

Major new features 🚀

Bleeding edge 🔪

  • Report new static() in static method of abstract class - level 0 (a5f7c060c8)

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 🐛

  • Fix array_column() with explicit null $index_key (#​3970), #​12945, thanks @​herndlm!
  • AlwaysRememberedExpr - use getNativeExprType (222676e94a)
  • Invalidate result cache properly when property hook changes (dff492e14c, 268d7c6388)
  • Result cache - react to property having abstract/final/asymmetric visibility changed (0ad2a6a6f2)
  • Result cache - react to property being virtual changing (e33a560c71)

Function signature fixes 🤖

Internals 🔍

v2.1.16

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v2.1.15

Compare Source

Improvements 🔧

  • This release includes improvements and bugfixes from PHPStan 1.12.26
  • TableErrorFormatter: improve formatting of error tips (#​3821), thanks @​FeBe95!
  • InstantiationRule - call RestrictedMethodUsageExtension for constructor (8edfa9fa88)
  • Call RestrictedMethodUsageExtension for __toString methods in (string) cast (ce257d9acf)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Replace error-prone instanceof *Type in Rules classes (#​3858), thanks @​zonuexe!
  • Extract ArrayColumnHelper from ArrayColumnFunctionReturnTypeExtension (#​3785), thanks @​staabm!

v2.1.14

Compare Source

Bugfixes 🐛

Internals 🔍

v2.1.13

Compare Source

Major new features 🚀

Bleeding edge 🔪

  • Report @internal symbols usage from outside their top namespace, #​1178

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 🐛

Internals 🔍

  • MutatingScope: remove unnecessary callback functions (#​3916), thanks @​staabm!
  • Fix occasional failure in ParallelAnalyserIntegrationTest (4f5a63a5f5)
  • MethodReflection - fix isInternal vs. isBuiltin (3024c02e84)
  • Simplify degradation to general array in ConstantArrayType::shuffle() (#​3948), thanks @​herndlm!
  • ExtendedPropertyReflection::getName() (ff198c9d12)
  • Micro optimize LazyInternalScopeFactory (#​3962), thanks @​staabm!

v2.1.12

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v2.1.11

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v2.1.10

Compare Source

Bugfixes 🐛

v2.1.9

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

  • RuleTestCase: set shouldPolluteScopeWithLoopInitialAssignments to true which is PHPStan's default behaviour (1b56b0c1e0)
  • ResultCache: allow customization of params not invalidating cache (#​3877), thanks @​janedbal!
  • RegexArrayShapeMatcher - turn more details immutable (#​3892), thanks @​staabm!

v2.1.8

Compare Source

Improvements 🔧

  • @readonly property cannot be passed by-ref (#​3850), #​12676, thanks @​staabm!
  • ClassReflection - cannot be a subclass of final-overriden class (ed4ea0a3b5)
  • Deprecated ClassReflection::isSubclassOf(string $className) in favour of ClassReflection::isSubclassOfClass(ClassReflection $class)
    • If you just have string $className instead of ClassReflection and you are too lazy to get ClassReflection via ReflectionProvider, you can still use ClassReflection::is(string $className)

Bugfixes 🐛

Internals 🔍

v2.1.7

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • StrlenFunctionReturnTypeExtension: Cleanup instanceof ConstantString (#​3780), thanks @​staabm!
  • Adjust and make space for tests for new behaviour of new (#​3852)

v2.1.6

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

  • Test for set-hooked property being overriden by readonly property (d3909c7fbf)

v2.1.5

Compare Source

Improvements 🔧

Bugfixes 🐛

v2.1.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v2.1.3

Compare Source

If you're using larastan/larastan PHPStan extension, please update to version 3.0.4 alongside PHPStan 2.1.3 for improved compatibility with the new generic static<...> type. Thank you.

This release includes fixes and improvements from PHPStan 1.12.17. Most impportantly it introduces GenericStaticType - support for static<...> (#​1289), #​12485, #​11398, #​10417, #​9807, #​9449, #​8623, #​5512

Improvements 🔧

Bugfixes 🐛

  • Do not check abstract properties as uninitialized (1cc534759f), #​12466
  • Properties might be covariant or contravariant, depending on the allowed operations on the parent (50f8e49121), #​12466
  • Enable usage of ReflectionClass::isSubclassOf() with invariant @template T (4f2af3bcdf), #​12473
  • Fix crash on unknown trait use: array_combine() args must have the same number of elements (36f3291bd5), #​12327

Function signature fixes 🤖

Internals 🔍

v2.1.2

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Pass ExtendedMethodReflection into AlwaysUsedMethodExtension (5d35811a87)
  • Remove private method ConstantArrayType::findTypeAndMethodNames() used only once (30b9cd86c5)

v2.1.1

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

  • Update PHP-Parser and BetterReflection (#​3767)
    • Simplify code thanks to PHP-Parser update
    • Simplify code thanks to BetterReflection update
    • PropertyHookReturnStatementsNode is invoked for short body hooks
    • ShortGetPropertyHookReturnTypeRule is no longer needed
    • PropertyHookNameVisitor is no longer needed, PHP-parser comes with propertyName attribute

v2.1.0

Compare Source

Read all about this release on PHPStan's blog!

Major new features 🚀

  • Support for PHP 8.4's property hooks (RFC)
  • Support for PHP 8.4's asymmetric visibility (RFC)
  • Support for PHP 8.4's #[Deprecated] attribute (RFC)

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 🐛

Internals 🔍

  • Attributes rules use In*Node virtual nodes for more precise Scope 90e48fa876)
  • Remove duplicated PHPDoc from InternalScopeFactory classes (#​3761), thanks @​herndlm!
  • Scope: use Scope::getConstant instead (#​3666), thanks @​staabm!

v2.0.4

Compare Source

This release includes improvements and fixes from PHPStan 1.12.13.

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Workaround for bug in slevomat/coding-standard TypeNameMatchesFileName (7b4c9afd09)
  • Remove incorrect doc leftover from 1.x (#​3732), thanks @​AJenbo!

v2.0.3

Compare Source

This release includes improvements and fixes from PHPStan 1.12.12.

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 🐛

Function signature fixes 🤖

Internals 🔍

v2.0.2

Compare Source

Improvements 🔧

Internals 🔍

v2.0.1

Compare Source

Bugfixes 🐛

v2.0.0

Compare Source

PHPStan 2.0

Read more about PHPStan 2.0.

Check out the UPGRADING guide!.

Buy the PHPStan elephpant and T-shirts!

Design 2

Major new features 🚀

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Tool to make optional parameters required across the codebase (7e366e08f9)
  • A few more MutatingScope method parameters made required (2c4c0cde75)
  • CommandHelper::begin() parameters made required (f17cf9ec43)
  • MethodTag - constructor parameter $templateTags is required (5b58f83e6d)
  • InitializerExprTypeResolver - constructor parameter $usePathConstantsAsConstantString made required (f88d9ba7f5)
  • PhpMethodReflectionFactory::create() - all parameters are required (8bfbf8f254)
  • FunctionCallParametersCheck - parameters $nodeType and $acceptsNamedArguments made required (493752737c)
  • MethodParameterComparisonHelper - parameter $ignorable of compare() method made required (f85a500288)
  • Parameter $dateTimeClass of DateTimeModifyReturnTypeExtension constructor made required (a8cd423e84)
  • NativeFunctionReflection construct parameters made required (64ff598cd4)
  • Cover AccessoryArrayListType constructor with BC promise (51de9032c6)
  • Add PhpVersion parameter to various Type methods (#​3478), thanks @​VincentLanglet!
  • Move ContainerDynamicReturnTypeExtension to build/PHPStan (5651bec661)
  • Renamed NewOptimizedDirectorySourceLocator to OptimizedDirectorySourceLocator (db02a30ca1)
  • Remove unneded abstraction (f302c90692)
  • Introduce native return types thanks to PHP 7.4 return type covariance (392f090066)
  • ReadWritePropertiesExtension - use ExtendedPropertyReflection in parameter type (f0a629685d)
  • Declare more precise getClass() return types in extension interfaces (#​1754), thanks @​staabm!
  • (38cb5a315e)
  • HasOffsetType - put constructor parameter type natively (b5accb3f6b)
  • Printer is covered by BC promise (b0858332ef)
  • More interfaces that are not supposed to be implemented in userland (778af2ed74, cb6ab5544a)
  • Refactored FunctionCallParametersCheck::check() parameters (710e09c416)
  • Spread list usages in Reflection, Scope, Type (#​3530), thanks @​janedbal!
  • Remove $isFinal dead-code in PhpFunctionReflection (#​3545), thanks @​staabm!
  • Get rid of unnecessary instanceof self in ConstantArrayType (#​3552), thanks @​herndlm!
  • test: use bashunit -a exit_code to check for errors (#​3533), thanks @​Chemaclass!
  • Upgrade bashunit:0.18.0 for e2e tests (#​3614), thanks @​Chemaclass!
  • Remove dead code (#​3575), thanks @​staabm!
  • Remove dead code in ConstantConditionRuleHelper (#​3597), thanks @​staabm!

v1.12.28

Compare Source

Improvements 🔧

  • More precise elapsed time if it's a low number (7644bd0160)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.27

Compare Source

Major new features 🚀

Improvements 🔧

  • Result cache traits optimization - analyse only files using trait when trait implementation changes (bd6fc4e266)
  • InitializerExprTypeResolver - optimize arithmetical and bitwise operations for large types (275d3b5a85, 572e0e8f26)
  • Limit how big int-mask type can be (80b40f2177)

Bugfixes 🐛

v1.12.26

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.12.25

Compare Source

Consider comparison as strict when type is the same (#​3942), #​12884, thanks @​VincentLanglet!

v1.12.24

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.12.23

Compare Source

Fix condition of fall-through case not used for exhaustive checks (#​3900), #​11064, #​3488, #​8719, #​12722, thanks @​rvanvelzen!

v1.12.22

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.12.21

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.12.20

Compare Source

Bugfixes 🐛

Internals 🔍

v1.12.19

Compare Source

Improvements 🔧

Function signature fixes 🤖

v1.12.18

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.12.17

Compare Source

If you're using larastan/larastan PHPStan extension, please update to version 2.9.14 alongside PHPStan 1.12.17 for improved compatibility with the new generic static<...> type. Thank you.

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.12.16

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.15

Compare Source

Bugfixes 🐛

Internals 🔍

v1.12.14

Compare Source

Fix preg_match() group containing start/end meta characters (#​3740), #​12297, thanks @​staabm!

v1.12.13

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.12

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.12.11

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.12.10

Compare Source

Bugfixes 🐛

v1.12.9

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.12.8

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.7

Compare Source

Major new features 🚀

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.6

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.5

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • More specific return type for methods used to analyse currently entered function or method (0e2587fae6)
  • PhpFunctionFromParserNodeReflection becomes ParametersAcceptorWithPhpDocs (1bea5c79d5)
  • Use methods directly on PhpFunctionFromParserNodeReflection instead of selectSingle() when analysing function body in rules (41916ba39d)
  • Use methods directly on PhpFunctionFromParserNodeReflection instead of selectSingle() in MutatingScope (865c618f82)
  • Use ParametersAcceptorSelector::selectFromArgs() instead of selectSingle() wherever possible (e283d3a6df)
  • Use PhpFunctionFromParserNodeReflection as ParametersAcceptor in DependencyResolver (7e216a274f)
  • Use methods directly on PhpFunctionFromParserNodeReflection instead of selectSingle() in ParametersAcceptorSelector (1322aaf1d0)
  • Introduce @internal getOnlyVariant() method on FunctionReflection/ExtendedMethodReflection to use instead of selectSingle() (714877be8c)
  • Add Type::chunkArray() (#​3408), thanks @​herndlm!
  • Add more mixed-type bool subtraction tests (#​3421), thanks @​staabm!
  • Made IssetExpr part of BC promise (5677025877)
  • Refactor RegexGroupParser for more immutability and less pass-by-ref (#​3479), thanks @​staabm!

v1.12.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

  • Fix SplObjectStorage generic stub for PHP 8.4 (9d9fb56090)

Internals 🔍

v1.12.3

Compare Source

Improvements 🔧

  • PHPStan Pro: debug corrupted PHAR signature message (9815bbba45)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.2

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.12.1

Compare Source

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 🐛

Internals 🔍

v1.12.0

Compare Source

Read all about PHPStan 1.12 on phpstan.org »

Major new features 🚀

  • Precise type for $matches from preg_match generally available, out of bleeding edge (bd2cec1185)
  • PHP 8.4 runtime support
    • PHPStan runs on PHP 8.4 without emitting deprecation notices
    • Full support for PHP 8.4 including new syntax and rules is coming later, after PHPStan 2.0 release

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 🔧

  • Internal classes made final, @api classes made @final (#​3264, 5baa146510)
  • Repair PhpParser\Node\Stmt\Class_::isAnonymous() (#​3343), thanks @​tscni!
  • Improve curl_init() return type analysis (#​3346), thanks @​tscni!
  • StubValidator - added missing rules (7fc5ab8dfb)
  • Do not allow @phpstan-self-out above static method (0dfd821769)
  • Check unresolvable types in @phpstan-self-out (e182c0662d)
  • Check generics in @phpstan-self-out (9ebc315589)
  • ConstExprNodeResolver - support ConstFetchNode for class constants (3e51899dd7) - allowed in default parameter values in @method

Bugfixes 🐛

  • PHPStanDiagnoseExtension - skip showing config files in "Included configs from Composer packages" if already present in the "Extension installer" section (6c4477c9fc)
  • Support multiple anonymous class definitions on the same line (#​3328), #​5597, #​11511, thanks @​tscni!
  • Fix ConstantArrayType not accepting NeverType (#​3327), #​11517, thanks @​tscni!
  • Narrow to non-falsy-string from strlen() on integer range (#​3337), thanks @​staabm!
  • Narrow arrays in union based on count() with integer range (#​3335), thanks @​staabm!
  • Fix description escaping in UsedTraitsRule (4ffbb3b126)

Internals 🔍

  • Cleanup TypeSpecifier (#​3340), thanks @​staabm!
  • Refactor ReplaceFunctionsDynamicReturnTypeExtension (#​3339), thanks @​staabm!
  • BetterReflectionSourceLocator - playground mode (7d1bde44af)
  • Internal PHPStan rule - class must be abstract or final (d631120bea)
  • Downgrade PHP files in build/PHPStan (fe503cad77)
  • ExtendedPropertyReflection (d65138a11f)
  • Replace highlight_string() stub with a return type extension (#​3350)
  • Issue bot - test PHP 8.4 (#​3358)

v1.11.11

Compare Source

Improvements 🔧

  • Narrow arrays in union based on count() with smaller/greater operator (#​3324), #​11480, thanks @​staabm!
  • PHPStanDiagnoseExtension - show Composer packages with included config files (58d202fddc)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.11.10

Compare Source

Bleeding edge 🔪

  • Precise array shape for preg_replace_callback() $matches (#​3281), thanks @​staabm!
  • Report invalid exclude paths in PHP config (9718c14f1f)

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 🐛

Function signature fixes 🤖

Internals 🔍

  • Extracted RegexGroupParser from RegexArrayShapeMatcher (#​3278), thanks @​staabm!
  • E2E test about path validation in ignoreErrors and excludePaths (9246976958)
  • RegularExpressionPatternRuleTest: utilize preg_match() array shape tests (#​3290), thanks @​staabm!
  • Simplify RegexArrayShapeMatcher (#​3293), thanks @​staabm!
  • Refactor RegexGroupParser - extract RegexAlternation class (#​3296), thanks @​staabm!

v1.11.9

Compare Source

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 🔧

  • DefaultStubFilesProvider - consider all composerAutoloaderProjectPaths when filtering 3rd party stub files (582a0f8a74), #​11393

Bugfixes 🐛

Internals 🔍

v1.11.8

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.11.7

Compare Source

Improvements 🔧

  • Rework match expression analysis with enum with performance in mind (b98abe01ca), #​11263
  • DiagnoseExtension (d55933fa0c)
    • This extension can output any diagnostic information to stderr after analysis
    • PHPStan displays this information when running the "analyse" command with -vvv CLI option.
  • Result cache - debug message about successfully restored cache (979055fcee)
  • Show a hint about -vv for unignorable errors when generating the baseline (d931c89875), #​3973
  • Limit the depth when resolving closure type for performance reasons (2c08dfa8d0), #​11283
  • MutatingScope::resolveType() - cache closure body analysis data (fd3115652b), #​11283

Bugfixes 🐛

Function signature fixes 🤖

  • getimagesize, getimagesizefromstring: zero is a possible value for height and width (#​3207), thanks @​mfruehauf!

Internals 🔍

v1.11.6

Compare Source

Bleeding edge 🔪

  • Precise array shapes for preg_match() for $matches by-ref parameter (#​2589), thanks @​staabm!
  • Improved the type of the $mode parameter for the count() (#​3190), thanks @​kuma3!

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 🔧

  • PHPStan Pro - report fatal errors more nicely (a99c71e3be)
  • PHPStan Pro - do not repeat ProcessCrashedException in CLI output because it's already presented in the UI (6e700418d6)
  • Add Cloudflare CA to composer/ca-bundle cacert.pem (30f68ba755)
  • Implement ParameterOutTypeExtensions (#​3083), thanks @​staabm!
  • Do not output some internal errors twice (4f75ba6bdc, 9967f48574)
  • Forbid _HumbugBox prefixed classes (#​3186), thanks @​staabm!

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.11.5

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

  • Regression test (#​3136), thanks @​staabm!
  • Relax test version restriction (#​3140), thanks @​thg2k!
  • Fix PrepareCommand::fixComposerJson() (4537ef1445)
  • Internal errors as structured objects (7cd03f02a5)
  • WorkerCommand - do not return exit code 1 in case of internal errors, they are handled anyway (f76d836d13)
  • NodeScopeResolverTest - remove requires (f6b989881e)
  • Fix discrepancy between lint >= and PHP_VERSION_ID in NodeScopeResolverTest (b530b0d53d)
  • TypeInferenceTestCase::gatherAssertTypesFromDirectory() (595de78d35)
  • Take advantage of gatherAssertTypesFromDirectory in NodeScopeResolverTest (#​3159)
  • Turn TraitsCachingIssueIntegrationTest into a e2e test (#​3151), thanks @​staabm!

v1.11.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.11.3

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.11.2

Compare Source

Improvements 🔧

  • Stricter @phpstan-ignore identifiers parser (#​3079, #​3090, #​3091), thanks @​janedbal!
    • The parser now rejects some syntax that was possible but undocumented in 1.11.0 and 1.11.1
    • The parser now allows to attach comment to each single identifier in a list: @phpstan-ignore identifier (comment), identifier2 (comment2)
  • Resolving type of closure - get $passedToType from inFunctionCallsStack (ca41b7d8c2, da4fd7a412), #​5508, #​10254, #​10732
  • Do not lose generic type when the closure has native return type (7e9cd45701), #​9086

Function signature fixes 🤖

Internals 🔍

v1.11.1

Compare Source

Improvements 🔧

  • Support integer ranges in sprintf() constant result inference (#​3075), thanks @​staabm!

Bugfixes 🐛

Function signature fixes 🤖

v1.11.0

Compare Source

Read the article about PHPStan 1.11 on phpstan.org »

Major new features 🚀

  • Error identifiers
  • PHPStan Pro Reboot
    • A new migration wizard will effortlessly migrate all your @phpstan-ignore-line and @phpstan-ignore-next-line to the new @phpstan-ignore comment style with error identifiers. The old comment style is dangerous because it ignores all errors, current and future, on that line.
    • Revamped UI for much more comfortable viewing and browsing of reported errors
    • The new UI also lets you browse ignored errors, from ignoreErrors, from your baseline and also ignored locally in source code using comments
    • Streaming errors during launch: You don't have to wait for the analysis to complete, you can see errors as they come in during the analysis
    • Support for mapping file paths to the host filesystem when running in Docker or remotely
    • Try it out by running PHPStan with --pro CLI option
  • PHPDoc tags describing callable lifecycle: @param-immediately-invoked-callable, @param-later-invoked-callable
  • PHPDoc tag @param-closure-this to describe what $this is bound to in a passed closure
  • Two new config options around stricter offset checks in arrays (#​3028), #​7553, thanks @​ttomdewit!

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 🔧

  • Generic RuleErrorBuilder (9a3ed85178)
  • Deprecate checkMissingIterableValueType: false and checkGenericClassInNonGenericObjectType: false in favour of ignoring via identifiers (a64998108b)
  • Deprecate old NoopRule - replaced by BetterNoopRule in bleeding edge (109083571d)
  • Allow ignoring errors from CollectedDataNode with local comments (dc3b75ab4a)
  • Introduce new type (#​3050), #​9704, thanks @​ruudk!
  • RuleTestCase - fail on PHP warnings, notices etc. (#​3030), thanks @​janedbal!
  • Check duplicate assignment of redeclared promoted readonly properties (#​3049), #​8101, #​9863, #​9864, thanks @​schlndh!
  • Remove line from "nikic/php-parser" error message (#​2845), thanks @​mvorisek!
  • Stub validator - PHPStan classes are known without extra stubs (d004c23967)
  • Stub validator - PhpParser classes are known without extra stubs (3e498e1592)
  • CheckstyleErrorFormatter - include error identifier in source attribute (f66cf5badd), #​1205
  • BaselinePhpErrorFormatter - error identifiers in comments (4b32cac2d1)
  • RuleErrorBuilder::file() - file path needs to exist (c453f29f60)
  • AbstractMethodInNonAbstractClassRule - better error message for enums (b5dd34e492)
  • Fixed Xdebug spelling (#​2746), thanks @​derickr!
  • Track invalidated $this and used variables after invoking closure (#​2980)
  • Support @phan- prefixes on recognized PHPDoc tags (#​3000), thanks @​anomiex!
  • pure-callable and pure-Closure PHPDoc types (cdaff5f00d)
  • highlight_string() flips side-effects depending on $return (#​3021), thanks @​staabm!
  • Improve types for predefined constants (#​3054), thanks @​zonuexe!

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.67

Compare Source

This is the last release, or one of the last releases, in 1.10.x series. The next one is going to be PHPStan 1.11, and it's going to be released at some point in May 2024.

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • composer-dependency-analyser: update to 1.5.0 (support functions) (#​3011), thanks @​janedbal!

v1.10.66

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Prevent unnecessary calls into reflection from JSON extensions (#​2994), thanks @​staabm!

v1.10.65

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.64

Compare Source

Bleeding edge 🔪

  • Fail build when project config uses custom extensions outside of analysed paths
    • This will only occur after a run that uses already present and valid result cache

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 🐛

Function signature fixes 🤖

v1.10.63

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.62

Compare Source

Improvements 🔧

  • Too wide return type - report for conditional return types (de1c07ea68)

Bugfixes 🐛

  • Constants deprecation depends on PHP version in comment (#​2967), #​10700, thanks @​staabm!
  • Make @param-out work even if it is the only conditional type in a function signature (787c1e2b46)
  • ParameterOutAssignedTypeRule - fix for conditional types (19497ba031)
  • ParameterOutExecutionEndTypeRule - fix for conditional types (27c73f7f67)
  • Too wide @param-out - fix for conditional types (5a4789339e)

v1.10.61

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

  • MethodReturnStatementsNode - use ExtendedMethodReflection (3cc1a54564)

v1.10.60

Compare Source

Learn more about this release in an article on phpstan.org!

Major new features 🚀

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.59

Compare Source

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 🔧

  • ArrayFilterRule - tip message about treatPhpDocTypesAsCertain (f5b198c980)
  • ArgumentsNormalizer - skip unused arguments in non-variadic signatures, still return a normalized call (17e5bac093)
  • Methods in fluent interfaces are considered impure (b0261263e2)
  • Add type-specifying extension for settype() (#​2920), thanks @​ChrisBrenton!

Bugfixes 🐛

  • MethodAssertRule - do not report implicitly inherited assert tags (299df5130a), #​10573
    • Gets rid of the annoying error "Asserted type ... with type ... does not narrow down the type."
  • ConstantArrayType - string offset might exist as integer offset (2fb66328fd), #​10577

Internals 🔍

v1.10.58

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.57

Compare Source

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 🔧

  • Update ClassReflection::getConstant() return type (8d4ea60a57)
  • Cover ClassConstantReflection with BC promise (8f82b799c5)

Bugfixes 🐛

Function signature fixes 🤖

v1.10.56

Compare Source

Major new feature 🚀

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.55

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.54

Compare Source

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 🐛

v1.10.53

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.52

Compare Source

Improvements 🔧

  • Do not allow to generate baseline when reflection error occurs (78ea9a6210)
  • Show internal errors that occured when generating a baseline (c997ea9eef)

Bugfixes 🐛

v1.10.51

Compare Source

Bleeding edge 🔪

  • ParamAttributesRule - promoted property attribute needs to target both parameters and properties (25d15526db), #​10298
  • More precise RecursiveIteratorIterator::__construct() parameter types (#​2835), thanks @​staabm!
  • PhpDocParser: add config for lines in its AST & enable ignoring errors within PHPDocs (#​2807), 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 🔧

  • Missing ThrowExprTypeRule - level 3 (0359ebc78f)
  • Analyse stubs only when not only files are analysed (402024091b)
  • Nicer error message in case of memory limit exhaustion in child process (816be99361)

Bugfixes 🐛

Internals 🔍

v1.10.50

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.49

Compare Source

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 🐛

Function signature fixes 🤖

  • Make SimpleXMLElement method return types benevolent (when they return static|null) (fb76c9f7d3)

v1.10.48

Compare Source

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 🐛

Function signature fixes 🤖

v1.10.47

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.10.46

Compare Source

Improvements 🔧

Bugfixes 🐛

  • Fix namespace of named type in class constant native type by patching PHP-Parser (8234dc0b34), #​10212
  • Do not create conditional expression for the same variable (aec0406811)
  • It's okay to have always-throwing expression in arrow function (758e5f118a), #​7890

Internals 🔍

v1.10.45

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.44

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.10.43

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.42

Compare Source

This release closes 25 issues! 🎉

Major new features 🚀

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.41

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • MutatingScope::debug() - add info about conditional expressions (80782fb84d)

v1.10.40

Compare Source

Improvements 🔧

  • TemplateTypeCheck tries to resolve template type names such as self because they're not usable (c6fad644c7), #​10049

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.39

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.10.38

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.37

Compare Source

Bugfixes 🐛

v1.10.36

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.35

Compare Source

Major new features 🚀

Bugfixes 🐛

Internals 🔍

v1.10.34

Compare Source

Improvements 🔧

Function signature fixes 🤖

Internals 🔍

v1.10.33

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.32

Compare Source

Improvements 🔧

  • Optimize FileTypeMapper for huge PHPDocs (#​2582), #​9498
    • This fixes performance issue for projects that use Carbon (nesbot/carbon)
  • Optimize DumpParametersCommand (379008a6a6)

v1.10.31

Compare Source

Improvements 🔧

Internals 🔍

  • Do not pass a fake path to analyse in ClearResultCacheCommand; check paths count later when asking for files (4e37a2d78b)
  • FileCacheStorage - reference cache key in a comment (0fbf0eed7b)

v1.10.30

Compare Source

Improvements 🔧

  • NotAnalysedTraitRule - do not report for analysis of files-only paths (5f59d58b62)

Bugfixes 🐛

Internals 🔍

  • Issue bot - special NotAnalysedTraitRule that runs even with onlyFiles=true (6c941aecbf)
  • Ability to disable implicitThrows in tests (#​2576), thanks @​janedbal!
  • Rename duplicate symbols (2171717879)

v1.10.29

Compare Source

Improvements 🔧

  • Update nikic/php-parser to v4.17.1
    • PHP 8.3 features are no longer parse errors. Full-fledged PHP 8.3 support is coming later this year.
  • Update BetterReflection to 6.12.0

Bugfixes 🐛

  • PHPStan Pro - when launching, PHP_BINARY needs to be escaped (2c7cfd8b82)

Function signature fixes 🤖

v1.10.28

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.27

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

  • Avoid doing work before its necessary in mutating scope. (#​2537), thanks @​mad-briller!
  • Changed linesToIgnore attribute format (2862a7bf79)
  • Prevent unnecessary work in MutatingScope (#​2554), thanks @​staabm!
  • Validate parameters with parametersSchema each time after container creation (#​2558)

v1.10.26

Compare Source

Improvements 🔧

Bugfixes 🐛

  • Fix filtering default stub files on Windows (#​2406), thanks @​maryo!
  • FileHelper absolutize and normalize: Fix path with scheme (#​2506), thanks @​mvorisek!
  • Fix array_keys() and `array_values()`` on constant arrays (#​2516), thanks @​jlherren!
  • Fix access to uninitialized property via extension in additional constructor (218aad0804), #​9619
  • Fix result cache bug with imported type aliases (553c4b141b), #​9622
  • Fix result cache bug with imported type aliases in a trait (d8071d0904)
  • Fix PHP 8.3 deprecation ($foo-- with a non-numeric string no longer allowed) (c6f4c4ceb7)
  • Array shape with optional keys might be a list (97f0039fe5)
  • ArrayMapFunctionReturnTypeExtension - preserve array being a list (d55c4f2c20)

Function signature fixes 🤖

Internals 🔍

v1.10.25

Compare Source

Improvements 🔧

  • Understand that promoted property can come from renamed trait constructor (eafba2e091)
  • Understand that methods called from constructor throwing exception cannot leave object in an uninitializad state (f4d060b688)

Bugfixes 🐛

  • Allow promoted properties in trait __construct even when renamed (4dd3f753b1), #​9577
  • IllegalConstructorStaticCallRule - fix for renamed trait constructor (65330d3be7), #​9577

v1.10.24

Compare Source

Improvements 🔧

  • Evaluate uninitialized properties based on each execution end in constructor (b2d2a9d08d), #​7649
  • ConstructorReturnTypeRule (2ebbb5303a)

Bugfixes 🐛

Function signature fixes 🤖

v1.10.23

Compare Source

Improvements 🔧

  • Fix false positives and false negatives about uninitialized properties (348debc5c3), #​7198
    • This leads to uninitialized properties being detected in more places
  • Lazy initialization of AnalyserResult::$errors (#​2400), thanks @​takaram!
  • Check additional assign of promoted readonly property (8fe4401489)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Cheap checks first in IgnoredRegexValidator (#​2505), thanks @​mad-briller!
  • Do not use instanceof ThisType as it can be unreliable in case of intersection types (79359450f3)

v1.10.22

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.21

Compare Source

Bugfixes 🐛

Internals 🔍

v1.10.20

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.10.19

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

  • StringAlwaysAcceptingObjectWithToStringType is supertype of Stringable objects (9de9efa67f)

v1.10.18

Compare Source

Implicit throw point is enough to no longer mark multi-catch as dead (c587dd1d87), #​9406

v1.10.17

Compare Source

Improvements 🔧

  • StubValidator - add missing rules about type aliases (8bb45376ca)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.16

Compare Source

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 🐛

Internals 🔍

v1.10.15

Compare Source

Bleeding edge 🔪

  • InvalidPhpDocTagValueRule: include PHPDoc line number in the error message (a04e0be832)

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 phpdoc-parser to 1.20.4
    • Changelog
    • Notable changes:
      • CallableTypeNode - support object shape in return type
      • CallableTypeNode - support $this in return type
      • CallableTypeNode - support ConstTypeNode in return type
  • Implement IniGetReturnTypeExtension (#​2362), #​3063, thanks @​staabm!
  • PHPStan\Node\ClassMethod is covered by BC promise (1036d199c8), #​9249
  • Enforce magic __serialize() and __unserialize() return types (#​2372), thanks @​staabm!
  • Report ?-> call on always-null (74d1c9a1ca), #​9284

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Allow referencing StringAlwaysAcceptingObjectWithToStringType in functionMap (670d04d817)

v1.10.14

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.13

Compare Source

v1.10.12

Compare Source

Major new features 🚀

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.10.11

Compare Source

Bleeding edge 🔪

  • Fix position variance of static method parameters (#​2313), thanks @​jiripudil!
  • Check variance of template types in properties (#​2314), thanks @​jiripudil!
  • OverridingMethodRule - include template types in prototype declaring class description (ca2c66cc4d)

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 🐛

Function signature fixes 🤖

v1.10.10

Compare Source

Improvements 🔧

Bugfixes 🐛

  • IssetCheck - respect treatPhpDocTypesAsCertain for variables (5b7a1153dd), #​9126
  • IssetCheck - respect treatPhpDocTypesAsCertain in more places (49d2aa6fd0)
  • Do not check template type variance in constructor (#​2311), thanks @​jiripudil!

Function signature fixes 🤖

v1.10.9

Compare Source

Improvements 🔧

Function signature fixes 🤖

v1.10.8

Compare Source

Improvements 🔧

  • Detect large .php baseline file in analysed paths and warn about possible PHPStan slowdown (d6d9ef72d7)

Bugfixes 🐛

Internals 🔍

v1.10.7

Compare Source

Improvements 🔧

  • Backed enums - dynamic return type extension for from() and tryFrom() (edcaaba2ad)

Function signature fixes 🤖

Internals 🔍

v1.10.6

Compare Source

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 🔧

  • InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (d943d58c21)

Bugfixes 🐛

v1.10.5

Compare Source

Improvements 🔧

  • Check local type aliases above traits (4654c1651f)

Bugfixes 🐛

v1.10.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.10.3

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.10.2

Compare Source

Improvements 🔧

Function signature fixes 🤖

  • Instances of object returned by db2_*() functions are always instances of stdClass (#​2249), thanks @​phansys!

v1.10.1

Compare Source

Bugfixes 🐛

v1.10.0

Compare Source

Read the article about this release: PHPStan 1.10 Comes With a Lie Detector

Major new features 🚀

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 🔧

  • Implement identical/equal comparisons on EnumCaseObjectType (#​2105), thanks @​staabm!
  • MatchExpressionRule - use ConstantConditionRuleHelper to remove some duplicate errors (7380ed0e48)
  • Improvements of MutatingScope::getNativeType() (#​1943), #​4689, #​7578, #​6260
  • Allow default values for allow-private-mutation properties (#​2178), #​8701, thanks @​zonuexe!
  • Support treatPhpDocTypesAsCertain in NumberComparisonOperatorsConstantConditionRule (649eb70ba3), #​6776, #​7075
  • JsonErrorFormatter - strip console-specific characters from tip (6419da745a)
  • InClassMethodNode - add getClassReflection() (c4ee0b8449)
  • PhpFunctionFromParserNodeReflection and PhpMethodFromParserNodeReflection are part of BC promise (8107179681)
  • AttributesCheck - detect deprecated attributes (e46b0b4aaf)
  • Introduce Type::getTemplateType() and deprecate GenericTypeVariableResolver (b73a8aacc1, 01b4d4e9b8)
  • Implement PHP version dependent loose const comparison (#​2220, #​2225), thanks @​staabm!

Bugfixes 🐛

  • Fix LateResolvableTypeTrait (bc2828669f)
  • StrCaseFunctionsReturnTypeExtension - do not throw ShouldNotHappenException, it might happen if mbstring is not enabled and the polyfill is not implemented (c015e47f40), #​8925

Function signature fixes 🤖

Internals 🔍

  • Deprecate TypeUtils::getDirectClassNames() and instanceof TypeWithClassName, use Type::getObjectClassNames() instead (#​1924), thanks @​herndlm!
  • Remove dead code in UnionType (#​2194), thanks @​staabm!
  • Use isSuperTypeOf() instead of accepts() in the right places (ddb9dc5adc)
  • Modernized IncompatibleDefaultParameterTypeRule (a79ad03836)
  • InClassMethodNode always contains PhpMethodFromParserNodeReflection (01a789713c)
  • InFunctionNode always contains PhpFunctionFromParserNodeReflection (e864b24a85)
  • Modernized InClassMethodNode rules (c3da6a911a)
  • Modernized InFunctionNode rules (b736ddcecd)
  • Introduce Type::acceptsWithReason() (b763bd9631), #​3281
  • Fix invalid phpdocs missing null (#​2213), thanks @​janedbal!
  • NodeScopeResolver::earlyTerminatingMethodNames remove useless default (#​2214), #​8830, thanks @​janedbal!
  • Skip testEditorUrlWithRelativePath() test on PhpStorm console (#​2229), thanks @​staabm!
  • VarianceCheck - accept only ParametersAcceptorWithPhpDocs (7da13f7de0)
  • Remove duplicate method definition from ConstantType interface (61fa3a14e2)
  • Type::isEnum() (93113cbca6)
  • Type::getObjectClassReflections() (4c7046ef68)

v1.9.18

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

  • Remove unneded code in ConstantArrayType::hasOffsetValueType() (#​2238), thanks @​herndlm!

v1.9.17

Compare Source

Bugfixes 🐛

v1.9.16

Compare Source

  • Fix false positive about unused class elements when the class uses a trait (fbdf0da9b7)

v1.9.15

Compare Source

Improvements 🔧

  • ignoreErrors entries for same message and path are summed together (fa70062df0)
  • Make PHP 8 deprecation "required params following optional ones" ignorable (#​2218), thanks @​Wirone!

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.9.14

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.9.13

Compare Source

Bugfixes 🐛

v1.9.12

Compare Source

Improvements 🔧

Internals 🔍

v1.9.11

Compare Source

Bugfixes 🐛

v1.9.10

Compare Source

v1.9.9

Compare Source

Improvements 🔧

  • New method Type::getEnumCases() to use instead of instanceof EnumCaseObjectType (a0242e0f72)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Exit early in TrinaryLogic::lazyAnd() and lazyOr() if current instance allows it (#​2173), thanks @​herndlm!
  • Remove unused iterable check in MissingTypehintCheck (#​2174), thanks @​herndlm!

v1.9.8

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.9.7

Compare Source

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 🔧

  • UnionType::pickTypes overriden in BenevolentUnionType for a more benevolent behaviour (480626ecb5)

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.9.6

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.9.5

Compare Source

Improvements 🔧

  • Improve constant string union handling for concat and encapsed string (#​2057), thanks @​schlndh!
  • PhpVersion: supportsDisjunctiveNormalForm (#​2130), thanks @​janedbal!
  • Constant scalar types might accept general type from the same family (#​2131) - this moves some errors from earlier levels to level 7
  • Implement OversizedArrayBuilder to improve huge constant array performance (#​2116), #​8215, thanks @​staabm!
  • Improve performance again by dumbing down nested arrays (#​2077)
  • Result cache should not be invalidated by changes to editorUrl, editorUrlTitle and errorFormat parameters (#​2136), thanks @​bendavies!
  • Faster MutatingScope::shouldInvalidateExpression() (#​2139), thanks @​staabm!
  • Add ReturnStatementsNode::hasNativeReturnTypehint() (#​2141), thanks @​janedbal!
  • TypeNodeResolver - lowercase-string and non-empty-lowercase-string are known (884ceb015c)

Bugfixes 🐛

Internals 🔍

v1.9.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Internals 🔍

v1.9.3

Compare Source

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.9.2

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.9.1

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.9.0

Compare Source

Check out the article about this release!

Major new features 🚀

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 🐛

Function signature fixes 🤖

Internals 🔍

v1.8.11

Compare Source

Improvements 🔧

Bugfixes 🐛

  • Fix several stale result cache issues:
    • Fix stale @mixin result cache issue (7228d4d5c6), #​7831
    • Include @template tags in the result cache (4c0cb98c84)
    • Reanalyse all files with errors when new symbol appears (bc9301d983)
    • DependencyResolver - add method/property declaring classes to dependencies (e1c1366949)
    • DependencyResolver - declaring classes for static fetches (be6e7ced22)
    • DependencyResolver - @method, @property, @extends, @implements tags (ec5b6331e9)
    • Fix result cache getting stale because of trait @use (08703d1dac)
    • Fix stale result cache for property types (9e4e93b48c)
  • Fix wrong type inference about array (#​1808), #​8087, thanks @​VincentLanglet!
  • Invalidate DI container based on included files hashes (615c6a1d62)
  • Virtual expr nodes - do not reuse wrong attributes, a printed expr might be cached there (8369197775)
  • Fix reordering unspecified named arguments (#​1903), #​8204, thanks @​rvanvelzen!

v1.8.10

Compare Source

Improvements 🔧

  • RuleTestCase: enable gathering analyser errors without causing test failures (#​1728), thanks @​schlndh!

Bugfixes 🐛

  • Update BetterReflection to 6.3.0, fixes internal error (9febf1db4b), #​8139
  • Call nodeCallback with original argument with a name after reordering (ecc3076769)

Function signature fixes 🤖

v1.8.9

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.8.8

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.8.7

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • Compile PHAR on PHP 8.1 (#​1481)
  • phpstan-src: Require PHP 8.1, use readonly properties (#​1767)
  • phpstan-src: Use intersection type (376449e2d4)

v1.8.6

Compare Source

Improvements 🔧

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

Bugfixes 🐛

Function signature fixes 🤖

v1.8.5

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.8.4

Compare Source

PHPStan 1.8.3 but faster!

Improvements 🔧

Bugfixes 🐛

v1.8.3

Compare Source

This release fixes 76 issues! 🎉

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • HasOffsetType - create only for ConstantIntegerType|ConstantStringType (0a2fc63e1f)
  • Simplify non-empty-array removal in array_push/array_unshift (#​1552), thanks @​herndlm!
  • Fix VirtualNode::getType() returning an incorrect value for ClassConstantsNode and MethodReturnStatementsNode (#​1568), thanks @​Muqsit!
  • Add return type stub for SimpleXMLElement::asXML (#​1606), thanks @​herndlm!
  • Simplify TypeSpecifier (#​1613), thanks @​staabm!
  • Avoid unnecessary intersection in MutatingScope::filterBySpecifiedTypes (#​1536), thanks @​herndlm!
  • Make IntegerRangeType constructor private (#​1624), #​7803, thanks @​herndlm!
  • Remove jean85/pretty-package-versions dependency (#​1607), thanks @​herndlm!
  • Require brianium/paratest ^6.5 to fix PHP 8.2 deprecation notices (#​1631), thanks @​herndlm!
  • Replace pickArrays method in array_search extension with getAnyArrays helper (#​1632), thanks @​herndlm!
  • Intersect HasOffsetValue type only with possible arrays (#​1634), thanks @​herndlm!
  • Avoid benevolent union behaviour for more type methods (#​1644), thanks @​herndlm!
  • Use isArray instead of array supertype checks (#​1634), thanks @​herndlm!
  • Use isString instead of string supertype checks (#​1634), thanks @​herndlm!
  • Make MutatingScope::invalidateMethodsOnExpression() private (f3fe24577f)
  • Deprecate TypeUtils::containsCallable() (#​1667), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_pop and array_shift extensions (#​1668), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_fill_keys extension (#​1676), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_reduce extension (#​1677), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array pointer functions extension (#​1678), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_map extension (#​1680), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in RegularExpressionPatternRule (#​1679), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_key_first and array_key_last extensions (#​1681), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_intersect_key extension (#​1682), thanks @​herndlm!
  • Use TypeUtils::getOldConstantArrays in array_column extension (#​1683), thanks @​herndlm!

v1.8.2

Compare Source

Improvements 🔧

  • Basic support for PHP 8.2
    • #[\AllowDynamicProperties] attribute support (RFC)
    • #[\SensitiveParameter] attribute support (RFC)
    • Updated function signatures
    • Fixed deprecations in PHPStan
  • --debug: print previous exceptions (a342b2bea0), #​7590
  • Changed the MutatingScope class to not include impossible arms in it's resulting union type. (#​1515), thanks @​mad-briller!

Bugfixes 🐛

Function signature fixes 🤖

v1.8.1

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.8.0

Compare Source

Major new features 🚀

Bleeding edge 🔪

  • Check that each trait is used and analysed at least once - level 4 (c4d05276fb)
  • Check that PHPStan class in class constant fetch is covered by backward compatibility promise (9e007251ce)

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 🐛

Function signature fixes 🤖

v1.7.15

Compare Source

Improvements 🔧

  • Support for relative paths in editorUrl for Docker environment (#​1414), #​7043, thanks @​Wirone!
  • Support positional arguments in sprintf() constant format inference (#​1437, #​1440, #​1441), thanks @​staabm!
  • Dynamic return type extension for sscanf() and fscanf() (#​1434), thanks @​staabm!
  • Virtual nodes (InClassMethodNode, InFunctionNode, InClosureNode) - pass and provide getters for specific reflection so that Scope::getFunction() does not need to be used (f18bd86495)

Bleeding edge 🔪

  • Check code in custom PHPStan extensions for runtime reflection concepts like is_a() or class_parents() (c4a662ac6c)
  • Check code in custom PHPStan extensions for runtime reflection concepts like new ReflectionMethod() (536306611c)
  • ApiInstanceofRule
    • Report instanceof of classes not covered by backward compatibility promise (ff4d02d62a)
    • Report instanceof of classes covered by backward compatibility promise but where the assumption might change (996bc69fa9)

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

Bugfixes 🐛

Function signature fixes 🤖

v1.7.14

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.7.13

Compare Source

Improvements 🔧

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

Bugfixes 🐛

v1.7.12

Compare Source

Improvements 🔧

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

Bugfixes 🐛

v1.7.11

Compare Source

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

Bugfixes 🐛

v1.7.10

Compare Source

Improvements 🔧

  • Adapt to different vendor-dir setting in composer.json, and also COMPOSER environment variable (#​1384), thanks @​canvural!

Bugfixes 🐛

Internals 🔍

v1.7.9

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.7.8

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.7.7

Compare Source

Bugfixes 🐛

v1.7.6

Compare Source

Bugfixes 🐛

  • Rewrite the located identifier name with class aliases in mind (#​1369), #​7308
  • Class definition from autoloader should be preferred over PhpStorm stubs, #​7357, #​3634

v1.7.5

Compare Source

Bugfixes 🐛

Fixes for more custom autoloader scenarios (#​7296, #​7308):

  • Create class reflection from runtime reflection after custom autoloader run (#​1368)
  • Additional fix to make class aliases work (99acc024f9)
  • Include custom autoloaders registered in Composer dependencies (eab4542c4b)

v1.7.4

Compare Source

Improvements 🔧

  • Avoid additional irrelevant constructor-related checks in UnusedPrivatePropertyRule (#​1360), thanks @​herndlm!

Bugfixes 🐛

Function signature fixes 🤖

v1.7.3

Compare Source

Improvements 🔧

  • Docker image: default tag uses PHP 8.0, introducing new tag for PHP 8.1 (#​7334):
    • latest + latest-php8.0 use PHP 8.0
    • latest-php8.1 uses PHP 8.1
    • 1 + 1-php8.0 use PHP 8.0
    • 1-php8.1 uses PHP 8.1
    • 1.7.3 + 1.7.3-php8.0 use PHP 8.0
    • 1.7.3-php8.1 uses PHP 8.1
    • nightly + nightly-php8.0 use PHP 8.0
    • nightly-php8.1 uses PHP 8.1
  • NodeScopeResolver: call nodeCallback for all attribute-related nodes (#​1333), #​7071, thanks @​janedbal!
  • Consistent approach to stubFiles + StubFilesExtension (d3589dc541), #​7330
  • Consider optional keys in ConstantArrayType removeFirst and removeLast (#​1352), thanks @​herndlm!
  • Consider optional keys in ConstantArrayType::slice (#​1345), thanks @​herndlm!
  • Understand variadic arg type with @no-named-args (#​1349), #​5968, thanks @​jrmajor!
  • Add ArrayChunkFunctionReturnTypeExtension (#​1356), #​7277, thanks @​herndlm!

Bugfixes 🐛

Function signature fixes 🤖

  • Fix incorrect type for NumberFormatter:format() and NumberFormatter::formatCurrency() (#​1350), thanks @​MartkCz!

v1.7.2

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.7.1

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.7.0

Compare Source

This release closes 25 issues! 🥳

Major new features 🚀

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 🔧

  • Allow setting error format in configuration file (#​841), thanks @​ruudk!
  • Deprecated PHPStan\Type\ConstantTypeHelper::getTypeFromValue(). Instead of going from runtime value -> PHPStan type, use PHPStan\Reflection\InitializerExprTypeResolver::getType() to go from Expr -> PHPStan type. In case you have Scope available, use Scope::getType().
  • Read default values from php-8-stubs and jetbrains/phpstorm-stubs (7ce177e71b)
  • Normalize named arguments when calling extensions (#​1301, #​1313), #​5866, thanks @​staabm!
  • implement str-case functions return type extension (#​1325), thanks @​staabm!
  • ClearResultCacheCommand: allow --debug flag (5f5b96d432)

Bugfixes 🐛

Function signature fixes 🤖

v1.6.9

Compare Source

Bugfixes 🐛

v1.6.8

Compare Source

Bugfixes 🐛

v1.6.7

Compare Source

  • Make DateTime(Immutable)::modify() behaviour less annoying (7bd9fb7285)

v1.6.6

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.6.5

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.6.4

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.6.3

Compare Source

Improvements 🔧

  • Handle ConstantArrayType === ConstantArrayType (6e02453df3)
  • Handle ConstantArrayType == ConstantArrayType (c9ae89cab4)
  • Understand == between ConstantScalarType (5c85200c97)
  • Use root expression when checking impossible types (#​1254), thanks @​herndlm!
  • implemented str_contains FunctionTypeSpecifyingExtension (#​1068), thanks @​staabm!

Bleeding edge 🔪

  • ConstantLooseComparisonRule - level 4 (6ebf2361a3)

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

Bugfixes 🐛

v1.6.2

Compare Source

Improvements 🔧

  • Remove unneeded continue in array_push / array_unset arg handling (#​1252), thanks @​herndlm!
  • BaselineNeonErrorFormatter does not need to implement ErrorFormatter interface (3a3c69eb93)

Bugfixes 🐛

v1.6.1

Compare Source

Bugfixes 🐛

v1.6.0

Compare Source

Read the article about PHPStan 1.6.0 »

Major new features 🚀

  • Conditonal return types (pull requests), #​3853, big thanks to @​rvanvelzen!
    • Allows return types in the form of @return ($i is positive-int ? non-empty-array : array) (don't forget the parentheses!)
    • Another possible form is with generic @template tags: @return (T is positive-int ? non-empty-array : array)
  • int-mask<...> and int-mask-of<...> types (#​1166), thanks @​rvanvelzen!
  • Allow global constants as PHPDoc types (#​1163), thanks @​rvanvelzen!
  • Update php-8-stubs to know about PHP 8.1 function signature changes, #​7017, #​6448
  • Make isset() and null-coalesce (??) operators consistent with each other (#​1223), thanks @​rajyan!
    • New option checkDynamicProperties to restore the original stricter behaviour (#​1234), thanks @​rajyan!

Bleeding edge 🔪

  • Fully static reflection engine
    • After feedback is gathered and processed, this will be enabled for everyone later in PHPStan 1.x release cycle.
  • Lower memory consumption thanks to breaking up of reference cycles
    • This is a BC break for rules that use 'parent', 'next', and 'previous' node attributes. Learn more »
    • In testing the memory consumption was reduced by 50–70 %.
  • ArrayUnpackingRule (level 3) (#​856), thanks @​canvural!
  • Rules for checking direct calls to __construct() (level 2) (#​1208), #​7022, thanks @​muno92!
  • checkMissingIterableValueType: false no longer does anything (50d0c8e23e)

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 🐛

Function signature fixes 🤖

v1.5.7

Compare Source

Bugfixes 🐛

v1.5.6

Compare Source

This release enables to write forward-compatible custom rules with PHPStan 1.6.0+Bleeding Edge. Detailed instructions are here: https://phpstan.org/blog/preprocessing-ast-for-custom-rules

  • Allow registering of custom rich parser node visitors (b0dafcc492)

v1.5.5

Compare Source

Improvements 🔧

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

Bugfixes 🐛

Function signature fixes 🤖

v1.5.4

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.5.3

Compare Source

Improvements 🔧

Bugfixes 🐛

v1.5.2

Compare Source

Bugfixes 🐛

  • Fix infinite recursion when caching types (#​1137), #​6896, #​6911
    • Fixing bugs by removing caching 😂
  • Timewise performance optimizations (22f755c6a0)
    • Offseting the removal of PHPDocs cache

v1.5.1

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

v1.5.0

Compare Source

This release fixes 26 issues! 🎉

Improvements 🔧

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

Bugfixes 🐛

Function signature fixes 🤖

Internals 🔍

  • PHPStan now utilizes version-based naming of Git branches (1.5.x) instead of master
  • CI pipeline is faster thanks to several improvements:
    • Support for PHP 7.1 was dropped
    • Reproducible phpstan.phar checksum is computed and compared when running integration tests from phpstan/phpstan on pull requests in phpstan-src. The integration tests run only when the checksum was changed. This means that for example if only unit tests in phpstan-src were changed, PHAR didn't change and those integration tests from phpstan/phpstan don't have to run.
    • Rector downgrade cache was implemented. When transforming sources from PHP 8.0 to various lower PHP versions, cache is utilized instead of making Rector do the hard work each time.

v1.4.10

Compare Source

v1.4.9

Compare Source

Improvements 🔧

  • Identical (=== and !==) and Equal (== and !=) with the same variables resolve to ConstantBooleanType (98c4d84ec9)
  • Scalars of the same type on both of Equal (== and !=) are delegated to Identical (=== and !==) (316f269d6e)

Bugfixes 🐛

v1.4.8

Compare Source

Improvements 🔧

  • Validate ignoreErrors regexes during DIC compilation (save time in each run) (692158c194), #​6693
  • Validate parametersSchema only during DIC compilation (50f25e95ad)
  • Retain left and right types in == and === expression (#​1046), thanks @​herndlm!
  • Add support for integer ranges in strtotime() with constant strings (#​1045), thanks @​Seldaek!

Bugfixes 🐛

v1.4.7

Compare Source

This release fixes 43 issues! 🎉

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.4.6

Compare Source

Improvements 🔧

  • Implemented constant type inference for implode() function (#​991), thanks @​staabm!

Bugfixes 🐛

Function signature fixes 🤖

v1.4.5

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.4.4

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.4.3

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.4.2

Compare Source

v1.4.1

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.4.0

Compare Source

This release fixes 25 issues! 🎉

Major new features 🚀

  • Support for PHP 8.1 readonly properties (RFC)
    • Readonly properties must be assigned in the constructor of the declaring class
    • Memoized type of a readonly property is not invalidated even when calling a method with side effects
    • Readonly properties cannot be passed by reference
  • Improved detection of incorrect types assigned to properties:

Improvements 🔧

  • ParametersAcceptorSelector - message for ShouldNotHappenException (d3c34832c7), #​6328
  • Constructor of BenevolentUnionType is covered by BC promise (8f28dc8453)

Bugfixes 🐛

Thanks to some internal refactorings listed below, the following issues have been fixed: #​5337, #​4910, #​5316, #​5607, #​3766, #​3858, #​3310, #​3264, #​2806, #​5328, #​3044, #​6184, #​3339, #​5656, #​5362, #​3867, #​5707

  • Fix scope after for-loop (4fb1a77b02)
  • Improve preserving ConstantArrayType after setting new offset (ec117fa2ae)
  • ConstantArrayTypeBuilder - preserve ConstantArrayType for integer range offsets (3eab4628f2)
  • Fix generalizing ConstantIntegerType in Scope (d6c7595ba5)
  • Scope generalization for integer range types (36513388a6)

Function signature fixes 🤖

v1.3.3

Compare Source

Improvements 🔧

v1.3.2

Compare Source

Improvements

  • Scope - Improved file description for traits used by anonymous classes (10e4602688), #​6312

Bugfixes 🐛

Function signature fixes 🤖

v1.3.1

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.3.0

Compare Source

Major new features 🚀

  • Support for PHP 8.1 Enums - RFC
  • Upgraded Roave/BetterReflection to 5.0.0
    • PHP 7.1+ is still supported because the dependency is downgraded automatically in our own fork
    • This brings plenty of bugfixes, for example PHP 8.0 Attributes can now be read in static reflection context
  • PHPStan now works when OPCache is enabled!
  • The development repository phpstan/phpstan-src is now PHP 8.0+ only, while the distribution package phpstan/phpstan still supports PHP 7.1+.
    • This is achieved thanks to automatic downgrade of source code using Rector during PHAR compilation
    • PHPStan now ships with Symfony PHP polyfills for PHP 7.2-8.0.

Improvements 🔧

  • Update nikic/php-parser to 4.13.2 (8939964ecf)
  • Update to Symfony 5.4 (#​863)
  • CLI option --allow-empty-baseline to allow generating empty baseline (#​776), thanks @​Lctrs!
  • Support for @phpstan-property, @phpstan-property-read, and @phpstan-property-write (#​775), thanks @​mad-briller!
  • Add support for the key-of<...> and value-of<...> types (#​800), thanks @​ste93cry!
  • GithubErrorFormatter > Allow any ErrorFormatter (#​854), thanks @​ruudk!
  • Array unpacking support for string-keyed arrays (#​803), thanks @​canvural!
  • Moved some classes from ClassBlacklistReflectionProvider to staticReflectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too (e40ba15698)
  • PHPStanTestCase: Added a helper method to assert no errors happend (#​894), thanks @​staabm!

Bugfixes 🐛

Function signature fixes 🤖

v1.2.0

Compare Source

Improvements 🔧

  • Support for some features from PHP 8.1
  • Support literal-string with encapsed strings (#​768), thanks @​craigfrancis!
  • Tips for always used properties and constants extensions (2db3c268e2)
  • Autowire rules from the rules config section by their class name (50cb90ddc6)

Bugfixes 🐛

Function signature fixes 🤖

  • functionMap - removed functions that are reserved keywords and separate AST nodes (08f3e2d023), #​6014

v1.1.2

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

v1.1.1

Compare Source

Bugfixes 🐛

v1.1.0

Compare Source

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖

v1.0.2

Compare Source

Bugfixes 🐛

Function signature fixes 🤖

  • Unified the name of the second array_map parameter (94333459e3)
  • More precise connection_aborted() signature (#​715), thanks @​staabm!
  • More precise str_split() signature (#​718), thanks @​staabm!
  • DateFunctionReturnTypeExtension: support more precise single-char date-formats (#​721), thanks @​staabm!
  • Support $preserve_keys argument for iterator_to_array() (#​748), thanks @​Lctrs!

v1.0.1

Compare Source

  • Fixed "Expected node type PhpParser\Node\Stmt\Property, NULL occurred" (e5f8e72c41), #​5875
  • DerivativeContainerFactory - pass all arguments to the derived container (f28c7e9d06)
  • PhpStanNamespaceIn3rdPartyPackageRule - fix segfault when there's no composer.json (d4efedbd50)

v1.0.0

Compare Source

PHPStan 1.0 is here and I'm really excited about it! Read the accompanying article on PHPStan's blog and also check out the merchandise we're selling for limited time (until November 22nd). It includes white and blue PHPStan t-shirts, PHPStan stickers, and also something very special: Rule level badges that you can pin to your clothes to show off that you care about code quality 😊

White and blue PHPStan T-shirts

Major new features 🚀

New rules

BC breaks for end-users

  • Level max is now level 9. Feel free to update max to 8 if your code isn't ready.
  • Description of some types was updated to match the syntax in PHPDocs. This includes numeric-string (it was previously described as string&numeric), and also array shapes.
  • Removed baselineNeon error formatter, use --generate-baseline CLI option instead (492cfbcd74)
  • Removed polluteCatchScopeWithTryAssignments config parameter (8933c7e28c)
  • Removed deprecated autoload_files parameter - use Discovering Symbols instead (7a21246cae)
  • Removed deprecated autoload_directories parameter - use Discovering Symbols instead (f67b48a712)
  • Removed bootstrap parameter - use bootstrapFiles instead (1baa29425d)
  • Moved implicitThrows configuration parameter to exceptions.implicitThrows (96b7c48025)
  • Removed --paths-file CLI option (5670cf2217), #​5756
  • Removed dump-deps command (9c7017c697)
  • Deprecated excludes_analyse option, use excludePaths instead (d25c5e5a6c)

The following are interesting only if you create a custom ruleset in your configuration file:

  • Removed DeadCatchRule, replaced by CatchWithUnthrownExceptionRule (4dba60bacb)
  • Removed VariableCertaintyInIssetRule, replaced by IssetRule (2e858dee38)
  • Removed MissingClosureNativeReturnTypehintRule, no longer needed thanks to type inference (1c34d8dc85)
  • Rename rules with typos (003ab1aea5)

BC breaks for extension developers

  • Extensions are checked with rules for correct usage of PHPStan internals according to backward compatibility promise.
  • Thanks to upgrading nikic/php-parser to version 4.13.0, you should now use ->getArgs() instead of ->args wherever possible.
    * Helpful message about this change is also included in PHPStan itself: c836a423d3
  • PHPStan\Parser\Parser service is no longer autowired. You need to choose the right instance for your needs and register it in the arguments section of your service that needs the parser in the configuration. The Parser services you can choose from are:
    • @defaultAnalysisParser - the best choice if you're parsing files that are among the analysed files
    • @currentPhpVersionSimpleDirectParser - the closest choice to default behaviour from previous PHPStan versions
    • Read more about this here.
    • Helpful message about this change is also included in PHPStan itself: 038c7a518f
  • Removed CompoundTypeHelper (145c4e3af4)
  • Removed CommentHelper (ebad6f61b9)
  • Removed DependencyDumper (9c7017c697)
  • Removed PHPStan\Reflection\Generic\ResolvedFunctionVariant, replaced by PHPStan\Reflection\ResolvedFunctionVariant (1cc6c8175a)
  • Removed ClassReflection::getNativeMethods(), use getNativeReflection() instead (d2c1446b3b)
  • Removed PhpPropertyReflection::hasPhpDoc(), replaced by hasPhpDocType() (bedd5be991)
  • NodeDependencies no longer iterable (f76875a84d)
  • Renamed TestCase to PHPStanTestCase (#​634), thanks @​frankdejonge!
  • StaticType and ThisType - require ClassReflection in constructor (7aabc84835)
  • PHPStanTestCase - extensions can no longer be provided by overriding methods from PHPStanTestCase. Use getAdditionalConfigFiles() instead. (65efd93f76, 239291a910)
  • Removed some unused internal helper methods from Broker (d578151030)
  • Changed return types of various methods that had |false to |null (629ccf6b02)
  • Type generalization precision is now a required argument (65681033ff)
  • Some constructor parameters are now required (1f4062fe2d)
  • Deprecated BrokerAwareExtension (db2f7fb9e7)
  • Deprecated PHPStanTestCase::createBroker(). Use createReflectionProvider() instead. (1e5cf58e07)
  • Deprecated PHPStan\Broker\Broker. Use PHPStan\Reflection\ReflectionProvider instead. (c7755948c1)
  • Deprecated PHPStan\Broker\Broker::getInstance(). Use PHPStan\Reflection\ReflectionProviderStaticAccessor instead. (4e7d60d74b)
  • Cannot create IntersectionType with less than two types (f7d232a666)
  • Removed ReflectionWithFilename, use ClassReflection|FunctionReflection instead (3738fcd98a)

Improvements 🔧

Bugfixes 🐛

Function signature fixes 🤖


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [phpstan/phpstan](https://github.com/phpstan/phpstan) | require-dev | major | `^0.12.29` -> `^2.0.0` | --- ### Release Notes <details> <summary>phpstan/phpstan (phpstan/phpstan)</summary> ### [`v2.1.18`](https://github.com/phpstan/phpstan/releases/tag/2.1.18) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.17...2.1.18) # Bleeding edge 🔪 - Name string expr check in ClassConstantRule ([#&#8203;3910](https://github.com/phpstan/phpstan-src/pull/3910)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Name string expr check in AccessPropertiesCheck ([#&#8203;4094](https://github.com/phpstan/phpstan-src/pull/4094)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Add `@phpstan-sealed` support ([#&#8203;4095](https://github.com/phpstan/phpstan-src/pull/4095)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - This release includes improvements and bugfixes from [PHPStan 1.12.28](https://github.com/phpstan/phpstan/releases/tag/1.12.28) - Validate registered services tags against implemented interface (https://github.com/phpstan/phpstan-src/commit/f375a814c453ee4220322e238d5d1ace59810f45) - Only change exit code with `--fail-without-result-cache` when the error formatter returns 0 (https://github.com/phpstan/phpstan-src/commit/df9fa6e04b636bbcd16d49ec213f13fbb45026a6) - Normalize arguments before calling into TypeSpecifyingExtensions ([#&#8203;4034](https://github.com/phpstan/phpstan-src/pull/4034)), [#&#8203;13088](https://github.com/phpstan/phpstan/issues/13088), thanks [@&#8203;staabm](https://github.com/staabm)! - Use `count()` return type in `ObjectType::getArraySize()` ([#&#8203;4072](https://github.com/phpstan/phpstan-src/pull/4072), [#&#8203;4078](https://github.com/phpstan/phpstan-src/pull/4078)), thanks [@&#8203;vojtech-dobes](https://github.com/vojtech-dobes)! - Add method to get ObjectType from ClassReflection and EnumCaseReflection ([#&#8203;4099](https://github.com/phpstan/phpstan-src/pull/4099)), thanks [@&#8203;calebdw](https://github.com/calebdw)! - Playground & Issue bot: PhpdocCommentRule ([#&#8203;4074](https://github.com/phpstan/phpstan-src/pull/4074)), thanks [@&#8203;staabm](https://github.com/staabm)! - Describe array shape key in quotes unless valid identifier ([#&#8203;4071](https://github.com/phpstan/phpstan-src/pull/4071)), thanks [@&#8203;vojtech-dobes](https://github.com/vojtech-dobes)! - Improve TrimDynamicReturnType for constant strings ([#&#8203;4028](https://github.com/phpstan/phpstan-src/pull/4028)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Introduce ArrayPadDynamicReturnTypeExtension ([#&#8203;4017](https://github.com/phpstan/phpstan-src/pull/4017)), [#&#8203;12305](https://github.com/phpstan/phpstan/issues/12305), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Introduce `PDO::connect` dynamic method return type extension ([#&#8203;4015](https://github.com/phpstan/phpstan-src/pull/4015)), [#&#8203;12359](https://github.com/phpstan/phpstan/issues/12359), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Add `PhpVersion::__construct` to BC promise ([#&#8203;4022](https://github.com/phpstan/phpstan-src/pull/4022)), [#&#8203;8582](https://github.com/phpstan/phpstan/issues/8582), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Support `switch` on `::class` ([#&#8203;4011](https://github.com/phpstan/phpstan-src/pull/4011)), [#&#8203;13069](https://github.com/phpstan/phpstan/issues/13069), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - More precise `array_keys` return type ([#&#8203;3590](https://github.com/phpstan/phpstan-src/pull/3590)), [#&#8203;11928](https://github.com/phpstan/phpstan/issues/11928), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix `ClosureType::equals()` for pure/impure closures (https://github.com/phpstan/phpstan-src/commit/02066c7350e4a60a5cdcabacc613bd62ae0bf907), [#&#8203;13067](https://github.com/phpstan/phpstan/issues/13067) - Fix for benevolent union ([#&#8203;4039](https://github.com/phpstan/phpstan-src/pull/4039)), [#&#8203;13098](https://github.com/phpstan/phpstan/issues/13098), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix resolving generics from phpstorm-stubs (https://github.com/phpstan/phpstan-src/commit/c0f2e9e9235db973784d88b107bc8c14ecb647d0), [#&#8203;13171](https://github.com/phpstan/phpstan/issues/13171) - Correctly retrieve hasSideEffects metadata for inherited methods ([#&#8203;4079](https://github.com/phpstan/phpstan-src/pull/4079)), [#&#8203;13201](https://github.com/phpstan/phpstan/issues/13201), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - ObjectType: fix hasConstant behaviour ([#&#8203;4089](https://github.com/phpstan/phpstan-src/pull/4089)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Explicitly use StreamSelectLoop for PHPStan Pro download ([#&#8203;4077](https://github.com/phpstan/phpstan-src/pull/4077)), thanks [@&#8203;calebdw](https://github.com/calebdw)! - stream_get_contents() does not return FALSE unless an invalid position is provided ([#&#8203;4092](https://github.com/phpstan/phpstan-src/pull/4092)), [#&#8203;3396](https://github.com/phpstan/phpstan/issues/3396), thanks [@&#8203;staabm](https://github.com/staabm)! - Revert "non-falsy-string cannot be converted to 0" ([#&#8203;3997](https://github.com/phpstan/phpstan-src/pull/3997)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve return type of array map by invoking dynamic function return type extensions for the callback ([#&#8203;4068](https://github.com/phpstan/phpstan-src/pull/4068)), [#&#8203;11180](https://github.com/phpstan/phpstan/issues/11180), [#&#8203;3156](https://github.com/phpstan/phpstan/issues/3156), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Avoid false positive `in_array()` always true ([#&#8203;4073](https://github.com/phpstan/phpstan-src/pull/4073)), [#&#8203;13151](https://github.com/phpstan/phpstan/issues/13151), [#&#8203;8818](https://github.com/phpstan/phpstan/issues/8818), [#&#8203;12755](https://github.com/phpstan/phpstan/issues/12755), [#&#8203;12412](https://github.com/phpstan/phpstan/issues/12412), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix always-true detection in in_array with union type haystack ([#&#8203;3888](https://github.com/phpstan/phpstan-src/pull/3888)), [#&#8203;12755](https://github.com/phpstan/phpstan/issues/12755), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! - Fix NAN inferences ([#&#8203;4040](https://github.com/phpstan/phpstan-src/pull/4040)), [#&#8203;13097](https://github.com/phpstan/phpstan/issues/13097), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `MixedType->equals(ErrorType)` ([#&#8203;3934](https://github.com/phpstan/phpstan-src/pull/3934)), thanks [@&#8203;staabm](https://github.com/staabm)! - Handle class without namespace for internal rule ([#&#8203;3998](https://github.com/phpstan/phpstan-src/pull/3998)), [#&#8203;13041](https://github.com/phpstan/phpstan/issues/13041), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Resolve substr based on configured PHP version instead of runtime PHP version ([#&#8203;4061](https://github.com/phpstan/phpstan-src/pull/4061)), [#&#8203;13129](https://github.com/phpstan/phpstan/issues/13129), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Keep list on `unset()` with nested dim fetch ([#&#8203;3964](https://github.com/phpstan/phpstan-src/pull/3964)), [#&#8203;12927](https://github.com/phpstan/phpstan/issues/12927), [#&#8203;12330](https://github.com/phpstan/phpstan/issues/12330), [#&#8203;11171](https://github.com/phpstan/phpstan/issues/11171), [#&#8203;8282](https://github.com/phpstan/phpstan/issues/8282), [#&#8203;12754](https://github.com/phpstan/phpstan/issues/12754), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - These DateTimeInterface methods are pure (https://github.com/phpstan/phpstan-src/commit/7534ee1a3755ac6c1a9f563159dbc9a0756993f5) - More precise return type for `posix_getpwnam()` ([#&#8203;4091](https://github.com/phpstan/phpstan-src/pull/4091)), [#&#8203;12254](https://github.com/phpstan/phpstan/issues/12254), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Fix `SimpleXMLElement::xpath` return type ([#&#8203;4096](https://github.com/phpstan/phpstan-src/pull/4096)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix fwrite ([#&#8203;4087](https://github.com/phpstan/phpstan-src/pull/4087)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update `locale_get_display_x()` return types ([#&#8203;4085](https://github.com/phpstan/phpstan-src/pull/4085)), thanks [@&#8203;cfahner](https://github.com/cfahner)! - Fix `DOMElement::$attributes` stub ([#&#8203;4029](https://github.com/phpstan/phpstan-src/pull/4029)), [#&#8203;13076](https://github.com/phpstan/phpstan/issues/13076), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve mb detect encoding signature ([#&#8203;4020](https://github.com/phpstan/phpstan-src/pull/4020)), [#&#8203;8922](https://github.com/phpstan/phpstan/issues/8922), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Moved the list of relative paths in parameters to `parametersSchema.neon` (https://github.com/phpstan/phpstan-src/commit/72c2a8da27960198a00c40075649d71a6a4fdebb) - This now allows extensions to declare which of their custom parameters should be treated as relative path to expand - Scaffolding for auto-fixable rules - This feature will be fully released in PHPStan 2.2.0 - **phpstan-src embraces attributes!** - This is enabled thanks to [olvlvl/composer-attribute-collector](https://github.com/olvlvl/composer-attribute-collector) and [AutowiredAttributeServicesExtension](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/AutowiredAttributeServicesExtension.php) - PHPStan still supports PHP 7.4 because this package bakes compiled list of classes and parameters with attributes to a plain PHP file `vendor/attributes.php`. - Slimmer [config files](https://github.com/phpstan/phpstan-src/tree/2.1.x/conf) - Services are now registered with the help of these attributes: - [`AutowiredService`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/AutowiredService.php) - [`AutowiredParameter`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/AutowiredParameter.php) - [`NonAutowiredService`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/NonAutowiredService.php) - [`GenerateFactory`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/GenerateFactory.php) - Rules and collectors for specific levels are registered with: - [`RegisteredRule`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/RegisteredRule.php) - [`RegisteredCollector`](https://github.com/phpstan/phpstan-src/blob/2.1.x/src/DependencyInjection/RegisteredCollector.php) - phpstan-src now includes more **custom opinionated rules** specific to development of PHPStan itself - Attributes must have named arguments (https://github.com/phpstan/phpstan-src/commit/676ad27fc14abf18ebd026c0247b61ad9d568d92) - Use named arguments instead of passing default parameter values https://github.com/phpstan/phpstan-src/commit/35fbc87a4b05a2f4884480a3e0f5dbd61a8b49a5 - As a limitation of simple-downgrader, this does not apply to MethodCall. Only to New\_, StaticCall, and FuncCall. - Add `#[Override]` for methods overriding 3rd party (https://github.com/phpstan/phpstan-src/commit/98ed73222bb3a69e58f5633074041a65256673b6) - SkipTestsWithRequiresPhpAttributeRule (https://github.com/phpstan/phpstan-src/pull/4056/commits/6851343e570bc1e79580972243deed80b3bc5e39) - Simplify property memoization for Flyweight pattern by replacing it with `??=` ([#&#8203;4084](https://github.com/phpstan/phpstan-src/pull/4084)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Simplify by replacing chained `$var === const` with `in_array()` ([#&#8203;4098](https://github.com/phpstan/phpstan-src/pull/4098)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - DI Container - throw unprefixed exception (https://github.com/phpstan/phpstan-src/commit/24436631a3c69deb8d914dc01cb6486cc85d5680) - Require Box with Composer ([#&#8203;2955](https://github.com/phpstan/phpstan-src/pull/2955)) - Use 7.4 for PHP-Scoper PHP version ([#&#8203;2955](https://github.com/phpstan/phpstan-src/pull/2955)), thanks [@&#8203;ondrejmirtes](https://github.com/ondrejmirtes)! - Update to PHPUnit 10 (([#&#8203;4046](https://github.com/phpstan/phpstan-src/pull/4046))) - Update to PHPUnit 11 ([#&#8203;4057](https://github.com/phpstan/phpstan-src/pull/4057)) - Upgrade bashunit:0.20 ([#&#8203;4048](https://github.com/phpstan/phpstan-src/pull/4048)), thanks [@&#8203;Chemaclass](https://github.com/Chemaclass)! - Add `assertSuperType` testing utility ([#&#8203;4066](https://github.com/phpstan/phpstan-src/pull/4066)), thanks [@&#8203;vojtech-dobes](https://github.com/vojtech-dobes)! - Use str_starts_with() instead of strpos() ([#&#8203;4083](https://github.com/phpstan/phpstan-src/pull/4083)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Avoid duplicating the same strpos() function call ([#&#8203;4083](https://github.com/phpstan/phpstan-src/pull/4083)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Add `Type::spliceArray()`, improve `splice_array()` array type narrowing ([#&#8203;3952](https://github.com/phpstan/phpstan-src/pull/3952)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v2.1.17`](https://github.com/phpstan/phpstan/releases/tag/2.1.17) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.16...2.1.17) # Major new features 🚀 - Introducing **Editor Mode** (https://github.com/phpstan/phpstan-src/commit/74b909aedcc6fd09721c02763ff2c440ce5d7999) - Learn more: https://phpstan.org/user-guide/editor-mode # Bleeding edge 🔪 - Report `new static()` in static method of abstract class - level 0 (https://github.com/phpstan/phpstan-src/commit/a5f7c060c8a091da391263decdef8025a3202d82) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - This release includes improvements and bugfixes from [PHPStan 1.12.27](https://github.com/phpstan/phpstan/releases/tag/1.12.27) # Bugfixes 🐛 - Fix `array_column()` with explicit null `$index_key` ([#&#8203;3970](https://github.com/phpstan/phpstan-src/pull/3970)), [#&#8203;12945](https://github.com/phpstan/phpstan/issues/12945), thanks [@&#8203;herndlm](https://github.com/herndlm)! - AlwaysRememberedExpr - use `getNativeExprType` (https://github.com/phpstan/phpstan-src/commit/222676e94aeb92e1b73e7545db6c0d68e003b77e) - Invalidate result cache properly when property hook changes (https://github.com/phpstan/phpstan-src/commit/dff492e14c586368429893111ec4c950b4bd1748, https://github.com/phpstan/phpstan-src/commit/268d7c6388eaeef1675ef8eb807975bc42a4dc1a) - Result cache - react to property having abstract/final/asymmetric visibility changed (https://github.com/phpstan/phpstan-src/commit/0ad2a6a6f207fa3a57ab0dd98c30459666dd152f) - Result cache - react to property being virtual changing (https://github.com/phpstan/phpstan-src/commit/e33a560c71a7f1a52ae5f96158393ef441626aa5) # Function signature fixes 🤖 - Update `libxml_get_errors()` ([#&#8203;3973](https://github.com/phpstan/phpstan-src/pull/3973)), thanks [@&#8203;jack-worman](https://github.com/jack-worman)! # Internals 🔍 - Call `ProcessPromise::cancel()` from deferred canceller (https://github.com/phpstan/phpstan-src/commit/df4c1f39e9b63c2e58e7666c664f7c8ac2d74f26) - Solve some cases of dead code (https://github.com/phpstan/phpstan-src/commit/e1e8302327e791ce191f25a0b37f21d30e1cf7d6) - Remove dead code (https://github.com/phpstan/phpstan-src/commit/d88e2fece595ca5190c1cf507f7b983bdd4695f8) - Remove unused method from interface (https://github.com/phpstan/phpstan-src/commit/2ac0a171e66601ea3c1d80f7e4195a0f420d929c) - Remove unused method from PathNotFoundException (https://github.com/phpstan/phpstan-src/commit/aaa1424c0f90fffc425c397219b26104a99e9231) - Remove `getPhpDocReturnTypeWithUnresolvableTemplateTypes` from `ResolvedFunctionVariantWithCallable` (https://github.com/phpstan/phpstan-src/commit/e3c76ade59ac2753d9ff073a7260d228bc424c50) - Remove more dead code (https://github.com/phpstan/phpstan-src/commit/2f66ec60f9d2a9ff9d8a87a914f31dd121a9ed18) - Install & configure shipmonk/dead-code-detector ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused SymfonyStyle::getSymfonyStyle ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused NeonAdapter::dump ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused FileMonitor::getTotalFilesCount ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused SetterReflectionProviderProvider ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop dead dataProvider in ExistingClassesInTypehintsRuleTest ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused ResolvedPropertyReflection::getDeclaringTrait ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused ProcessPromise::getName ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop unused PhpDocBlock::isExplicit ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Drop dead TemplateTypeTrait::shouldGeneralizeInferredType (overwritten in all children) ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - SimultaneousTypeTraverser to be covered by BC promise ([#&#8203;3996](https://github.com/phpstan/phpstan-src/pull/3996)), thanks [@&#8203;janedbal](https://github.com/janedbal)! ### [`v2.1.16`](https://github.com/phpstan/phpstan/releases/tag/2.1.16) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.15...2.1.16) # Improvements 🔧 - Support for `@final` PHPDoc tag above properties ([#&#8203;3990](https://github.com/phpstan/phpstan-src/pull/3990)), [#&#8203;12999](https://github.com/phpstan/phpstan/issues/12999), thanks [@&#8203;lpd-au](https://github.com/lpd-au)! - Faster ClassNameHelper ([#&#8203;3994](https://github.com/phpstan/phpstan-src/pull/3994)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - DuplicateKeysInLiteralArraysRule: Fixed union type handling ([#&#8203;3993](https://github.com/phpstan/phpstan-src/pull/3993)), [#&#8203;13013](https://github.com/phpstan/phpstan/issues/13013), [#&#8203;13022](https://github.com/phpstan/phpstan/issues/13022), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `preg_split()` function return type ([#&#8203;3757](https://github.com/phpstan/phpstan-src/pull/3757)), thanks [@&#8203;malsuke](https://github.com/malsuke)! # Function signature fixes 🤖 - Update SNMP class signatures ([#&#8203;3927](https://github.com/phpstan/phpstan-src/pull/3927)), thanks [@&#8203;miken32](https://github.com/miken32)! ### [`v2.1.15`](https://github.com/phpstan/phpstan/releases/tag/2.1.15) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.14...2.1.15) # Improvements 🔧 - This release includes improvements and bugfixes from [PHPStan 1.12.26](https://github.com/phpstan/phpstan/releases/tag/1.12.26) - TableErrorFormatter: improve formatting of error tips ([#&#8203;3821](https://github.com/phpstan/phpstan-src/pull/3821)), thanks [@&#8203;FeBe95](https://github.com/FeBe95)! - InstantiationRule - call RestrictedMethodUsageExtension for constructor (https://github.com/phpstan/phpstan-src/commit/8edfa9fa880141f97239229bbdefb54168cc2b78) - Call RestrictedMethodUsageExtension for `__toString` methods in `(string)` cast (https://github.com/phpstan/phpstan-src/commit/ce257d9acf2e182b2ae1c6fea06f7738986e54ab) # Bugfixes 🐛 - Fix GetDebugTypeFunctionReturnTypeExtension - should use TypeCombinator instead of `new UnionType` (https://github.com/phpstan/phpstan-src/commit/1044f1112a0be3e4e6384ee7d35a66cd92e9cba6), [#&#8203;12512](https://github.com/phpstan/phpstan/issues/12512) - Remember value of arguments passed to `{min,max}()` ([#&#8203;3928](https://github.com/phpstan/phpstan-src/pull/3928)), [#&#8203;12731](https://github.com/phpstan/phpstan/issues/12731), thanks [@&#8203;cs278](https://github.com/cs278)! - Revert "Useful PhpMethodReflection native type refactoring from [#&#8203;3966](https://github.com/phpstan/phpstan-src/pull/3966)" ([#&#8203;3979](https://github.com/phpstan/phpstan-src/pull/3979)), thanks [@&#8203;samsonasik](https://github.com/samsonasik)! - Respect asserts and throws on pure functions that return void ([#&#8203;3719](https://github.com/phpstan/phpstan-src/pull/3719)), [#&#8203;12224](https://github.com/phpstan/phpstan/issues/12224), thanks [@&#8203;jack-worman](https://github.com/jack-worman)! - Disable purity check for non-final methods ([#&#8203;3913](https://github.com/phpstan/phpstan-src/pull/3913)), [#&#8203;12382](https://github.com/phpstan/phpstan/issues/12382), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `IterableType::equals()` with `TemplateIterableType` ([#&#8203;3991](https://github.com/phpstan/phpstan-src/pull/3991)), thanks [@&#8203;staabm](https://github.com/staabm)! - Restricted usage extensions - do not report false positives for Symfony polyfills (https://github.com/phpstan/phpstan-src/commit/4a907f16f034d42f5246a0fd72225f0fba0fcb0c), [#&#8203;12951](https://github.com/phpstan/phpstan/issues/12951) # Function signature fixes 🤖 - Add stub for `DOMNode::hasAttributes` ([#&#8203;3800](https://github.com/phpstan/phpstan-src/pull/3800)), thanks [@&#8203;Niklan](https://github.com/Niklan)! - Update PhpStorm stubs ([#&#8203;3989](https://github.com/phpstan/phpstan-src/pull/3989)), thanks [@&#8203;phpstan-bot](https://github.com/phpstan-bot)! - Remove MongoDB extension from function map ([#&#8203;3891](https://github.com/phpstan/phpstan-src/pull/3891)), thanks [@&#8203;alcaeus](https://github.com/alcaeus)! # Internals 🔍 - Replace error-prone `instanceof *Type` in Rules classes ([#&#8203;3858](https://github.com/phpstan/phpstan-src/pull/3858)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Extract ArrayColumnHelper from ArrayColumnFunctionReturnTypeExtension ([#&#8203;3785](https://github.com/phpstan/phpstan-src/pull/3785)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.1.14`](https://github.com/phpstan/phpstan/releases/tag/2.1.14) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.13...2.1.14) # Bugfixes 🐛 - More precise property types after assignment when `strict_types=0` ([#&#8203;3965](https://github.com/phpstan/phpstan-src/pull/3965)), [#&#8203;12946](https://github.com/phpstan/phpstan/issues/12946), [#&#8203;12940](https://github.com/phpstan/phpstan/issues/12940), [#&#8203;12950](https://github.com/phpstan/phpstan/issues/12950), [#&#8203;12947](https://github.com/phpstan/phpstan/issues/12947), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `array_slice()` edge cases ([#&#8203;3959](https://github.com/phpstan/phpstan-src/pull/3959)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `non-falsy-string` cannot be converted to `0` ([#&#8203;3971](https://github.com/phpstan/phpstan-src/pull/3971)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix crash on dynamic numeric-string symbols ([#&#8203;3975](https://github.com/phpstan/phpstan-src/pull/3975)), [#&#8203;12949](https://github.com/phpstan/phpstan/issues/12949), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Remove useless assign `$parentNode = $parentNode` ([#&#8203;3938](https://github.com/phpstan/phpstan-src/pull/3938)), thanks [@&#8203;samsonasik](https://github.com/samsonasik)! - TypehintHelper: remove unneeded default param value ([#&#8203;3968](https://github.com/phpstan/phpstan-src/pull/3968)), thanks [@&#8203;staabm](https://github.com/staabm)! - Useful PhpMethodReflection native type refactoring from [#&#8203;3966](https://github.com/phpstan/phpstan-src/pull/3966) (https://github.com/phpstan/phpstan-src/commit/3854cbc5748a7cb51ee0b86ceffe29bd0564bc98) ### [`v2.1.13`](https://github.com/phpstan/phpstan/releases/tag/2.1.13) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.12...2.1.13) # Major new features 🚀 - **Restricted Usage Extensions** - Learn more: https://phpstan.org/blog/restricted-usage-extensions-you-dont-always-need-custom-rule - Docs: https://phpstan.org/developing-extensions/restricted-usage-extensions # Bleeding edge 🔪 - Report `@internal` symbols usage from outside their top namespace, [#&#8203;1178](https://github.com/phpstan/phpstan/issues/1178) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Improve return type of `array_splice()` ([#&#8203;3947](https://github.com/phpstan/phpstan-src/pull/3947)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Handle preserve_keys in `array_slice()` for normal arrays ([#&#8203;3946](https://github.com/phpstan/phpstan-src/pull/3946)), [#&#8203;12880](https://github.com/phpstan/phpstan/issues/12880), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve `ConstantArrayType::sliceArray()` with non constant integer args ([#&#8203;3949](https://github.com/phpstan/phpstan-src/pull/3949)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - TableErrorFormatter: visually differentiate phpstan assertion errors from rule errors ([#&#8203;3951](https://github.com/phpstan/phpstan-src/pull/3951)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Consider comparison as strict when type is the same ([#&#8203;3942](https://github.com/phpstan/phpstan-src/pull/3942)), [#&#8203;12884](https://github.com/phpstan/phpstan/issues/12884), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix wrong property type after assigning iterable type (https://github.com/phpstan/phpstan-src/commit/7c1ee34aa09798c2bb5ba182b078e436f0b7820c), [#&#8203;12891](https://github.com/phpstan/phpstan/issues/12891) - `Scope::rememberConstructorScope()` should not remember the function scope ([#&#8203;3944](https://github.com/phpstan/phpstan-src/pull/3944)), https://github.com/spaze/phpstan-disallowed-calls/issues/323, thanks [@&#8203;staabm](https://github.com/staabm)! - Fix imprecise property native types after assignment ([#&#8203;3945](https://github.com/phpstan/phpstan-src/pull/3945)), [#&#8203;12902](https://github.com/phpstan/phpstan/issues/12902), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix invalidating static property access after impure call ([#&#8203;3950](https://github.com/phpstan/phpstan-src/pull/3950)), [#&#8203;11019](https://github.com/phpstan/phpstan/issues/11019), [#&#8203;3747](https://github.com/phpstan/phpstan/issues/3747), [#&#8203;8523](https://github.com/phpstan/phpstan/issues/8523), [#&#8203;4864](https://github.com/phpstan/phpstan/issues/4864), [#&#8203;4443](https://github.com/phpstan/phpstan/issues/4443), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise string functions return type with replacement array ([#&#8203;3963](https://github.com/phpstan/phpstan-src/pull/3963)), [#&#8203;12928](https://github.com/phpstan/phpstan/issues/12928), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `session_set_cookie_params` call with named arguments (https://github.com/phpstan/phpstan-src/commit/72e37dcf297752e074b214bd752f24617b7e6bb3), [#&#8203;12934](https://github.com/phpstan/phpstan/issues/12934) # Internals 🔍 - MutatingScope: remove unnecessary callback functions ([#&#8203;3916](https://github.com/phpstan/phpstan-src/pull/3916)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix occasional failure in ParallelAnalyserIntegrationTest (https://github.com/phpstan/phpstan-src/commit/4f5a63a5f577dbf9fecca53e8d6ea4ac64542f7a) - MethodReflection - fix isInternal vs. isBuiltin (https://github.com/phpstan/phpstan-src/commit/3024c02e844d430759ac950261ba5c5aea52eb1b) - Simplify degradation to general array in `ConstantArrayType::shuffle()` ([#&#8203;3948](https://github.com/phpstan/phpstan-src/pull/3948)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `ExtendedPropertyReflection::getName()` (https://github.com/phpstan/phpstan-src/commit/ff198c9d121d658c150ce74f11bde000d665117d) - Micro optimize LazyInternalScopeFactory ([#&#8203;3962](https://github.com/phpstan/phpstan-src/pull/3962)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.1.12`](https://github.com/phpstan/phpstan/releases/tag/2.1.12) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.11...2.1.12) # Improvements 🔧 - Remember narrowed types from the constructor when analysing other methods ([#&#8203;3930](https://github.com/phpstan/phpstan-src/pull/3930)), [#&#8203;12860](https://github.com/phpstan/phpstan/issues/12860), [#&#8203;10048](https://github.com/phpstan/phpstan/issues/10048), [#&#8203;11828](https://github.com/phpstan/phpstan/issues/11828), [#&#8203;9075](https://github.com/phpstan/phpstan/issues/9075), [#&#8203;6063](https://github.com/phpstan/phpstan/issues/6063), [#&#8203;12723](https://github.com/phpstan/phpstan/issues/12723), thanks [@&#8203;staabm](https://github.com/staabm)! - DeprecationExtensions: allow custom deprecation-marking logic ([#&#8203;3932](https://github.com/phpstan/phpstan-src/pull/3932)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Learn more: https://phpstan.org/developing-extensions/custom-deprecations - TypeInferenceTestCase - show analysed symbols that do not exist next to failure (misconfigured autoloading) (https://github.com/phpstan/phpstan-src/commit/fdd5ad933d2264be29812eb713d0f15519d5cb3f, https://github.com/phpstan/phpstan-src/commit/a2834bcc6894f8d0dce299507735473cfa1f8f54) - RuleTestCase - show analysed symbols that do not exist next to failure (misconfigured autoloading) (https://github.com/phpstan/phpstan-src/commit/c5cf14ba60139fb40a1e26973a115778a9e82815, https://github.com/phpstan/phpstan-src/commit/a2834bcc6894f8d0dce299507735473cfa1f8f54) - Allow toggling `discoveringSymbols` tip ([#&#8203;3929](https://github.com/phpstan/phpstan-src/pull/3929)), https://github.com/phpstan/phpstan/discussions/12859, thanks [@&#8203;herndlm](https://github.com/herndlm)! - Faster processing of array comparisons with constant offsets ([#&#8203;3933](https://github.com/phpstan/phpstan-src/pull/3933)), [#&#8203;12800](https://github.com/phpstan/phpstan/issues/12800), thanks [@&#8203;staabm](https://github.com/staabm)! - ClassReflection: narrow getNativeReflection after isEnum is true ([#&#8203;3925](https://github.com/phpstan/phpstan-src/pull/3925)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - ResultCacheManager: support dots in parametersNotInvalidatingCache ([#&#8203;3939](https://github.com/phpstan/phpstan-src/pull/3939)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - ResultCacheManager: configurable days causing cache skip ([#&#8203;3941](https://github.com/phpstan/phpstan-src/pull/3941)), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.24](https://github.com/phpstan/phpstan/releases/tag/1.12.24) - RegexArrayShapeMatcher - enforce list type when no named captures ([#&#8203;3899](https://github.com/phpstan/phpstan-src/pull/3899)), [#&#8203;12397](https://github.com/phpstan/phpstan/issues/12397), [#&#8203;11602](https://github.com/phpstan/phpstan/issues/11602), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix elapsed time format for result cache restore time ([#&#8203;3890](https://github.com/phpstan/phpstan-src/pull/3890)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Limit int ranges when narrowing arrays via `count()` ([#&#8203;3902](https://github.com/phpstan/phpstan-src/pull/3902)), [#&#8203;12787](https://github.com/phpstan/phpstan/issues/12787), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fixed false positive about undefined property guarded with property_exists (https://github.com/phpstan/phpstan-src/commit/3d5293075344157864219e5833bbfa69d60ec7be) - Fixed false positive about undefined method guarded with method_exists (https://github.com/phpstan/phpstan-src/commit/ae5562fc29737d3f4a724bdd351c23f1347d569d), [#&#8203;12793](https://github.com/phpstan/phpstan/issues/12793) - Offset on list definitely exists if there's HasOffsetType with higher number ([#&#8203;3905](https://github.com/phpstan/phpstan-src/pull/3905)), [#&#8203;12605](https://github.com/phpstan/phpstan/issues/12605), thanks [@&#8203;staabm](https://github.com/staabm)! - Set offset on list keeps list if there's HasOffsetType for all preceeding offsets ([#&#8203;3909](https://github.com/phpstan/phpstan-src/pull/3909)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix union/intersect involving enum case ([#&#8203;3907](https://github.com/phpstan/phpstan-src/pull/3907)), [#&#8203;12163](https://github.com/phpstan/phpstan/issues/12163), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix lost list type if substituted a element via loop ([#&#8203;3908](https://github.com/phpstan/phpstan-src/pull/3908)), [#&#8203;12274](https://github.com/phpstan/phpstan/issues/12274), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix signature type for default-null parameters ([#&#8203;3912](https://github.com/phpstan/phpstan-src/pull/3912)), [#&#8203;7522](https://github.com/phpstan/phpstan/issues/7522), [#&#8203;12282](https://github.com/phpstan/phpstan/issues/12282), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - ObjectType: fix isEnum ([#&#8203;3915](https://github.com/phpstan/phpstan-src/pull/3915)), [#&#8203;12832](https://github.com/phpstan/phpstan/issues/12832), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Fix `matches[0]` type for regexes containing `\K` ([#&#8203;3920](https://github.com/phpstan/phpstan-src/pull/3920)), [#&#8203;12792](https://github.com/phpstan/phpstan/issues/12792), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - TypeCombinator returns `non-empty-array` for union of `isIterableAtLeastOnce()->yes()` ([#&#8203;3937](https://github.com/phpstan/phpstan-src/pull/3937)), [#&#8203;12847](https://github.com/phpstan/phpstan/issues/12847), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - More precise return type for strspn and strcspn ([#&#8203;3918](https://github.com/phpstan/phpstan-src/pull/3918)), thanks [@&#8203;claudepache](https://github.com/claudepache)! - Improve `getopt()` function stub ([#&#8203;3655](https://github.com/phpstan/phpstan-src/pull/3655)), [#&#8203;12103](https://github.com/phpstan/phpstan/issues/12103), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Internals 🔍 - Added regression test ([#&#8203;3904](https://github.com/phpstan/phpstan-src/pull/3904)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.1.11`](https://github.com/phpstan/phpstan/releases/tag/2.1.11) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.10...2.1.11) # Improvements 🔧 - RegexArrayShapeMatcher - more precise subject types ([#&#8203;3897](https://github.com/phpstan/phpstan-src/pull/3897)), [#&#8203;12749](https://github.com/phpstan/phpstan/issues/12749), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix narrowing of superglobals ([#&#8203;3901](https://github.com/phpstan/phpstan-src/pull/3901)), [#&#8203;12771](https://github.com/phpstan/phpstan/issues/12771), [#&#8203;12772](https://github.com/phpstan/phpstan/issues/12772), [#&#8203;12776](https://github.com/phpstan/phpstan/issues/12776), thanks [@&#8203;herndlm](https://github.com/herndlm)! - String value passed to Identifier cannot be empty (https://github.com/phpstan/phpstan-src/commit/a3039ef58efe8b303e9618272e50dfe85e74ff53), [#&#8203;12778](https://github.com/phpstan/phpstan/issues/12778) # Function signature fixes 🤖 - Fix `SessionHandlerInterface::read` return type ([#&#8203;3884](https://github.com/phpstan/phpstan-src/pull/3884)), [#&#8203;12748](https://github.com/phpstan/phpstan/issues/12748), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! ### [`v2.1.10`](https://github.com/phpstan/phpstan/releases/tag/2.1.10) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.9...2.1.10) # Bugfixes 🐛 - Fix condition of fall-through case not used for exhaustive checks ([#&#8203;3900](https://github.com/phpstan/phpstan-src/pull/3900)), [#&#8203;11064](https://github.com/phpstan/phpstan/issues/11064), [#&#8203;3488](https://github.com/phpstan/phpstan/issues/3488), [#&#8203;8719](https://github.com/phpstan/phpstan/issues/8719), [#&#8203;12722](https://github.com/phpstan/phpstan/issues/12722), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix calling getVariableType without checking hasVariableType first (https://github.com/phpstan/phpstan-src/commit/72d2f3b5b10faf9f388ad68b8271ece94bb53bc5), [#&#8203;12767](https://github.com/phpstan/phpstan/issues/12767) ### [`v2.1.9`](https://github.com/phpstan/phpstan/releases/tag/2.1.9) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.8...2.1.9) # Improvements 🔧 - This release includes fixes and improvements from [PHPStan 1.12.22](https://github.com/phpstan/phpstan/releases/tag/1.12.22) - Collected data: reduce memory consumption & result cache size ([#&#8203;3879](https://github.com/phpstan/phpstan-src/pull/3879)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Detect accessing static property as non static ([#&#8203;3857](https://github.com/phpstan/phpstan-src/pull/3857)), [#&#8203;12692](https://github.com/phpstan/phpstan/issues/12692), thanks [@&#8203;jnoordsij](https://github.com/jnoordsij)! - Infer types of variables with dynamic name (https://github.com/phpstan/phpstan-src/commit/7d4dcb5e48ef063cef058655a61e160ca6725541, https://github.com/phpstan/phpstan-src/commit/0df0c6f34b38e75daf5bfb53d1fe088c78d30b97), [#&#8203;12398](https://github.com/phpstan/phpstan/issues/12398) - Infer types of property fetch with dynamic name (https://github.com/phpstan/phpstan-src/commit/8bb0670cffd471f2f1dfc39cc002cbaf2bbbfeb2) - Infer types of StaticCall with dynamic name (https://github.com/phpstan/phpstan-src/commit/51a867f439b55960de460223af0e3b125414fc5c) - Infer types of MethodCall with dynamic name (https://github.com/phpstan/phpstan-src/commit/244093e4f43a58a6dcbb596ea2eac1e042016ac1) - Infer types of StaticPropertyFetch with a dynamic name (https://github.com/phpstan/phpstan-src/commit/2fe4e0f94e75fe8844a21fdb81799f01f0591dfe) - Support dynamic Expr name expressions in rules ([#&#8203;3886](https://github.com/phpstan/phpstan-src/pull/3886)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Improve `count()` narrowing of constant arrays ([#&#8203;3709](https://github.com/phpstan/phpstan-src/pull/3709)), [#&#8203;12190](https://github.com/phpstan/phpstan/issues/12190), [#&#8203;3631](https://github.com/phpstan/phpstan/issues/3631), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Support narrowing a constant array to a list with count ([#&#8203;3878](https://github.com/phpstan/phpstan-src/pull/3878)), thanks [@&#8203;staabm](https://github.com/staabm)! - Treat `#[Pure(true)]` in PhpStorm stubs as `hasSideEffects => true` ([#&#8203;3880](https://github.com/phpstan/phpstan-src/pull/3880)), [#&#8203;6345](https://github.com/phpstan/phpstan/issues/6345), [#&#8203;12577](https://github.com/phpstan/phpstan/issues/12577), [#&#8203;10342](https://github.com/phpstan/phpstan/issues/10342), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - excludePaths: include example for optional path ([#&#8203;3883](https://github.com/phpstan/phpstan-src/pull/3883)), thanks [@&#8203;thePanz](https://github.com/thePanz)! - Narrow type on setting offsets of properties ([#&#8203;3699](https://github.com/phpstan/phpstan-src/pull/3699)), [#&#8203;6398](https://github.com/phpstan/phpstan/issues/6398), [#&#8203;6571](https://github.com/phpstan/phpstan/issues/6571), [#&#8203;12565](https://github.com/phpstan/phpstan/issues/12565), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Fix false positives on non-existing array offsets ([#&#8203;3766](https://github.com/phpstan/phpstan-src/pull/3766)), [#&#8203;8649](https://github.com/phpstan/phpstan/issues/8649), thanks [@&#8203;staabm](https://github.com/staabm)! - Also: [#&#8203;3868](https://github.com/phpstan/phpstan-src/pull/3868), [#&#8203;11020](https://github.com/phpstan/phpstan/issues/11020), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix false positives on existing offsets after assign ([#&#8203;3874](https://github.com/phpstan/phpstan-src/pull/3874)), [#&#8203;12406](https://github.com/phpstan/phpstan/issues/12406), [#&#8203;11679](https://github.com/phpstan/phpstan/issues/11679), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix false positives on non-existing offsets of superglobals ([#&#8203;3871](https://github.com/phpstan/phpstan-src/pull/3871)), [#&#8203;11447](https://github.com/phpstan/phpstan/issues/11447), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `count()` regression ([#&#8203;3895](https://github.com/phpstan/phpstan-src/pull/3895)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove `count()` narrowing handling of empty array ([#&#8203;3896](https://github.com/phpstan/phpstan-src/pull/3896)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Avoid falsely specifying never types via `count()` ([#&#8203;3898](https://github.com/phpstan/phpstan-src/pull/3898)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Constant array with negative keys cannot be a list ([#&#8203;3870](https://github.com/phpstan/phpstan-src/pull/3870)), [#&#8203;12708](https://github.com/phpstan/phpstan/issues/12708), thanks [@&#8203;watasuke102](https://github.com/watasuke102)! - Do not report constructor unused parameter if implemented interface has a constructor ([#&#8203;3777](https://github.com/phpstan/phpstan-src/pull/3777)), [#&#8203;11454](https://github.com/phpstan/phpstan/issues/11454), thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! - Fix JSON error formatter when files are empty ([#&#8203;3798](https://github.com/phpstan/phpstan-src/pull/3798)), thanks [@&#8203;shyim](https://github.com/shyim)! - Fix readonly property assign with ArrayAccess offset ([#&#8203;3817](https://github.com/phpstan/phpstan-src/pull/3817)), [#&#8203;8929](https://github.com/phpstan/phpstan/issues/8929), [#&#8203;12537](https://github.com/phpstan/phpstan/issues/12537), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Internals 🔍 - RuleTestCase: set `shouldPolluteScopeWithLoopInitialAssignments` to true which is PHPStan's default behaviour (https://github.com/phpstan/phpstan-src/commit/1b56b0c1e0fb7ad574d8d13e4ee63fb05716fa9c) - ResultCache: allow customization of params not invalidating cache ([#&#8203;3877](https://github.com/phpstan/phpstan-src/pull/3877)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - RegexArrayShapeMatcher - turn more details immutable ([#&#8203;3892](https://github.com/phpstan/phpstan-src/pull/3892)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.1.8`](https://github.com/phpstan/phpstan/releases/tag/2.1.8) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.7...2.1.8) # Improvements 🔧 - `@readonly` property cannot be passed by-ref ([#&#8203;3850](https://github.com/phpstan/phpstan-src/pull/3850)), [#&#8203;12676](https://github.com/phpstan/phpstan/issues/12676), thanks [@&#8203;staabm](https://github.com/staabm)! - ClassReflection - cannot be a subclass of final-overriden class (https://github.com/phpstan/phpstan-src/commit/ed4ea0a3b5784e3e39b28cff2fc92b6445a48419) - Deprecated `ClassReflection::isSubclassOf(string $className)` in favour of `ClassReflection::isSubclassOfClass(ClassReflection $class)` - If you just have `string $className` instead of `ClassReflection` and you are too lazy to get ClassReflection via ReflectionProvider, you can still use `ClassReflection::is(string $className)` # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.21](https://github.com/phpstan/phpstan/releases/tag/1.12.21) - Cannot override being final for abstract classes (https://github.com/phpstan/phpstan-src/commit/9bb2ed5b90d76d416a985eeb67411999be187263) - Fix unsetting array item triggering `unset.possiblyHookedProperty` ([#&#8203;3855](https://github.com/phpstan/phpstan-src/pull/3855)), [#&#8203;12695](https://github.com/phpstan/phpstan/issues/12695), thanks [@&#8203;staabm](https://github.com/staabm)! - UnusedPrivatePropertyRule - handle virtual properties that can only be read or only written (https://github.com/phpstan/phpstan-src/commit/da737711e4017bac54ce133e0c074d094daf1969, https://github.com/phpstan/phpstan-src/commit/12185abf062ea03e51dae9226b35a6639bee0cd5), [#&#8203;12702](https://github.com/phpstan/phpstan/issues/12702) - Faster analysis with a big const array in a class ([#&#8203;3862](https://github.com/phpstan/phpstan-src/pull/3862)), [#&#8203;12159](https://github.com/phpstan/phpstan/issues/12159), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Fix typo false-positive ([#&#8203;3856](https://github.com/phpstan/phpstan-src/pull/3856)), thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce method calls in ExpressionTypeHolder ([#&#8203;3859](https://github.com/phpstan/phpstan-src/pull/3859)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster `TrinaryLogic::and()` ([#&#8203;3860](https://github.com/phpstan/phpstan-src/pull/3860)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster `MutatingScope::mergeWith()` ([#&#8203;3861](https://github.com/phpstan/phpstan-src/pull/3861)), thanks [@&#8203;staabm](https://github.com/staabm)! - Added regression test ([#&#8203;3863](https://github.com/phpstan/phpstan-src/pull/3863)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.1.7`](https://github.com/phpstan/phpstan/releases/tag/2.1.7) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.6...2.1.7) # Improvements 🔧 - Introduce `IgnoreErrorExtension` ([#&#8203;3783](https://github.com/phpstan/phpstan-src/pull/3783)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Learn more: https://phpstan.org/developing-extensions/ignore-error-extensions - Understand that `new Foo()` cannot be a subclass ([#&#8203;3853](https://github.com/phpstan/phpstan-src/pull/3853)) - Object type narrowed after `$a::class` and `get_class($a)` cannot be a subclass (https://github.com/phpstan/phpstan-src/commit/772f2979425574897b525de95dd8a535e1882f39) - Teamcity - show rule identifier when verbose output is set ([#&#8203;3804](https://github.com/phpstan/phpstan-src/pull/3804)), thanks [@&#8203;kamil-zacek](https://github.com/kamil-zacek)! - Class constants cannot be directly accessed on a trait (https://github.com/phpstan/phpstan-src/commit/d56d0842ca297ad6cc4ac3cf3918433ed8a80394) - Hooked properties cannot be both final and private ([#&#8203;3830](https://github.com/phpstan/phpstan-src/pull/3830)), [#&#8203;12336](https://github.com/phpstan/phpstan/issues/12336), thanks [@&#8203;staabm](https://github.com/staabm)! - Hooked properties cannot be both abstract and private ([#&#8203;3839](https://github.com/phpstan/phpstan-src/pull/3839)), [#&#8203;12336](https://github.com/phpstan/phpstan/issues/12336), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement FinalPrivateConstantRule ([#&#8203;3838](https://github.com/phpstan/phpstan-src/pull/3838)), thanks [@&#8203;staabm](https://github.com/staabm)! - Readonly properties cannot be `unset()` ([#&#8203;3827](https://github.com/phpstan/phpstan-src/pull/3827)), [#&#8203;12421](https://github.com/phpstan/phpstan/issues/12421), thanks [@&#8203;staabm](https://github.com/staabm)! - Hooked properties cannot be `unset()` ([#&#8203;3842](https://github.com/phpstan/phpstan-src/pull/3842)), [#&#8203;12336](https://github.com/phpstan/phpstan/issues/12336), thanks [@&#8203;staabm](https://github.com/staabm)! - Handle BcMath\Number overloaded operators ([#&#8203;3787](https://github.com/phpstan/phpstan-src/pull/3787)), [#&#8203;12099](https://github.com/phpstan/phpstan/issues/12099), thanks [@&#8203;schlndh](https://github.com/schlndh)! - TypeNodeResolver - check for existing `Integer` class before resolving to `int` ([#&#8203;3848](https://github.com/phpstan/phpstan-src/pull/3848)), [#&#8203;12660](https://github.com/phpstan/phpstan/issues/12660), thanks [@&#8203;stepo2](https://github.com/stepo2)! # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.20](https://github.com/phpstan/phpstan/releases/tag/1.12.20) - Fix `ClassLike::$namespacedName must not be accessed before initialization` (https://github.com/phpstan/phpstan-src/commit/948f79d2da9e3767129b5432730fcbdec44995dc), [#&#8203;12627](https://github.com/phpstan/phpstan/issues/12627) - Fix referencing `%env%` in `includes` (https://github.com/phpstan/phpstan-src/commit/d4d7e116a20b179ca1502b651fd0b779e8fede6a), [#&#8203;12606](https://github.com/phpstan/phpstan/issues/12606) - Property can be written in get hook (https://github.com/phpstan/phpstan-src/commit/8de182dbdeff1bcff34cc6c0b24ed379f77bbc42), [#&#8203;12621](https://github.com/phpstan/phpstan/issues/12621) - Fix scope in enum match arm body ([#&#8203;3786](https://github.com/phpstan/phpstan-src/pull/3786)), [#&#8203;12422](https://github.com/phpstan/phpstan/issues/12422), thanks [@&#8203;dmytro-dymarchuk](https://github.com/dmytro-dymarchuk)! - Fix integer range pow issues ([#&#8203;3787](https://github.com/phpstan/phpstan-src/pull/3787)), [#&#8203;7937](https://github.com/phpstan/phpstan/issues/7937), [#&#8203;8555](https://github.com/phpstan/phpstan/issues/8555), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix GetNonVirtualPropertyHookReadRule on abstract property ([#&#8203;3845](https://github.com/phpstan/phpstan-src/pull/3845)), thanks [@&#8203;staabm](https://github.com/staabm)! - VarTagTypeRuleHelper - remove namespace and uses from NameScope (https://github.com/phpstan/phpstan-src/commit/189a4cc4c3875c1e8f4c19b3ea4b7aa89e88f919) # Function signature fixes 🤖 - Change return type of `ResourceBundle::getLocales` ([#&#8203;3840](https://github.com/phpstan/phpstan-src/pull/3840)), [#&#8203;12579](https://github.com/phpstan/phpstan/issues/12579), thanks [@&#8203;mat-se](https://github.com/mat-se)! - Make precise `scandir()` argument and return type ([#&#8203;3808](https://github.com/phpstan/phpstan-src/pull/3808)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - More precise return type for `mysqli_fetch_all()` ([#&#8203;3778](https://github.com/phpstan/phpstan-src/pull/3778)), thanks [@&#8203;oxan](https://github.com/oxan)! # Internals 🔍 - StrlenFunctionReturnTypeExtension: Cleanup `instanceof ConstantString` ([#&#8203;3780](https://github.com/phpstan/phpstan-src/pull/3780)), thanks [@&#8203;staabm](https://github.com/staabm)! - Adjust and make space for tests for new behaviour of `new` ([#&#8203;3852](https://github.com/phpstan/phpstan-src/pull/3852)) ### [`v2.1.6`](https://github.com/phpstan/phpstan/releases/tag/2.1.6) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.5...2.1.6) # Improvements 🔧 - This release includes improvements from [PHPStan 1.12.19](https://github.com/phpstan/phpstan/releases/tag/1.12.19) - PHP 8.4: Overriding property - when overriding readable property, the property has to be readable (same for writable) (https://github.com/phpstan/phpstan-src/commit/924a7a2f647acd3c62a054c4358c13c0b1cc2886) - ClassReflection - hasProperty cache (https://github.com/phpstan/phpstan-src/commit/73d7b88d60f4b8ebbff777060f8bc4e5e25bde12) - Updated phpdoc-parser - Allow multiple new lines in union and intersection declaration (https://github.com/phpstan/phpdoc-parser/pull/265), thanks [@&#8203;DaDeather](https://github.com/DaDeather)! - TypeParser - support comments at EOL with `//` (https://github.com/phpstan/phpdoc-parser/pull/264), https://github.com/phpstan/phpdoc-parser/issues/184, thanks [@&#8203;shmax](https://github.com/shmax)! # Bugfixes 🐛 - Do not report constructor unused parameter if class is an Attribute class ([#&#8203;3776](https://github.com/phpstan/phpstan-src/pull/3776)), [#&#8203;7165](https://github.com/phpstan/phpstan/issues/7165), thanks [@&#8203;carlos-granados](https://github.com/carlos-granados)! # Internals 🔍 - Test for set-hooked property being overriden by readonly property (https://github.com/phpstan/phpstan-src/commit/d3909c7fbf169069d8099ec67a3a0cd75ce873af) ### [`v2.1.5`](https://github.com/phpstan/phpstan/releases/tag/2.1.5) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.4...2.1.5) # Improvements 🔧 - Hooked property cannot be static ([#&#8203;3810](https://github.com/phpstan/phpstan-src/pull/3810)), [#&#8203;12336](https://github.com/phpstan/phpstan/issues/12336), thanks [@&#8203;jakubtobiasz](https://github.com/jakubtobiasz)! - Array shape from general array with single finite key (https://github.com/phpstan/phpstan-src/commit/6c45175093157f773725e70e4dd3c4f316027f67, https://github.com/phpstan/phpstan-src/commit/8a5bfb9208891055ecff4a39586d542b70546f82) - Allows `array<value-of<MyEnum::FIRST>, X>` to create an array shape where the key is backed enum case value - Update phpdoc-parser (https://github.com/phpstan/phpstan-src/commit/d25a815b1069174acf3efe97812617d679f30769) - TypeParser: Allow multiple newlines and also allow multiline union and intersection types for array shapes (https://github.com/phpstan/phpdoc-parser/pull/263), https://github.com/phpstan/phpdoc-parser/issues/258, https://github.com/phpstan/phpdoc-parser/issues/183, thanks [@&#8203;DaDeather](https://github.com/DaDeather)! # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.18](https://github.com/phpstan/phpstan/releases/tag/1.12.18) - Fix `GenericStaticType` in `@phpstan-self-out`, use `@phpstan-self-out` type when returning `$this` (https://github.com/phpstan/phpstan-src/commit/dab99cba7be39fb71c70e42373ff40dca64b82ad), [#&#8203;12575](https://github.com/phpstan/phpstan/issues/12575), [#&#8203;12548](https://github.com/phpstan/phpstan/issues/12548), [#&#8203;8439](https://github.com/phpstan/phpstan/issues/8439), [#&#8203;8316](https://github.com/phpstan/phpstan/issues/8316), [#&#8203;8275](https://github.com/phpstan/phpstan/issues/8275) - Fix `@phpstan-self-out` with GenericStaticType when method is called on `$this` (https://github.com/phpstan/phpstan-src/commit/cf6476188b73036741e916e1e3e58972b53bb8b3) - Update BetterReflection ([#&#8203;3822](https://github.com/phpstan/phpstan-src/pull/3822)) - Fixed property from interface implemented by trait (https://github.com/Roave/BetterReflection/pull/1487), [#&#8203;12553](https://github.com/phpstan/phpstan/issues/12553), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Readonly property can override get-only property declared in interface (https://github.com/phpstan/phpstan-src/commit/0c8e9d2905371039cf453509e044d367529aa2b9), [#&#8203;12586](https://github.com/phpstan/phpstan/issues/12586) ### [`v2.1.4`](https://github.com/phpstan/phpstan/releases/tag/2.1.4) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.3...2.1.4) # Improvements 🔧 - PHP 8.4: Prevent setting a default value for a virtual property ([#&#8203;3812](https://github.com/phpstan/phpstan-src/pull/3812)), [#&#8203;12336](https://github.com/phpstan/phpstan/issues/12336), thanks [@&#8203;jakubtobiasz](https://github.com/jakubtobiasz)! # Bugfixes 🐛 - PHP 8 stubs: Put built-in PHP enums in classes map instead of functions map, [#&#8203;12549](https://github.com/phpstan/phpstan/issues/12549), [#&#8203;12546](https://github.com/phpstan/phpstan/issues/12546) - https://github.com/phpstan/php-8-stubs/commit/3816597f86f912a2f9c34f70b3d9d0baf9053304 - https://github.com/phpstan/php-8-stubs/commit/97d994e9f3bc539ccabf2392a6e478cdf25a7940 - https://github.com/phpstan/phpstan-src/pull/3813 - https://github.com/phpstan/phpstan-src/commit/ad610cf827fa1025615ab8870dfb61b625ffbcf2 - Virtual property cannot be uninitialized (https://github.com/phpstan/phpstan-src/commit/b82230a48267ef3d55c568a707a5560b30ccea20), [#&#8203;12547](https://github.com/phpstan/phpstan/issues/12547) - Do not report invoking an aliased trait method by its original name as an error, [#&#8203;12544](https://github.com/phpstan/phpstan/issues/12544) - https://github.com/Roave/BetterReflection/pull/1485, thanks [@&#8203;kukulich](https://github.com/kukulich)! - [#&#8203;3814](https://github.com/phpstan/phpstan-src/pull/3814) - https://github.com/phpstan/phpstan-src/commit/e664bed7b62e2a58d571fb631ddf47030914a2b5 # Function signature fixes 🤖 - Add `false` to all `trader_*` functions return type ([#&#8203;3815](https://github.com/phpstan/phpstan-src/pull/3815)), thanks [@&#8203;rabol](https://github.com/rabol)! ### [`v2.1.3`](https://github.com/phpstan/phpstan/releases/tag/2.1.3) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.2...2.1.3) **If you're using `larastan/larastan` PHPStan extension, please update to version 3.0.4 alongside PHPStan 2.1.3 for improved compatibility with the new generic `static<...>` type. Thank you.** This release includes fixes and improvements from [PHPStan 1.12.17](https://github.com/phpstan/phpstan/releases/tag/1.12.17). Most impportantly it introduces GenericStaticType - support for `static<...>` ([#&#8203;1289](https://github.com/phpstan/phpstan-src/pull/1289)), [#&#8203;12485](https://github.com/phpstan/phpstan/issues/12485), [#&#8203;11398](https://github.com/phpstan/phpstan/issues/11398), [#&#8203;10417](https://github.com/phpstan/phpstan/issues/10417), [#&#8203;9807](https://github.com/phpstan/phpstan/issues/9807), [#&#8203;9449](https://github.com/phpstan/phpstan/issues/9449), [#&#8203;8623](https://github.com/phpstan/phpstan/issues/8623), [#&#8203;5512](https://github.com/phpstan/phpstan/issues/5512) # Improvements 🔧 - Look for overriden property prototype in implemented interfaces (https://github.com/phpstan/phpstan-src/commit/b3ca610fb4ae14d46da6f14d77499b35195ae40d) - AttributeReflection for easy attributes reading (https://github.com/phpstan/phpstan-src/commit/a387fa32788fd38bc35313558f6e6a46fc2c451c), [#&#8203;10443](https://github.com/phpstan/phpstan/issues/10443), [#&#8203;9618](https://github.com/phpstan/phpstan/issues/9618) - You can now call `->getAttributes()` on any thinkable reflection object, including `$scope->getFunction()` and you'll get a new PHPStan's AttributeReflection class: https://apiref.phpstan.org/2.1.x/PHPStan.Reflection.AttributeReflection.html - See https://github.com/phpstan/phpstan/discussions/12510 - Prevent declaring hooked properties as readonly ([#&#8203;3803](https://github.com/phpstan/phpstan-src/pull/3803)), [#&#8203;12525](https://github.com/phpstan/phpstan/issues/12525), thanks [@&#8203;jakubtobiasz](https://github.com/jakubtobiasz)! - Improved support for enum-string types ([#&#8203;3807](https://github.com/phpstan/phpstan-src/pull/3807)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Do not check abstract properties as uninitialized (https://github.com/phpstan/phpstan-src/commit/1cc534759f1cbb5ae05f2e3057d0f487a572aa12), [#&#8203;12466](https://github.com/phpstan/phpstan/issues/12466) - Properties might be covariant or contravariant, depending on the allowed operations on the parent (https://github.com/phpstan/phpstan-src/commit/50f8e491212197ca317b169e5c67978215ef4a0f), [#&#8203;12466](https://github.com/phpstan/phpstan/issues/12466) - Enable usage of `ReflectionClass::isSubclassOf()` with invariant `@template T` (https://github.com/phpstan/phpstan-src/commit/4f2af3bcdfec8699598303ee7a9bf49b4938a0ba), [#&#8203;12473](https://github.com/phpstan/phpstan/issues/12473) - Fix crash on unknown trait use: `array_combine()` args must have the same number of elements (https://github.com/ondrejmirtes/BetterReflection/commit/36f3291bd53f057a50613a99cbd805464723a94b), [#&#8203;12327](https://github.com/phpstan/phpstan/issues/12327) # Function signature fixes 🤖 - fix ext-amqp signatures ([#&#8203;3793](https://github.com/phpstan/phpstan-src/pull/3793)), [#&#8203;12469](https://github.com/phpstan/phpstan/issues/12469), [#&#8203;12461](https://github.com/phpstan/phpstan/issues/12461), thanks [@&#8203;esler](https://github.com/esler)! - `Imagick::getConfigureOptions()` returns array instead of string ([#&#8203;3801](https://github.com/phpstan/phpstan-src/pull/3801)), thanks [@&#8203;blankse](https://github.com/blankse)! # Internals 🔍 - Issue bot - skip `phpstanPlayground.configParameter` errors (https://github.com/phpstan/phpstan-src/commit/71d032761916517f18932bdee69c9468d8e83c84) - Cleanup (https://github.com/phpstan/phpstan-src/commit/0b28f6001b4d308e9fbfe3cb7feff6c259f47cc2) - Add a test covering a hooked property in a readonly class ([#&#8203;3809](https://github.com/phpstan/phpstan-src/pull/3809)), thanks [@&#8203;jakubtobiasz](https://github.com/jakubtobiasz)! ### [`v2.1.2`](https://github.com/phpstan/phpstan/releases/tag/2.1.2) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.1...2.1.2) # Improvements 🔧 - Add support for result cache meta extensions ([#&#8203;3765](https://github.com/phpstan/phpstan-src/pull/3765)), https://github.com/phpstan/phpstan-symfony/issues/255, thanks [@&#8203;Wirone](https://github.com/Wirone)! - See the docs: https://phpstan.org/developing-extensions/result-cache-meta-extensions - Overwrite property expression type only if it's subtype of the native type (https://github.com/phpstan/phpstan-src/commit/eb0e0bcfe2e4947d06c5eb680f5cf568a688ff4a, https://github.com/phpstan/phpstan-src/commit/bed30a79f4ed17651c48c031b89b60d4ce7453b2), [#&#8203;12438](https://github.com/phpstan/phpstan/issues/12438), [#&#8203;12393](https://github.com/phpstan/phpstan/issues/12393) - Enabling constructor check for class-string variables ([#&#8203;3661](https://github.com/phpstan/phpstan-src/pull/3661)), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! - PHP 8.4: ReflectionClass stub with lazy object methods (https://github.com/phpstan/phpstan-src/commit/25ec5eb2db6474f95a0b9dcac1cca8210ea1a021), [#&#8203;12435](https://github.com/phpstan/phpstan/issues/12435) - RFC: https://wiki.php.net/rfc/lazy-objects # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.16](https://github.com/phpstan/phpstan/releases/tag/1.12.16) - BooleanType - implement getConstantScalarTypes ([#&#8203;3781](https://github.com/phpstan/phpstan-src/pull/3781)), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - shell_exec - add `false` to the return type ([#&#8203;3730](https://github.com/phpstan/phpstan-src/pull/3730)), thanks [@&#8203;sreichel](https://github.com/sreichel)! - Fix `samesite` cookie argument precision (https://github.com/phpstan/phpstan-src/commit/a54cdb0675e23385adba9d1b2b9e643994fa20d7) # Internals 🔍 - Pass ExtendedMethodReflection into AlwaysUsedMethodExtension (https://github.com/phpstan/phpstan-src/commit/5d35811a87a85aeaac6a16824391a948c9a62335) - Remove private method `ConstantArrayType::findTypeAndMethodNames()` used only once (https://github.com/phpstan/phpstan-src/commit/30b9cd86c523b59739b609dc4e325d3275d71188) ### [`v2.1.1`](https://github.com/phpstan/phpstan/releases/tag/2.1.1) [Compare Source](https://github.com/phpstan/phpstan/compare/2.1.0...2.1.1) # Improvements 🔧 - Introduce `getNextStatements` in UnreachableStatementNode ([#&#8203;3745](https://github.com/phpstan/phpstan-src/pull/3745)), thanks [@&#8203;samsonasik](https://github.com/samsonasik)! - Improve loose comparison on string types ([#&#8203;3756](https://github.com/phpstan/phpstan-src/pull/3756)), thanks [@&#8203;staabm](https://github.com/staabm)! - Enforce safe constructor overrides with `@phpstan-consistent-constructor` ([#&#8203;3687](https://github.com/phpstan/phpstan-src/pull/3687)), [#&#8203;12137](https://github.com/phpstan/phpstan/issues/12137), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve loose comparison on constant types ([#&#8203;3755](https://github.com/phpstan/phpstan-src/pull/3755)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve loose comparison on IntegerRange containing zero ([#&#8203;3764](https://github.com/phpstan/phpstan-src/pull/3764)), thanks [@&#8203;staabm](https://github.com/staabm)! - NodeScopeResolver: 10x faster constant array processing ([#&#8203;3769](https://github.com/phpstan/phpstan-src/pull/3769)), thanks [@&#8203;staabm](https://github.com/staabm)! - UninitializedPropertyRule should be always reported when `checkUninitializedProperties` is enabled (https://github.com/phpstan/phpstan-src/commit/ca86412b4c53af26c21ddb3dd01f3fe200f17b48) # Bugfixes 🐛 - This release includes fixes from [PHPStan 1.12.15](https://github.com/phpstan/phpstan/releases/tag/1.12.15) - GetNonVirtualPropertyHookReadRule - do not report if get hook is not present at all (https://github.com/phpstan/phpstan-src/commit/b614f70e0154010f74e36dc9264962facac8122e) - Support named arguments after unpacking on PHP 8.1+ ([#&#8203;3742](https://github.com/phpstan/phpstan-src/pull/3742)), [#&#8203;11418](https://github.com/phpstan/phpstan/issues/11418), [#&#8203;8046](https://github.com/phpstan/phpstan/issues/8046), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Internals 🔍 - Update PHP-Parser and BetterReflection ([#&#8203;3767](https://github.com/phpstan/phpstan-src/pull/3767)) - Simplify code thanks to PHP-Parser update - Simplify code thanks to BetterReflection update - PropertyHookReturnStatementsNode is invoked for short body hooks - ShortGetPropertyHookReturnTypeRule is no longer needed - PropertyHookNameVisitor is no longer needed, PHP-parser comes with `propertyName` attribute ### [`v2.1.0`](https://github.com/phpstan/phpstan/releases/tag/2.1.0) [Compare Source](https://github.com/phpstan/phpstan/compare/2.0.4...2.1.0) [**Read all about this release on PHPStan's blog!**](https://phpstan.org/blog/phpstan-2-1-support-for-php-8-4-property-hooks-more) # Major new features 🚀 - Support for PHP 8.4's property hooks ([RFC](https://wiki.php.net/rfc/property-hooks)) - Support for PHP 8.4's asymmetric visibility ([RFC](https://wiki.php.net/rfc/asymmetric-visibility-v2)) - Support for PHP 8.4's `#[Deprecated]` attribute ([RFC](https://wiki.php.net/rfc/deprecated_attribute)) # Bleeding edge 🔪 - UnusedFunctionParametersCheck: report precise line ([#&#8203;3743](https://github.com/phpstan/phpstan-src/pull/3743)), thanks [@&#8203;janedbal](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Readonly classes cannot be combined with `#[AllowDynamicProperties]` ([#&#8203;3738](https://github.com/phpstan/phpstan-src/pull/3738)), [#&#8203;12281](https://github.com/phpstan/phpstan/issues/12281), thanks [@&#8203;staabm](https://github.com/staabm)! - Check trait attributes ([#&#8203;3738](https://github.com/phpstan/phpstan-src/pull/3738)), thanks [@&#8203;staabm](https://github.com/staabm)! - Named argument detection is scope-PHP version dependent ([#&#8203;3662](https://github.com/phpstan/phpstan-src/pull/3662)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve loose comparison on integer ([#&#8203;3748](https://github.com/phpstan/phpstan-src/pull/3748)), [#&#8203;12317](https://github.com/phpstan/phpstan/issues/12317), [#&#8203;12312](https://github.com/phpstan/phpstan/issues/12312), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve loose comparison on union type ([#&#8203;3750](https://github.com/phpstan/phpstan-src/pull/3750)), thanks [@&#8203;staabm](https://github.com/staabm)! - AccessStaticPropertiesRule - fixed blindspot about `parent::` (https://github.com/phpstan/phpstan-src/commit/41837b490b12e3c71b4ca50003690f2900f74876) # Bugfixes 🐛 - Fix `preg_match()` group containing start/end meta characters ([#&#8203;3740](https://github.com/phpstan/phpstan-src/pull/3740)), [#&#8203;12297](https://github.com/phpstan/phpstan/issues/12297), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Attributes rules use `In*Node` virtual nodes for more precise Scope https://github.com/phpstan/phpstan-src/commit/90e48fa876696f221874a2766c2bf3fc1bea0ec0) - Remove duplicated PHPDoc from InternalScopeFactory classes ([#&#8203;3761](https://github.com/phpstan/phpstan-src/pull/3761)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Scope: use `Scope::getConstant` instead ([#&#8203;3666](https://github.com/phpstan/phpstan-src/pull/3666)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.0.4`](https://github.com/phpstan/phpstan/releases/tag/2.0.4) [Compare Source](https://github.com/phpstan/phpstan/compare/2.0.3...2.0.4) This release includes improvements and fixes from [PHPStan 1.12.13](https://github.com/phpstan/phpstan/releases/tag/1.12.13). # Improvements 🔧 - Added `strictRulesInstalled` parameter ([#&#8203;3729](https://github.com/phpstan/phpstan-src/pull/3729)), thanks [@&#8203;staabm](https://github.com/staabm)! - Will be used for https://github.com/phpstan/phpstan-phpunit/pull/216 # Bugfixes 🐛 - Skip param castable to X on non-arrays ([#&#8203;3694](https://github.com/phpstan/phpstan-src/pull/3694)), [#&#8203;12146](https://github.com/phpstan/phpstan/issues/12146), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Remove incorrect CURLOPT_ACCEPT_ENCODING alias ([#&#8203;3703](https://github.com/phpstan/phpstan-src/pull/3703)), [#&#8203;12171](https://github.com/phpstan/phpstan/issues/12171), thanks [@&#8203;xPaw](https://github.com/xPaw)! - Fix `htmlspecialchars` and `htmlentities` being `non-empty-string` without ENT_SUBSTITUTE flag ([#&#8203;3710](https://github.com/phpstan/phpstan-src/pull/3710)), [#&#8203;12021](https://github.com/phpstan/phpstan/issues/12021), thanks [@&#8203;jack-worman](https://github.com/jack-worman)! # Function signature fixes 🤖 - Fix `fgetcsv` return type; never returns null ([#&#8203;3712](https://github.com/phpstan/phpstan-src/pull/3712)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Fix `apcu_cache_info` and `apcu_sma_info` signatures ([#&#8203;3726](https://github.com/phpstan/phpstan-src/pull/3726), https://github.com/phpstan/phpstan-src/commit/e7e80934023abc94a4f4bb9066ba6d6db26f6cde), thanks [@&#8203;vindic](https://github.com/vindic)! # Internals 🔍 - Workaround for bug in slevomat/coding-standard TypeNameMatchesFileName (https://github.com/phpstan/phpstan-src/commit/7b4c9afd090d89d595eb113831bc4b79b45d22e2) - Remove incorrect doc leftover from 1.x ([#&#8203;3732](https://github.com/phpstan/phpstan-src/pull/3732)), thanks [@&#8203;AJenbo](https://github.com/AJenbo)! ### [`v2.0.3`](https://github.com/phpstan/phpstan/releases/tag/2.0.3) [Compare Source](https://github.com/phpstan/phpstan/compare/2.0.2...2.0.3) This release includes improvements and fixes from [PHPStan 1.12.12](https://github.com/phpstan/phpstan/releases/tag/1.12.12). # Bleeding edge 🔪 - Check that values passed to array_sum/product are castable to number (level 5) ([#&#8203;3658](https://github.com/phpstan/phpstan-src/pull/3658)), [#&#8203;11883](https://github.com/phpstan/phpstan/issues/11883), thanks [@&#8203;schlndh](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Update BetterReflection with https://github.com/Roave/BetterReflection/pull/1462, thanks [@&#8203;kukulich](https://github.com/kukulich)! - Sanity checks around hooked properties in interfaces and classes ([#&#8203;3656](https://github.com/phpstan/phpstan-src/pull/3656)), thanks [@&#8203;jakubtobiasz](https://github.com/jakubtobiasz)! - Full support for PHP 8.4 is coming soon in PHPStan 2.1 # Bugfixes 🐛 - Fix subtracting enums inside `in_array` ([#&#8203;3646](https://github.com/phpstan/phpstan-src/pull/3646)), [#&#8203;12083](https://github.com/phpstan/phpstan/issues/12083), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Last value was not recognized when passing an associative array as an argument ([#&#8203;3668](https://github.com/phpstan/phpstan-src/pull/3668)), [#&#8203;11815](https://github.com/phpstan/phpstan/issues/11815), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! - Update PhpStorm stubs ([#&#8203;3683](https://github.com/phpstan/phpstan-src/pull/3683)), [#&#8203;12132](https://github.com/phpstan/phpstan/issues/12132) # Function signature fixes 🤖 - 3rd parameter of htmlentities and htmlspecialchars allows null ([#&#8203;3644](https://github.com/phpstan/phpstan-src/pull/3644)), thanks [@&#8203;sreichel](https://github.com/sreichel)! - Update curl_setopt string values and allow nullable ([#&#8203;3634](https://github.com/phpstan/phpstan-src/pull/3634)), thanks [@&#8203;xPaw](https://github.com/xPaw)!\* bccomp: more precise return type ([#&#8203;3647](https://github.com/phpstan/phpstan-src/pull/3647)), thanks [@&#8203;claudepache](https://github.com/claudepache)! # Internals 🔍 - FunctionCallParametersCheck: Add native parameter type ([#&#8203;3641](https://github.com/phpstan/phpstan-src/pull/3641)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor TryRemove/Accepts for DateTime|DateTimeImmutable and Exception|Error ([#&#8203;3654](https://github.com/phpstan/phpstan-src/pull/3654)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Implement `Scope::getPhpVersion()` ([#&#8203;3642](https://github.com/phpstan/phpstan-src/pull/3642)), thanks [@&#8203;staabm](https://github.com/staabm)! - Non-capturing catch support detection is scope PHP-version dependent ([#&#8203;3663](https://github.com/phpstan/phpstan-src/pull/3663)), [#&#8203;12114](https://github.com/phpstan/phpstan/issues/12114), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove shortArraySyntax definition in `Printer::__construct()` ([#&#8203;3680](https://github.com/phpstan/phpstan-src/pull/3680)), thanks [@&#8203;samsonasik](https://github.com/samsonasik)! ### [`v2.0.2`](https://github.com/phpstan/phpstan/releases/tag/2.0.2) [Compare Source](https://github.com/phpstan/phpstan/compare/2.0.1...2.0.2) # Improvements 🔧 - More details about PHP version information in `diagnose` command ([#&#8203;3609](https://github.com/phpstan/phpstan-src/pull/3609)), thanks [@&#8203;staabm](https://github.com/staabm)! - Utilize `phpVersion.min` and `max` in VersionCompareFunctionDynamicReturnTypeExtension ([#&#8203;3631](https://github.com/phpstan/phpstan-src/pull/3631)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improvements and fixes from [PHPStan 1.12.11](https://github.com/phpstan/phpstan/releases/tag/1.12.11) # Internals 🔍 - Refactor ComposerPhpVersionFactory, ConstantResolver ([#&#8203;3627](https://github.com/phpstan/phpstan-src/pull/3627)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v2.0.1`](https://github.com/phpstan/phpstan/releases/tag/2.0.1) [Compare Source](https://github.com/phpstan/phpstan/compare/2.0.0...2.0.1) # Bugfixes 🐛 - fix: check for existence of second arg in CountCharsFunctionDynamicReturnTypeExtension ([#&#8203;3620](https://github.com/phpstan/phpstan-src/pull/3620)), thanks [@&#8203;canvural](https://github.com/canvural)! - Fix resolving tentative return type (https://github.com/phpstan/phpstan-src/commit/753fc4d98fe8929aa8816f454d2f9a836ccd7a6b) - And [fixes from PHPStan 1.12.10](https://github.com/phpstan/phpstan/releases/tag/1.12.10) ### [`v2.0.0`](https://github.com/phpstan/phpstan/releases/tag/2.0.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.28...2.0.0) [![PHPStan 2.0](https://github.com/user-attachments/assets/c5b757b4-e7c2-4029-b472-13567d2967c2)](https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants) [**Read more about PHPStan 2.0.**](https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants) Check out the [**UPGRADING guide**](https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md)!. [**Buy the PHPStan elephpant and T-shirts!**](https://phpstan.org/merch) [![Design 2](https://github.com/user-attachments/assets/a878365f-2a4e-4ba2-86e0-bbeba6eff9ab)](https://phpstan.org/merch) # Major new features 🚀 - **Level 10** - level 9 on steroids, treats all `mixed` types strictly, not just explicit `mixed` - **Array `list` type** ([#&#8203;1751](https://github.com/phpstan/phpstan-src/pull/1751)), [#&#8203;3311](https://github.com/phpstan/phpstan/issues/3311), [#&#8203;8185](https://github.com/phpstan/phpstan/issues/8185), [#&#8203;6243](https://github.com/phpstan/phpstan/issues/6243), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Lists are arrays with sequential integer keys starting at 0 - **Lower memory consumption** thanks to breaking up of reference cycles - [Learn more »](https://phpstan.org/blog/preprocessing-ast-for-custom-rules) - In testing the memory consumption was reduced by 50–70 %. - **Enhancements in handling parameters passed by reference** - [Learn more on phpstan.org](https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference) - [#&#8203;2941](https://github.com/phpstan/phpstan-src/pull/2941), thanks [@&#8203;ljmaskey](https://github.com/ljmaskey)! - New rules (level 0): - MagicConstantContextRule ([#&#8203;2741](https://github.com/phpstan/phpstan-src/pull/2741)), [#&#8203;10099](https://github.com/phpstan/phpstan/issues/10099), thanks [@&#8203;staabm](https://github.com/staabm)! - MissingMagicSerializationMethodsRule ([#&#8203;1711](https://github.com/phpstan/phpstan-src/pull/1711)), [#&#8203;7482](https://github.com/phpstan/phpstan/issues/7482), thanks [@&#8203;staabm](https://github.com/staabm)! - Check vprintf/vsprintf arguments against placeholder count ([#&#8203;3126](https://github.com/phpstan/phpstan-src/pull/3126)), thanks [@&#8203;staabm](https://github.com/staabm)! - Check if required file exists ([#&#8203;3294](https://github.com/phpstan/phpstan-src/pull/3294)), [#&#8203;3397](https://github.com/phpstan/phpstan/issues/3397), thanks [@&#8203;Bellangelo](https://github.com/Bellangelo)! - Add `@readonly` rule that disallows default values ([#&#8203;1391](https://github.com/phpstan/phpstan-src/pull/1391)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Rule about `@phpstan-consistent-constructor` ([#&#8203;1296](https://github.com/phpstan/phpstan-src/pull/1296)), thanks [@&#8203;canvural](https://github.com/canvural)! - Check code in custom PHPStan extensions for runtime reflection concepts like `is_a()` or `class_parents()` (https://github.com/phpstan/phpstan-src/commit/c4a662ac6c3ec63f063238880b243b5399c34fcc) - Check code in custom PHPStan extensions for runtime reflection concepts like `new ReflectionMethod()` (https://github.com/phpstan/phpstan-src/commit/536306611cbb5877b6565755cd07b87f9ccfdf08) - ApiInstanceofRule - Report `instanceof` of classes not covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/ff4d02d62a7a2e2c4d928d48d31d49246dba7139) - Report `instanceof` of classes covered by backward compatibility promise but where the assumption might change (https://github.com/phpstan/phpstan-src/commit/996bc69fa977aa64f601bd82b8a0ae39be0cbeef) - Check that PHPStan class in class constant fetch is covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/9e007251ce61788f6a0319a53f1de6cf801ed233) - Previously absent type checks: - Check existing classes in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9) - Check nonexistent classes in local type aliases (https://github.com/phpstan/phpstan-src/commit/2485b2e9c129e789ec3b2d7db81ca30f87c63911) - Check unresolvable types in local type aliases (https://github.com/phpstan/phpstan-src/commit/5f7d12b2fb2809525ab0e96eeae95093204ea4d3) - Check generics in local type aliases (https://github.com/phpstan/phpstan-src/commit/5a2d4416d94ab77a2a2e7e1bfaba4c5ed2a13c25) - Check existing classes in `@param-out` (https://github.com/phpstan/phpstan-src/commit/30c4b9e80f51af8b5f166ba3aae93d8409c9c0ea), [#&#8203;10260](https://github.com/phpstan/phpstan/issues/10260) - Check existing classes in `@param-closure-this` (https://github.com/phpstan/phpstan-src/commit/2fa539a39e06bcc3155b109fd8d246703ceb176d), [#&#8203;10933](https://github.com/phpstan/phpstan/issues/10933) - New rules (level 2): - **Validate inline PHPDoc `@var` tag** type against native type (https://github.com/phpstan/phpstan-src/commit/a69e3bc2f1e87f6da1e65d7935f1cc36bd5c42fe) - Set [`reportWrongPhpDocTypeInVarTag`](https://phpstan.org/config-reference#reportwrongphpdoctypeinvartag) to `true` to have all types validated, not just native ones - Use config option `reportAnyTypeWideningInVarTag: true` for stricter behaviour ([#&#8203;2840](https://github.com/phpstan/phpstan-src/pull/2840)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - IncompatibleDefaultParameterTypeRule for closures (https://github.com/phpstan/phpstan-src/commit/0264f5bc48448c7e02a23b82eef4177d0617a82f) - Checking truthiness of `@phpstan-pure` above functions and methods - Check variance of template types in properties ([#&#8203;2314](https://github.com/phpstan/phpstan-src/pull/2314)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Report narrowing `PHPStan\Type\Type` interface via `@var` (https://github.com/phpstan/phpstan-src/commit/713b98fb107213c28e3d8c8b4b43c5f5fc47c144), https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389 - Previously absent type checks: - Check `@mixin` PHPDoc tag above traits (https://github.com/phpstan/phpstan-src/commit/0d0de946900adf4eb3c799b1b547567536e23147) - Check `@extends`, `@implements`, `@use` for unresolvable types (https://github.com/phpstan/phpstan-src/commit/2bb528233edb75312614166e282776f279cf2018), [#&#8203;11552](https://github.com/phpstan/phpstan/issues/11552) - Check types in `@method` tags (https://github.com/phpstan/phpstan-src/commit/5b7e474680eaf33874b7ed6a227677adcbed9ca5) - Check generics `@method` `@template` tags above traits (https://github.com/phpstan/phpstan-src/commit/aadbf62d3ae4517fc7a212b07130bedcef8d13ac) - Check types in `@property` tags (https://github.com/phpstan/phpstan-src/commit/55ea2ae516df22a071ab873fdd6f748a3af0520e), [#&#8203;10752](https://github.com/phpstan/phpstan/issues/10752), [#&#8203;9356](https://github.com/phpstan/phpstan/issues/9356) - New rule (level 3): - ArrayUnpackingRule ([#&#8203;856](https://github.com/phpstan/phpstan-src/pull/856)), thanks [@&#8203;canvural](https://github.com/canvural)! - New rules (level 4): - Check too wide private property type (https://github.com/phpstan/phpstan-src/commit/7453f4f75fae3d635063589467842aae29d88b54) - LogicalXorConstantConditionRule (https://github.com/phpstan/phpstan-src/commit/3a12724fd636b1bcf36c22b36e8f765d97150895, https://github.com/phpstan/phpstan-src/commit/3b011f6524254dad0f16840fdcfdbe7421548617), [#&#8203;7539](https://github.com/phpstan/phpstan/issues/7539) - Check that each trait is used and analysed at least once (https://github.com/phpstan/phpstan-src/commit/c4d05276fb8605d6ac20acbe1cc5df31cd6c10b0) - Report useless return values of function calls like `var_export` without `$return=true` ([#&#8203;3225](https://github.com/phpstan/phpstan-src/pull/3225)), [#&#8203;11320](https://github.com/phpstan/phpstan/issues/11320), thanks [@&#8203;staabm](https://github.com/staabm)! - ConstantLooseComparisonRule (https://github.com/phpstan/phpstan-src/commit/6ebf2361a3c831dd105a815521889428c295dc9f) - Check `new`/function call/method call/static method call on a separate line without any side effects even without `@phpstan-pure` PHPDoc tag on the declaration side - https://github.com/phpstan/phpstan-src/commit/281a87d1ab61809076ecfa6dfc2cc86e3babe235 - [#&#8203;3020](https://github.com/phpstan/phpstan-src/pull/3020), thanks [@&#8203;staabm](https://github.com/staabm)! - [#&#8203;3022](https://github.com/phpstan/phpstan-src/pull/3022), thanks [@&#8203;staabm](https://github.com/staabm)! - [#&#8203;3023](https://github.com/phpstan/phpstan-src/pull/3023), thanks [@&#8203;staabm](https://github.com/staabm)! - Always report always true conditions, except for last elseif and match arm (https://github.com/phpstan/phpstan-src/commit/565fb0f6da9cdc58e8686598015561a848693972) - Remove "unreachable branches" rules: UnreachableIfBranchesRule, UnreachableTernaryElseBranchRule, unreachable arm error in MatchExpressionRule - Because "always true" is always reported, these are no longer needed - New rules (level 5): - Check preg_quote delimiter sanity ([#&#8203;3252](https://github.com/phpstan/phpstan-src/pull/3252)), [#&#8203;11338](https://github.com/phpstan/phpstan/issues/11338), thanks [@&#8203;staabm](https://github.com/staabm)! - Rule for `call_user_func()` ([#&#8203;2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks [@&#8203;staabm](https://github.com/staabm)! - Report useless `array_filter()` calls ([#&#8203;1077](https://github.com/phpstan/phpstan-src/pull/1077)), [#&#8203;6840](https://github.com/phpstan/phpstan/issues/6840), thanks [@&#8203;leongersen](https://github.com/leongersen)! - Report useless `array_values()` calls ([#&#8203;2917](https://github.com/phpstan/phpstan-src/pull/2917)), thanks [@&#8203;kamil-zacek](https://github.com/kamil-zacek)! - Check array functions which require stringish values ([#&#8203;3132](https://github.com/phpstan/phpstan-src/pull/3132)), [#&#8203;11141](https://github.com/phpstan/phpstan/issues/11141), [#&#8203;5848](https://github.com/phpstan/phpstan/issues/5848), [#&#8203;3694](https://github.com/phpstan/phpstan/issues/3694), [#&#8203;11111](https://github.com/phpstan/phpstan/issues/11111), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Check unresolvable parameters ([#&#8203;1319](https://github.com/phpstan/phpstan-src/pull/1319)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Enforce `@no-named-arguments` (https://github.com/phpstan/phpstan-src/commit/74ba8c23696948f2647d880df72f375346f41010), [#&#8203;5968](https://github.com/phpstan/phpstan/issues/5968) - New rules (level 6): - Previously absent type checks: - Check missing types in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/892b319f25f04bc1b55c3d0063b607909612fe6d) - Check missing types in local type aliases (https://github.com/phpstan/phpstan-src/commit/ce7ffaf02d624a7fb9d38f8e5dffc9739f1233fc) - Check missing types in `@mixin` (https://github.com/phpstan/phpstan-src/commit/3175c81f26fd5bcb4a161b24e774921870ed2533) - New option: `polluteScopeWithBlock` (defaults to `true`, `false` in `phpstan-strict-rules`) (https://github.com/phpstan/phpstan-src/commit/946cf180c960930c2c42075d0f28ff9090507272) - Support `@readonly` property and `@immutable` class PHPDoc ([#&#8203;1295](https://github.com/phpstan/phpstan-src/pull/1295), [#&#8203;1335](https://github.com/phpstan/phpstan-src/pull/1335)), [#&#8203;4082](https://github.com/phpstan/phpstan/issues/4082), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Deprecate various `instanceof *Type` in favour of new methods on `Type` interface, (https://github.com/phpstan/phpstan-src/commit/436e6d3015cbeba4645d38bc7a6a865b9c6d7c74), learn more: [Why Is instanceof \*Type Wrong and Getting Deprecated?](https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated) # Improvements 🔧 - TableErrorFormatter - always output identifiers (https://github.com/phpstan/phpstan-src/commit/fc66c24113e9fe88c3155703224eb03768846fdd) - Config option `exceptions.check.tooWideThrowType` made true by default (https://github.com/phpstan/phpstan-src/commit/1b1da3e2ce3acf10dde03d9656638cda4f7389a4) - Use `implicitThrows` to only look for explicit throw points in too-wide `@throws` rules when set to `false` (https://github.com/phpstan/phpstan-src/commit/a0e688c1d1e4c5e82f989b26485eb9162f47aa97) - Rules about tooWideThrowType moved to level 4 (https://github.com/phpstan/phpstan-src/commit/d7798d7f2c47f426efe91c566e6cafd5a4e2410c) - Both .php and .neon baselines now include error identifiers (https://github.com/phpstan/phpstan-src/commit/f38addda2b151b6e41a746a37659c0bbe9e2293b, https://github.com/phpstan/phpstan-src/commit/c8b7ea9e8f51c8bbc38dfa6b04f9a0172f5cfea0) - PHPDoc parser: Require whitespace before description with limited start tokens (https://github.com/phpstan/phpdoc-parser/pull/128), https://github.com/phpstan/phpdoc-parser/issues/125, thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Unescape strings in PHPDoc parser (https://github.com/phpstan/phpstan-src/commit/97786ed8376b478ec541ea9df1c450c1fbfe7461) - PHPDoc parser: add config for lines in its AST & enable ignoring errors within PHPDocs ([#&#8203;2807](https://github.com/phpstan/phpstan-src/pull/2807)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - InvalidPhpDocTagValueRule: include PHPDoc line number in the error message (https://github.com/phpstan/phpstan-src/commit/a04e0be832900749b5b4ba22e2de21db8bfa09a0) - No implicit wildcard in FileExcluder (https://github.com/phpstan/phpstan-src/commit/e19e6e5f8cfa706cc30e44a17276a6bc269f995c), [#&#8203;10299](https://github.com/phpstan/phpstan/issues/10299) - Report invalid exclude paths in PHP config (https://github.com/phpstan/phpstan-src/commit/9718c14f1ffac81ba3d2bf331b4e8b4041a4d004) - Do not generalize template types, except when in `GenericObjectType` ([#&#8203;2818](https://github.com/phpstan/phpstan-src/pull/2818), [#&#8203;2821](https://github.com/phpstan/phpstan-src/pull/2821)) - This fixes following **20 issues**: [#&#8203;8166](https://github.com/phpstan/phpstan/issues/8166), [#&#8203;8127](https://github.com/phpstan/phpstan/issues/8127), [#&#8203;7944](https://github.com/phpstan/phpstan/issues/7944), [#&#8203;7283](https://github.com/phpstan/phpstan/issues/7283), [#&#8203;6653](https://github.com/phpstan/phpstan/issues/6653), [#&#8203;6196](https://github.com/phpstan/phpstan/issues/6196), [#&#8203;9084](https://github.com/phpstan/phpstan/issues/9084), [#&#8203;8683](https://github.com/phpstan/phpstan/issues/8683), [#&#8203;8074](https://github.com/phpstan/phpstan/issues/8074), [#&#8203;7984](https://github.com/phpstan/phpstan/issues/7984), [#&#8203;7301](https://github.com/phpstan/phpstan/issues/7301), [#&#8203;7087](https://github.com/phpstan/phpstan/issues/7087), [#&#8203;5594](https://github.com/phpstan/phpstan/issues/5594), [#&#8203;5592](https://github.com/phpstan/phpstan/issues/5592), [#&#8203;9472](https://github.com/phpstan/phpstan/issues/9472), [#&#8203;9764](https://github.com/phpstan/phpstan/issues/9764), [#&#8203;10092](https://github.com/phpstan/phpstan/issues/10092), [#&#8203;11126](https://github.com/phpstan/phpstan/issues/11126), [#&#8203;11032](https://github.com/phpstan/phpstan/issues/11032), [#&#8203;10653](https://github.com/phpstan/phpstan/issues/10653) - Non-static methods cannot be used as static callables in PHP 8+ ([#&#8203;2420](https://github.com/phpstan/phpstan-src/pull/2420)), thanks [@&#8203;staabm](https://github.com/staabm)! - Analysis with zero files results in non-zero exit code (https://github.com/phpstan/phpstan-src/commit/46ff440648e62617df86aa74ba905ffa99897737), [#&#8203;9410](https://github.com/phpstan/phpstan/issues/9410) - Fail build when project config uses custom extensions outside of analysed paths - This will only occur after a run that uses already present and valid result cache - Returning plain strings as errors no longer supported, use RuleErrorBuilder - Learn more: [Using RuleErrorBuilder to enrich reported errors in custom rules](https://phpstan.org/blog/using-rule-error-builder) - Require identifier in custom rules (https://github.com/phpstan/phpstan-src/commit/969e6fa31d5484d42dab902703cfc6820a983cfd) - New `RuleLevelHelper::accepts()` behaviour (https://github.com/phpstan/phpstan-src/commit/941fc815db49315b8783dc466cf593e0d8a85d23), [#&#8203;11119](https://github.com/phpstan/phpstan/issues/11119), [#&#8203;4174](https://github.com/phpstan/phpstan/issues/4174) - Infer explicit mixed when instantiating generic class with unknown template types (https://github.com/phpstan/phpstan-src/commit/089d4c6fb6eb709c44123548d33990113d174b86), [#&#8203;6398](https://github.com/phpstan/phpstan/issues/6398) - Use explicit mixed for global array variables ([#&#8203;1411](https://github.com/phpstan/phpstan-src/pull/1411)), [#&#8203;7082](https://github.com/phpstan/phpstan/issues/7082), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Consider implicit throw points when the only explicit one is `Throw_` (https://github.com/phpstan/phpstan-src/commit/22eef6d5ab9a4afafb2305258fea273be6cc06e4), [#&#8203;4912](https://github.com/phpstan/phpstan/issues/4912) - Run missing type check on `@param-out` (https://github.com/phpstan/phpstan-src/commit/56b20024386d983927c64dfa895ff026bed2798c) - Report "missing return" error closer to where the return is missing (https://github.com/phpstan/phpstan-src/commit/04f8636e6577cbcaefc944725eed74c0d7865ead) - Report dead types even in multi-exception catch ([#&#8203;2399](https://github.com/phpstan/phpstan-src/pull/2399)), thanks [@&#8203;JanTvrdik](https://github.com/JanTvrdik)! - MethodSignatureRule - look at abstract trait method (https://github.com/phpstan/phpstan-src/commit/5fd8cee591ce1b07daa5f98a1ddcdfc723f1b5eb) - OverridingMethodRule - include template types in prototype declaring class description (https://github.com/phpstan/phpstan-src/commit/ca2c66cc4dff59ba44d52b82cb9e0aa3256240f3) - Detect overriding `@final` method in OverridingMethodRule, [#&#8203;9135](https://github.com/phpstan/phpstan/issues/9135) - Improve error wording of the NonexistentOffset, BooleanAndConstantConditionRule, and BooleanOrConstantConditionRule ([#&#8203;1882](https://github.com/phpstan/phpstan-src/pull/1882)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Stricter ++/-- operator check ([#&#8203;3255](https://github.com/phpstan/phpstan-src/pull/3255)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Check mixed in binary operator ([#&#8203;3231](https://github.com/phpstan/phpstan-src/pull/3231)), [#&#8203;7538](https://github.com/phpstan/phpstan/issues/7538), [#&#8203;10440](https://github.com/phpstan/phpstan/issues/10440), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Check mixed in unary operator ([#&#8203;3253](https://github.com/phpstan/phpstan-src/pull/3253)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Stub files validation - detect duplicate classes and functions (https://github.com/phpstan/phpstan-src/commit/ddf8d5c3859c2c75c20f525a0e2ca8b99032373a, https://github.com/phpstan/phpstan-src/commit/17e4b74335e5235d7cd6708eb687a774a0eeead4) - NoopRule - take advantage of impure points (https://github.com/phpstan/phpstan-src/commit/a6470521b65d7424f552633c1f3827704c6262c3), [#&#8203;10389](https://github.com/phpstan/phpstan/issues/10389) - Improve impossible type checker for void-returning functions ([#&#8203;1857](https://github.com/phpstan/phpstan-src/pull/1857)), [#&#8203;8169](https://github.com/phpstan/phpstan/issues/8169), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Check template type variance in `@param-out` (https://github.com/phpstan/phpstan-src/commit/7ceb19d3b42cf4632d10c2babb0fc5a21b6c8352), https://github.com/phpstan/phpstan/issues/8880#issuecomment-1426971473 - Fix position variance of static method parameters ([#&#8203;2313](https://github.com/phpstan/phpstan-src/pull/2313)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Empty `skipCheckGenericClasses` (https://github.com/phpstan/phpstan-src/commit/28c2c79b16cac6ba6b01f1b4d211541dd49d8a77) - Report unnecessary nullsafe property fetch inside `??` / `isset` / `empty` with different message ([#&#8203;1253](https://github.com/phpstan/phpstan-src/pull/1253)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Specify explicit mixed array type via `is_array` ([#&#8203;1191](https://github.com/phpstan/phpstan-src/pull/1191)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - TooWideMethodReturnTypehintRule - always report for final methods (https://github.com/phpstan/phpstan-src/commit/c30e9a484c8245b8126cd63444607ca74d2af761) - Move IllegalConstructorMethodCallRule and IllegalConstructorStaticCallRule to phpstan-strict-rules (https://github.com/phpstan/phpstan-src/commit/124b30f98c182193187be0b9c2e151e477429b7a, https://github.com/phpstan/phpstan-strict-rules/commit/0c82c96f2a55d8b91bbc7ee6512c94f68a206b43) - Check invalid PHPDocs in previously unchecked statement types (https://github.com/phpstan/phpstan-src/commit/9780d352f3264aac09ac7954f691de1877db8e01) - InvalidPHPStanDocTagRule in StubValidator (https://github.com/phpstan/phpstan-src/commit/9c2552b7e744926d1a74c1ba8fd32c64079eed61) - CallToConstructorStatementWithoutSideEffectsRule - report class with no constructor (https://github.com/phpstan/phpstan-src/commit/b116d25a6e4ba6c09f59af6569d9e6f6fd20aff4) - ContainerFactory - always check duplicate files (https://github.com/phpstan/phpstan-src/commit/939a715a0636ed05752659dbe7646c1f1a574765) - Display parent class name for anonymous class like native PHP does ([#&#8203;3362](https://github.com/phpstan/phpstan-src/pull/3362)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Always report static property fetch in `isset()`, not just on PHP 8.2+ ([#&#8203;3476](https://github.com/phpstan/phpstan-src/pull/3476)), thanks [@&#8203;ondrejmirtes](https://github.com/ondrejmirtes)! - Revert "Dumb down parameter types in some recently added stubs" (https://github.com/phpstan/phpstan-src/commit/950a491485c46068074ca3f4f6dc5b970d41465a) - Do not apply heuristics of `Collection<...>|Foo[]` being resolved to Collection of Foo (https://github.com/phpstan/phpstan-src/commit/fff8f095988a66f298aa4037fe8e6ba98266063c) - Collected PHP errors cannot be ignored (https://github.com/phpstan/phpstan-src/commit/1d3f4313955dc6fa5c6ce60fa58afe765964e5b0) - Added missing rules to StubValidator (https://github.com/phpstan/phpstan-src/commit/bf19914cac1682d0eab8bf65a874ba368522311c) - Report precise offsets in errors ([#&#8203;3504](https://github.com/phpstan/phpstan-src/pull/3504)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - IntersectionType - always describe list as list (https://github.com/phpstan/phpstan-src/commit/f680629bc92e4dd5d7acd3bc60c9539fb047452b) - ArrayType::describe - explicit mixed should be stated explicitly (https://github.com/phpstan/phpstan-src/commit/6cf223840f89c972551f373ade9eea16d12e143b) - Refactor IntersectionType::describe() (https://github.com/phpstan/phpstan-src/commit/67fbfaee6585c2d47485dc2a159ee76d3ed02b35) - Remove inefficient caching from `PhpMethodReflection` and `PhpFunctionReflection::isVariadic()` ([#&#8203;3534](https://github.com/phpstan/phpstan-src/pull/3534)), thanks [@&#8203;staabm](https://github.com/staabm)! - Clean file cache from unused items (https://github.com/phpstan/phpstan-src/commit/466ad51740d629c9137a77dac28a676b71ef7197) - Journal for used generated containers (https://github.com/phpstan/phpstan-src/commit/57c65888e6372a4056afbbacc8207d411ea8559a) - Use named argument in error for variadic types ([#&#8203;3611](https://github.com/phpstan/phpstan-src/pull/3611)), thanks [@&#8203;ruudk](https://github.com/ruudk)! # Bugfixes 🐛 - Fix invariance composition ([#&#8203;2054](https://github.com/phpstan/phpstan-src/pull/2054)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Fix checking generic `mixed` type based on config ([#&#8203;2885](https://github.com/phpstan/phpstan-src/pull/2885)), thanks [@&#8203;schlndh](https://github.com/schlndh)! # Function signature fixes 🤖 - Countable stub with `0|positive-int` ([#&#8203;1027](https://github.com/phpstan/phpstan-src/pull/1027)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise types for bcmath function parameters ([#&#8203;2217](https://github.com/phpstan/phpstan-src/pull/2217)), thanks [@&#8203;Warxcell](https://github.com/Warxcell)! - Specify `Imagick` parameter types ([#&#8203;2334](https://github.com/phpstan/phpstan-src/pull/2334)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - `max()`/`min()` should expect non-empty-array ([#&#8203;2163](https://github.com/phpstan/phpstan-src/pull/2163)), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow `Closure::bind` `$newScope` param ([#&#8203;2817](https://github.com/phpstan/phpstan-src/pull/2817)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - `error_log` errors with `message_type=2` ([#&#8203;2428](https://github.com/phpstan/phpstan-src/pull/2428)), [#&#8203;9380](https://github.com/phpstan/phpstan/issues/9380), thanks [@&#8203;staabm](https://github.com/staabm)! - Update functionMap ([#&#8203;2699](https://github.com/phpstan/phpstan-src/pull/2699), [#&#8203;2783](https://github.com/phpstan/phpstan-src/pull/2783)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Improve image related functions signature ([#&#8203;3127](https://github.com/phpstan/phpstan-src/pull/3127)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Support `FILE_NO_DEFAULT_CONTEXT` in `file()` ([#&#8203;2482](https://github.com/phpstan/phpstan-src/pull/2482)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix ftp related function signatures ([#&#8203;2551](https://github.com/phpstan/phpstan-src/pull/2551)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - More precise `file()` flags args ([#&#8203;2476](https://github.com/phpstan/phpstan-src/pull/2476), [#&#8203;2482](https://github.com/phpstan/phpstan-src/pull/2482)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `flock()` operation flags ([#&#8203;2477](https://github.com/phpstan/phpstan-src/pull/2477)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `stream_socket_client()` signature ([#&#8203;2519](https://github.com/phpstan/phpstan-src/pull/2519)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `scandir()` signature ([#&#8203;2518](https://github.com/phpstan/phpstan-src/pull/2518)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `extract()` signature ([#&#8203;2517](https://github.com/phpstan/phpstan-src/pull/2517)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `RecursiveIteratorIterator::__construct()` parameter types ([#&#8203;2835](https://github.com/phpstan/phpstan-src/pull/2835)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update `Locale` signatures ([#&#8203;2880](https://github.com/phpstan/phpstan-src/pull/2880)), thanks [@&#8203;devnix](https://github.com/devnix)! - Improved the type of the `$mode` parameter for the `count()` ([#&#8203;3190](https://github.com/phpstan/phpstan-src/pull/3190)), thanks [@&#8203;kuma3](https://github.com/kuma3)! - Check `filter_input*` type param type ([#&#8203;2271](https://github.com/phpstan/phpstan-src/pull/2271)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Change `curl_setopt` function signature based on 2nd arg ([#&#8203;1719](https://github.com/phpstan/phpstan-src/pull/1719)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support returning an array or a string in `count_chars()` ([#&#8203;3596](https://github.com/phpstan/phpstan-src/pull/3596)), thanks [@&#8203;u01jmg3](https://github.com/u01jmg3)! - xdebug_get_function_stack: fix signature ([#&#8203;3605](https://github.com/phpstan/phpstan-src/pull/3605)), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Internals 🔍 - Tool to make optional parameters required across the codebase (https://github.com/phpstan/phpstan-src/commit/7e366e08f96e2e4095b3f02b5487e8f9531f37bf) - A few more MutatingScope method parameters made required (https://github.com/phpstan/phpstan-src/commit/2c4c0cde75e637ac323e81def57d4a2ace952429) - CommandHelper::begin() parameters made required (https://github.com/phpstan/phpstan-src/commit/f17cf9ec43111cb29dd50d620fb6259c0ab0d373) - MethodTag - constructor parameter `$templateTags` is required (https://github.com/phpstan/phpstan-src/commit/5b58f83e6d8b5044d742caed9729d00178c4a9de) - InitializerExprTypeResolver - constructor parameter `$usePathConstantsAsConstantString` made required (https://github.com/phpstan/phpstan-src/commit/f88d9ba7f56ef6c3b783aee1c909a3422c0ef3c3) - `PhpMethodReflectionFactory::create()` - all parameters are required (https://github.com/phpstan/phpstan-src/commit/8bfbf8f254a68e4f1b15419eb950ea677fc2916e) - FunctionCallParametersCheck - parameters `$nodeType` and `$acceptsNamedArguments` made required (https://github.com/phpstan/phpstan-src/commit/493752737c32eb878de4dfb91817761b952348e4) - MethodParameterComparisonHelper - parameter `$ignorable` of `compare()` method made required (https://github.com/phpstan/phpstan-src/commit/f85a500288b0b8ef9a19d405c0e3d99ab57ce797) - Parameter `$dateTimeClass` of DateTimeModifyReturnTypeExtension constructor made required (https://github.com/phpstan/phpstan-src/commit/a8cd423e842deaa7d924580665207a4b1a373115) - NativeFunctionReflection construct parameters made required (https://github.com/phpstan/phpstan-src/commit/64ff598cd42268d2178d02efd208afe637060978) - Cover AccessoryArrayListType constructor with BC promise (https://github.com/phpstan/phpstan-src/commit/51de9032c6e98bff2d6eb0e5b7295720ec0276b9) - Add `PhpVersion` parameter to various `Type` methods ([#&#8203;3478](https://github.com/phpstan/phpstan-src/pull/3478)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Move ContainerDynamicReturnTypeExtension to build/PHPStan (https://github.com/phpstan/phpstan-src/commit/5651bec661582b2d62de1b4ae9d5f27e69e3c524) - Renamed NewOptimizedDirectorySourceLocator to OptimizedDirectorySourceLocator (https://github.com/phpstan/phpstan-src/commit/db02a30ca11c7b9839c30e0321ed403dd14f6c73) - Remove unneded abstraction (https://github.com/phpstan/phpstan-src/commit/f302c9069274afa63ec1b4f313ca72340699e9d8) - Introduce native return types thanks to PHP 7.4 return type covariance (https://github.com/phpstan/phpstan-src/commit/392f090066bfc9946b4ad524ffecf3d420c23114) - ReadWritePropertiesExtension - use ExtendedPropertyReflection in parameter type (https://github.com/phpstan/phpstan-src/commit/f0a629685de2202687b9f92bd0e1a516daf2443e) - Declare more precise `getClass()` return types in extension interfaces ([#&#8203;1754](https://github.com/phpstan/phpstan-src/pull/1754)), thanks [@&#8203;staabm](https://github.com/staabm)! - (https://github.com/phpstan/phpstan-src/commit/38cb5a315e5573231d8695df343c8ee87a8c3b2e) - HasOffsetType - put constructor parameter type natively (https://github.com/phpstan/phpstan-src/commit/b5accb3f6bbcffc8a44934539b88903e09b6a174) - Printer is covered by BC promise (https://github.com/phpstan/phpstan-src/commit/b0858332efc7aa2f2fde7544a2a821ba81bde13b) - More interfaces that are not supposed to be implemented in userland (https://github.com/phpstan/phpstan-src/commit/778af2ed74ba59bfb2a69fd5b45821ccdb1107c9, https://github.com/phpstan/phpstan-src/commit/cb6ab5544a016c52f931fc390bcdf9c627819d8f) - Refactored `FunctionCallParametersCheck::check()` parameters (https://github.com/phpstan/phpstan-src/commit/710e09c41698efb1d8d3ae31791944077dbb9cc1) - Spread list usages in Reflection, Scope, Type ([#&#8203;3530](https://github.com/phpstan/phpstan-src/pull/3530)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Remove $isFinal dead-code in PhpFunctionReflection ([#&#8203;3545](https://github.com/phpstan/phpstan-src/pull/3545)), thanks [@&#8203;staabm](https://github.com/staabm)! - Get rid of unnecessary `instanceof self` in `ConstantArrayType` ([#&#8203;3552](https://github.com/phpstan/phpstan-src/pull/3552)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - test: use `bashunit -a` exit_code to check for errors ([#&#8203;3533](https://github.com/phpstan/phpstan-src/pull/3533)), thanks [@&#8203;Chemaclass](https://github.com/Chemaclass)! - Upgrade bashunit:0.18.0 for e2e tests ([#&#8203;3614](https://github.com/phpstan/phpstan-src/pull/3614)), thanks [@&#8203;Chemaclass](https://github.com/Chemaclass)! - Remove dead code ([#&#8203;3575](https://github.com/phpstan/phpstan-src/pull/3575)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove dead code in ConstantConditionRuleHelper ([#&#8203;3597](https://github.com/phpstan/phpstan-src/pull/3597)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.28`](https://github.com/phpstan/phpstan/releases/tag/1.12.28) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.27...1.12.28) # Improvements 🔧 - More precise elapsed time if it's a low number (https://github.com/phpstan/phpstan-src/commit/7644bd01603f3ef8194b8497bad06f217de420fe) # Bugfixes 🐛 - Fix recursion with object shapes in `@property` referencing other class and then back in recursive manner (https://github.com/phpstan/phpstan-src/commit/33c2cb196595efa9e356dd6030f165bf2af447f7), [#&#8203;13057](https://github.com/phpstan/phpstan/issues/13057) - Fix `@var` PHPDoc type inheritance for class constants ([#&#8203;4008](https://github.com/phpstan/phpstan-src/pull/4008)), [#&#8203;10911](https://github.com/phpstan/phpstan/issues/10911), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Allow `getenv(null)` for PHP 8.0+ ([#&#8203;4007](https://github.com/phpstan/phpstan-src/pull/4007)), [#&#8203;13065](https://github.com/phpstan/phpstan/issues/13065), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Properly restore error handler for collecting errors (https://github.com/phpstan/phpstan-src/commit/43c44ee47d43b2476a32139da14ce8b888c42ecd) - Fix infinite recursion with TemplateIterableType (https://github.com/phpstan/phpstan-src/commit/400ba6d71ae15f52c923b5251114839261b49a27), [#&#8203;13218](https://github.com/phpstan/phpstan/issues/13218) - Avoid error with constant name `$` ([#&#8203;4006](https://github.com/phpstan/phpstan-src/pull/4006)), [#&#8203;12095](https://github.com/phpstan/phpstan/issues/12095), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Array without `0` in key type is not a list ([#&#8203;4018](https://github.com/phpstan/phpstan-src/pull/4018)), [#&#8203;9487](https://github.com/phpstan/phpstan/issues/9487), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix HasOffsetValueType::searchArray ([#&#8203;4013](https://github.com/phpstan/phpstan-src/pull/4013)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Rework ArrayReplaceFunctionReturnTypeExtension ([#&#8203;3958](https://github.com/phpstan/phpstan-src/pull/3958)), [#&#8203;12828](https://github.com/phpstan/phpstan/issues/12828), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - Update PDO errorCode return type ([#&#8203;4005](https://github.com/phpstan/phpstan-src/pull/4005)), [#&#8203;12571](https://github.com/phpstan/phpstan/issues/12571), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix return type of `bzdecompress()` ([#&#8203;4088](https://github.com/phpstan/phpstan-src/pull/4088)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Improve `mb_convert_encoding` return type ([#&#8203;4010](https://github.com/phpstan/phpstan-src/pull/4010)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Migrate legacy tests ([#&#8203;4000](https://github.com/phpstan/phpstan-src/pull/4000)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.27`](https://github.com/phpstan/phpstan/releases/tag/1.12.27) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.26...1.12.27) # Major new features 🚀 - Introducing **Editor Mode** (https://github.com/phpstan/phpstan-src/commit/74b909aedcc6fd09721c02763ff2c440ce5d7999) - Learn more: https://phpstan.org/user-guide/editor-mode # Improvements 🔧 - Result cache traits optimization - analyse only files using trait when trait implementation changes (https://github.com/phpstan/phpstan-src/commit/bd6fc4e266a94fafe3d12078f142db3f900fc1f9) - InitializerExprTypeResolver - optimize arithmetical and bitwise operations for large types (https://github.com/phpstan/phpstan-src/commit/275d3b5a85cc84459bca8d965ed1127837665b02, https://github.com/phpstan/phpstan-src/commit/572e0e8f26eb3618f22127f694170f5cc2f2c6cb) - Limit how big int-mask type can be (https://github.com/phpstan/phpstan-src/commit/80b40f2177aafedad4557363673126f00583c5ca) # Bugfixes 🐛 - Fix result cache getting stale when editing files mid-analysis (https://github.com/phpstan/phpstan-src/commit/0536d1148de2edf065dc10a95d9011813abd98bd), [#&#8203;11788](https://github.com/phpstan/phpstan/issues/11788) - Result cache should be invalidated when files change in paths excluded for analysis but not scanning (https://github.com/phpstan/phpstan-src/commit/408692e22ce16abc860c689a55bedb3da445bfc7), [#&#8203;12381](https://github.com/phpstan/phpstan/issues/12381), [#&#8203;7339](https://github.com/phpstan/phpstan/issues/7339) - PHPStan Pro - refresh errors when scanned file is changed (https://github.com/phpstan/phpstan-src/commit/7e3639b2287952a6f05a2befe59435791166873a), [#&#8203;12465](https://github.com/phpstan/phpstan/issues/12465) - Result cache - add traits to dependencies recursively (https://github.com/phpstan/phpstan-src/commit/e5db864362bb19b2fb3c47188c117afd18e386f6) ### [`v1.12.26`](https://github.com/phpstan/phpstan/releases/tag/1.12.26) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.25...1.12.26) # Improvements 🔧 - Add callback types for array_uintersect etc. ([#&#8203;3282](https://github.com/phpstan/phpstan-src/pull/3282)), [#&#8203;7707](https://github.com/phpstan/phpstan/issues/7707), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Support iterable as template type bound ([#&#8203;3984](https://github.com/phpstan/phpstan-src/pull/3984)), [#&#8203;12214](https://github.com/phpstan/phpstan/issues/12214), thanks [@&#8203;RobertMe](https://github.com/RobertMe)! - Introduce StrrevFunctionReturnTypeExtension ([#&#8203;3960](https://github.com/phpstan/phpstan-src/pull/3960)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Bugfixes 🐛 - Fix ImpossibleCheckTypeFunctionCallRule for `is_subclass_of` and `is_a` ([#&#8203;3788](https://github.com/phpstan/phpstan-src/pull/3788)), [#&#8203;3979](https://github.com/phpstan/phpstan/issues/3979), [#&#8203;8464](https://github.com/phpstan/phpstan/issues/8464), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `numeric-string` to `array-key` ([#&#8203;3326](https://github.com/phpstan/phpstan-src/pull/3326)), [#&#8203;4163](https://github.com/phpstan/phpstan/issues/4163), [#&#8203;4671](https://github.com/phpstan/phpstan/issues/4671), [#&#8203;8592](https://github.com/phpstan/phpstan/issues/8592), [#&#8203;11390](https://github.com/phpstan/phpstan/issues/11390), [#&#8203;12413](https://github.com/phpstan/phpstan/issues/12413), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `callable-string` must be `non-empty-string` ([#&#8203;3983](https://github.com/phpstan/phpstan-src/pull/3983)), [#&#8203;12979](https://github.com/phpstan/phpstan/issues/12979), thanks [@&#8203;aivchen](https://github.com/aivchen)! - Use SoapClientMethodsClassReflectionExtension as last extension ([#&#8203;3955](https://github.com/phpstan/phpstan-src/pull/3955)), [#&#8203;12834](https://github.com/phpstan/phpstan/issues/12834), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - Fix mb_convert_encoding signature ([#&#8203;3914](https://github.com/phpstan/phpstan-src/pull/3914)), [#&#8203;12309](https://github.com/phpstan/phpstan/issues/12309), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.25`](https://github.com/phpstan/phpstan/releases/tag/1.12.25) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.24...1.12.25) Consider comparison as strict when type is the same ([#&#8203;3942](https://github.com/phpstan/phpstan-src/pull/3942)), [#&#8203;12884](https://github.com/phpstan/phpstan/issues/12884), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.24`](https://github.com/phpstan/phpstan/releases/tag/1.12.24) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.23...1.12.24) # Bugfixes 🐛 - Fix weird "stdClass not found" error in connection to array shapes (https://github.com/phpstan/phpstan-src/commit/8a6f7e9a1c0aa24e0cbf4160b042826ed14d80be), [#&#8203;12803](https://github.com/phpstan/phpstan/issues/12803) - Disable Override check for traits ([#&#8203;3911](https://github.com/phpstan/phpstan-src/pull/3911)), [#&#8203;12471](https://github.com/phpstan/phpstan/issues/12471), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `DateTime::format('u')` return type ([#&#8203;3919](https://github.com/phpstan/phpstan-src/pull/3919)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix specifying types on nullsafe true/false comparison ([#&#8203;3940](https://github.com/phpstan/phpstan-src/pull/3940)), [#&#8203;12866](https://github.com/phpstan/phpstan/issues/12866), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - Fix uopz signature ([#&#8203;3903](https://github.com/phpstan/phpstan-src/pull/3903)), [#&#8203;12499](https://github.com/phpstan/phpstan/issues/12499), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.23`](https://github.com/phpstan/phpstan/releases/tag/1.12.23) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.22...1.12.23) Fix condition of fall-through case not used for exhaustive checks ([#&#8203;3900](https://github.com/phpstan/phpstan-src/pull/3900)), [#&#8203;11064](https://github.com/phpstan/phpstan/issues/11064), [#&#8203;3488](https://github.com/phpstan/phpstan/issues/3488), [#&#8203;8719](https://github.com/phpstan/phpstan/issues/8719), [#&#8203;12722](https://github.com/phpstan/phpstan/issues/12722), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! ### [`v1.12.22`](https://github.com/phpstan/phpstan/releases/tag/1.12.22) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.21...1.12.22) # Improvements 🔧 - More precise `implode()` return type ([#&#8203;3774](https://github.com/phpstan/phpstan-src/pull/3774)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - ArrayType - setting new offset with `[]` on array with constant-integer offset will add one to the offset (https://github.com/phpstan/phpstan-src/commit/fe595cba71279d990a8be265d594b470265ea318), [#&#8203;9328](https://github.com/phpstan/phpstan/issues/9328), [#&#8203;9850](https://github.com/phpstan/phpstan/issues/9850), [#&#8203;10650](https://github.com/phpstan/phpstan/issues/10650) - Optimize scalar values in oversized constant arrays (https://github.com/phpstan/phpstan-src/commit/791e708efd0e4f2b845d6d9a34494f54c493ca81), [#&#8203;12671](https://github.com/phpstan/phpstan/issues/12671) - StaticPropertyFetch is an impure point (https://github.com/phpstan/phpstan-src/commit/4111d0f5951338d3fa9735edd8ae38de90d15456) ### [`v1.12.21`](https://github.com/phpstan/phpstan/releases/tag/1.12.21) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.20...1.12.21) # Bugfixes 🐛 - Correctly infer template type from various callables (https://github.com/phpstan/phpstan-src/commit/5920c9861a61851dd81e10495d825910ed5b7960), [#&#8203;12691](https://github.com/phpstan/phpstan/issues/12691) - Fix accepting generic callable in CallableType and ClosureType (https://github.com/phpstan/phpstan-src/commit/0e10531bb0a62d93ee54ae9ccf74079cc0997e88), [#&#8203;12691](https://github.com/phpstan/phpstan/issues/12691), [#&#8203;6828](https://github.com/phpstan/phpstan/issues/6828), [#&#8203;11942](https://github.com/phpstan/phpstan/issues/11942), [#&#8203;11861](https://github.com/phpstan/phpstan/issues/11861), [#&#8203;6828](https://github.com/phpstan/phpstan/issues/6828), [#&#8203;9167](https://github.com/phpstan/phpstan/issues/9167) - Fix generalizing constant arrays when the array is getting smaller (https://github.com/phpstan/phpstan-src/commit/8734057fed407949994e79eb3785cc0bed8f5520), [#&#8203;12658](https://github.com/phpstan/phpstan/issues/12658), [#&#8203;8030](https://github.com/phpstan/phpstan/issues/8030) # Function signature fixes 🤖 - Fix `MongoCollection::findOne()` return type ([#&#8203;3854](https://github.com/phpstan/phpstan-src/pull/3854)), thanks [@&#8203;aivchen](https://github.com/aivchen)! ### [`v1.12.20`](https://github.com/phpstan/phpstan/releases/tag/1.12.20) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.19...1.12.20) # Bugfixes 🐛 - Recreate `@var` PHPDoc type from `Type::toPhpDocNode()` before reporting it as wrong ([#&#8203;3797](https://github.com/phpstan/phpstan-src/pull/3797)), [#&#8203;12458](https://github.com/phpstan/phpstan/issues/12458), [#&#8203;11015](https://github.com/phpstan/phpstan/issues/11015), [#&#8203;10861](https://github.com/phpstan/phpstan/issues/10861), [#&#8203;11535](https://github.com/phpstan/phpstan/issues/11535), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - `FileTypeMapper::getNameScope()` (https://github.com/phpstan/phpstan-src/commit/bca8902dc4ed45e27ba792901a61afeb86414e9d) - MissingTypehintCheck: reduce duplicate work ([#&#8203;3843](https://github.com/phpstan/phpstan-src/pull/3843)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.19`](https://github.com/phpstan/phpstan/releases/tag/1.12.19) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.18...1.12.19) # Improvements 🔧 - Cache the result of `ClassReflection::hasMethod()` method ([#&#8203;3825](https://github.com/phpstan/phpstan-src/pull/3825)), thanks [@&#8203;canvural](https://github.com/canvural)! # Function signature fixes 🤖 - fix `MongoLog::setCallback()` return type ([#&#8203;3829](https://github.com/phpstan/phpstan-src/pull/3829)), thanks [@&#8203;aivchen](https://github.com/aivchen)! - fix `MongoCollection::save()` return type ([#&#8203;3829](https://github.com/phpstan/phpstan-src/pull/3829)), thanks [@&#8203;aivchen](https://github.com/aivchen)! ### [`v1.12.18`](https://github.com/phpstan/phpstan/releases/tag/1.12.18) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.17...1.12.18) # Bugfixes 🐛 - Fix empty regex and empty alternation parse ([#&#8203;3507](https://github.com/phpstan/phpstan-src/pull/3507)), [#&#8203;11762](https://github.com/phpstan/phpstan/issues/11762), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix negative offset false positive on constant string ([#&#8203;3784](https://github.com/phpstan/phpstan-src/pull/3784)), [#&#8203;12122](https://github.com/phpstan/phpstan/issues/12122), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Remove obsolete `setproctitle` function from the functionMap (https://github.com/phpstan/phpstan-src/commit/f5627dcc02aa54d6980d6837e3723885afc0c6dc), [#&#8203;12573](https://github.com/phpstan/phpstan/issues/12573) ### [`v1.12.17`](https://github.com/phpstan/phpstan/releases/tag/1.12.17) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.16...1.12.17) **If you're using `larastan/larastan` PHPStan extension, please update to version 2.9.14 alongside PHPStan 1.12.17 for improved compatibility with the new generic `static<...>` type. Thank you.** # Improvements 🔧 - GenericStaticType - support for `static<...>` ([#&#8203;1289](https://github.com/phpstan/phpstan-src/pull/1289)), [#&#8203;12485](https://github.com/phpstan/phpstan/issues/12485), [#&#8203;11398](https://github.com/phpstan/phpstan/issues/11398), [#&#8203;10417](https://github.com/phpstan/phpstan/issues/10417), [#&#8203;9807](https://github.com/phpstan/phpstan/issues/9807), [#&#8203;9449](https://github.com/phpstan/phpstan/issues/9449), [#&#8203;8623](https://github.com/phpstan/phpstan/issues/8623), [#&#8203;5512](https://github.com/phpstan/phpstan/issues/5512), thanks [@&#8203;canvural](https://github.com/canvural)! # Bugfixes 🐛 - VerbosityLevel - Keep traversing type when we can contain lowercase/upercase strings ([#&#8203;3792](https://github.com/phpstan/phpstan-src/pull/3792)), [#&#8203;12457](https://github.com/phpstan/phpstan/issues/12457), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - FileTypeMapper - fix getting PHPDoc of abstract trait method (https://github.com/phpstan/phpstan-src/commit/2f74584b83506d430404af1197e872b6318d1433) - Inherit PHPDoc implicitly from abstract trait method (https://github.com/phpstan/phpstan-src/commit/b57bcadc279b9845c33d5a52e00d330b0f48aac4), [#&#8203;10240](https://github.com/phpstan/phpstan/issues/10240), [#&#8203;10488](https://github.com/phpstan/phpstan/issues/10488), [#&#8203;12073](https://github.com/phpstan/phpstan/issues/12073) - Fix PHPDoc inheritance from generic trait (https://github.com/phpstan/phpstan-src/commit/49c631a5a6cab485dc87516071fc94c429eb5a6b), [#&#8203;10914](https://github.com/phpstan/phpstan/issues/10914), [#&#8203;9657](https://github.com/phpstan/phpstan/issues/9657) - Standalone null with default value null does not make parameter implicitly nullable (https://github.com/phpstan/phpstan-src/commit/eded2c3a3b8c34232f9eb548f5ab9b0b9a138fac), [#&#8203;12501](https://github.com/phpstan/phpstan/issues/12501) # Internals 🔍 - Refactoring of PhpDocBlock that enabled a bugfix down the road (https://github.com/phpstan/phpstan-src/commit/ebcb5dabec2ff9b8bf54dffcfd63c95b4aeb8526, https://github.com/phpstan/phpstan-src/commit/10388a9b6c403da3ac8d59b92fed9af52a3ca12d) ### [`v1.12.16`](https://github.com/phpstan/phpstan/releases/tag/1.12.16) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.15...1.12.16) # Bugfixes 🐛 - Calling to a constructor with promoted properties has side effects (https://github.com/phpstan/phpstan-src/commit/8b2794326fcfea43111df419a948d197219f589a), [#&#8203;12379](https://github.com/phpstan/phpstan/issues/12379) - Support arrays with union value-types in `implode()` ([#&#8203;3772](https://github.com/phpstan/phpstan-src/pull/3772)), [#&#8203;11854](https://github.com/phpstan/phpstan/issues/11854), thanks [@&#8203;staabm](https://github.com/staabm)! - Avoid false inference with instanceof ([#&#8203;3657](https://github.com/phpstan/phpstan-src/pull/3657)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Casting ArrayObject to array should not lead to array shape (https://github.com/phpstan/phpstan-src/commit/d38ed503c5c9ac19a4233952775daafa14db48f0), [#&#8203;12182](https://github.com/phpstan/phpstan/issues/12182) - Add ArrayChangeKeyCaseFunctionReturnTypeExtension ([#&#8203;3549](https://github.com/phpstan/phpstan-src/pull/3549)), [#&#8203;11795](https://github.com/phpstan/phpstan/issues/11795), [#&#8203;10960](https://github.com/phpstan/phpstan/issues/10960), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - More precise `hash()` return type ([#&#8203;3665](https://github.com/phpstan/phpstan-src/pull/3665)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix union of lowercase/uppercase string with empty string ([#&#8203;3751](https://github.com/phpstan/phpstan-src/pull/3751)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Implement `OpenSslEncryptParameterOutTypeExtension` ([#&#8203;3753](https://github.com/phpstan/phpstan-src/pull/3753)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Update Symfony polyfills (https://github.com/phpstan/phpstan-src/commit/24cdeac08c96cee15817e1d90a14c7521e767913), [#&#8203;12443](https://github.com/phpstan/phpstan/issues/12443) - Inferring `new` from parent constructor - reject types that would fail bound check of the child class (https://github.com/phpstan/phpstan-src/commit/d06f792a9f3630132fec70d7c7322ad7c7898037), [#&#8203;12386](https://github.com/phpstan/phpstan/issues/12386) # Function signature fixes 🤖 - More specific return type for `stream_context_get_params` (https://github.com/phpstan/phpstan-src/commit/ff1feeebbd32dd99983e148eb7b47c907359634b), [#&#8203;11796](https://github.com/phpstan/phpstan/issues/11796) # Internals 🔍 - Makefile: Disable Xdebug in dev tools ([#&#8203;3467](https://github.com/phpstan/phpstan-src/pull/3467)), thanks [@&#8203;staabm](https://github.com/staabm)! - MinMaxFunctionReturnTypeExtension: Cleanup `instanceof ConstantScalarType` ([#&#8203;3773](https://github.com/phpstan/phpstan-src/pull/3773)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.15`](https://github.com/phpstan/phpstan/releases/tag/1.12.15) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.14...1.12.15) # Bugfixes 🐛 - Fix inferring type of `new` with generic type with constructor in parent class (https://github.com/phpstan/phpstan-src/commit/a063119ee422460615adaa7a37bc4c5d2e755971), [#&#8203;8219](https://github.com/phpstan/phpstan/issues/8219), [#&#8203;2735](https://github.com/phpstan/phpstan/issues/2735) - Support tagged unions in `array_merge` ([#&#8203;3770](https://github.com/phpstan/phpstan-src/pull/3770)), [#&#8203;7857](https://github.com/phpstan/phpstan/issues/7857), [#&#8203;8632](https://github.com/phpstan/phpstan/issues/8632), [#&#8203;9559](https://github.com/phpstan/phpstan/issues/9559), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Internals 🔍 - Cleanup `instanceof ConstantBooleanType` checks ([#&#8203;3771](https://github.com/phpstan/phpstan-src/pull/3771)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.14`](https://github.com/phpstan/phpstan/releases/tag/1.12.14) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.13...1.12.14) Fix `preg_match()` group containing start/end meta characters ([#&#8203;3740](https://github.com/phpstan/phpstan-src/pull/3740)), [#&#8203;12297](https://github.com/phpstan/phpstan/issues/12297), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.13`](https://github.com/phpstan/phpstan/releases/tag/1.12.13) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.12...1.12.13) # Improvements 🔧 - `get_defined_vars()` return type contains known variables ([#&#8203;3624](https://github.com/phpstan/phpstan-src/pull/3624)), [#&#8203;11948](https://github.com/phpstan/phpstan/issues/11948), [#&#8203;11740](https://github.com/phpstan/phpstan/issues/11740), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - Lazier return in `UnionType->isSuperTypeOfWithReason()` ([#&#8203;3692](https://github.com/phpstan/phpstan-src/pull/3692), [#&#8203;3713](https://github.com/phpstan/phpstan-src/pull/3713)), thanks [@&#8203;staabm](https://github.com/staabm)! - 5x Faster `IntersectionType->getEnumCases()` ([#&#8203;3695](https://github.com/phpstan/phpstan-src/pull/3695)), thanks [@&#8203;staabm](https://github.com/staabm)! - `MixedType::toArrayKey()` returns `BenevolentUnionType` ([#&#8203;3696](https://github.com/phpstan/phpstan-src/pull/3696)) - Optimization - do not enter anonymous classes during loop analysis (https://github.com/phpstan/phpstan-src/commit/621e16829817e412f948420f24640971ee84e667) - Introduce `ClassAsClassConstantRule` ([#&#8203;3697](https://github.com/phpstan/phpstan-src/pull/3697)), [#&#8203;10859](https://github.com/phpstan/phpstan/issues/10859), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - 10% faster `FunctionCallParametersCheck` ([#&#8203;3734](https://github.com/phpstan/phpstan-src/pull/3734)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster `MutatingScope::getNodeKey()` ([#&#8203;3736](https://github.com/phpstan/phpstan-src/pull/3736)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix `iterator_to_array` return type with generators ([#&#8203;3652](https://github.com/phpstan/phpstan-src/pull/3652)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Array map on multiple elements is a list ([#&#8203;3716](https://github.com/phpstan/phpstan-src/pull/3716)), [#&#8203;12223](https://github.com/phpstan/phpstan/issues/12223), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - RegexArrayShapeMatcher: fix regex wildcard omitted from type ([#&#8203;3721](https://github.com/phpstan/phpstan-src/pull/3721)), [#&#8203;12211](https://github.com/phpstan/phpstan/issues/12211), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher: fix regex alternatives in capture group are concatenated ([#&#8203;3722](https://github.com/phpstan/phpstan-src/pull/3722)), [#&#8203;12210](https://github.com/phpstan/phpstan/issues/12210), [#&#8203;12173](https://github.com/phpstan/phpstan/issues/12173), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher: Don't narrow 'J' modifier ([#&#8203;3723](https://github.com/phpstan/phpstan-src/pull/3723)), [#&#8203;12126](https://github.com/phpstan/phpstan/issues/12126), thanks [@&#8203;staabm](https://github.com/staabm)! - Add support for internal classes that overload offset access ([#&#8203;3725](https://github.com/phpstan/phpstan-src/pull/3725)), [#&#8203;12235](https://github.com/phpstan/phpstan/issues/12235), thanks [@&#8203;Girgias](https://github.com/Girgias)! - Support `#` comments in regex with `x` modifier ([#&#8203;3735](https://github.com/phpstan/phpstan-src/pull/3735), [#&#8203;3739](https://github.com/phpstan/phpstan-src/pull/3739)), [#&#8203;12242](https://github.com/phpstan/phpstan/issues/12242), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - More precise reflection classes return types ([#&#8203;3731](https://github.com/phpstan/phpstan-src/pull/3731)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `DOMDocument::create*()` return types ([#&#8203;3737](https://github.com/phpstan/phpstan-src/pull/3737)), [#&#8203;12278](https://github.com/phpstan/phpstan/issues/12278), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Add regression test for array self-append ([#&#8203;3715](https://github.com/phpstan/phpstan-src/pull/3715)), [#&#8203;6948](https://github.com/phpstan/phpstan/issues/6948), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use native PHPDocs for `Rule` and `RuleTestCase` ([#&#8203;3698](https://github.com/phpstan/phpstan-src/pull/3698)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Use native PHPDocs wherever possible ([#&#8203;3720](https://github.com/phpstan/phpstan-src/pull/3720)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Added regression test ([#&#8203;3722](https://github.com/phpstan/phpstan-src/pull/3722)), [#&#8203;12210](https://github.com/phpstan/phpstan/issues/12210), [#&#8203;12173](https://github.com/phpstan/phpstan/issues/12173), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.12`](https://github.com/phpstan/phpstan/releases/tag/1.12.12) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.11...1.12.12) # Improvements 🔧 - Introduce `uppercase-string` PHPDoc type ([#&#8203;3613](https://github.com/phpstan/phpstan-src/pull/3613)), thanks [@&#8203;pmjones](https://github.com/pmjones)! # Bugfixes 🐛 - Fix `sprintf` dynamic return type ([#&#8203;3640](https://github.com/phpstan/phpstan-src/pull/3640)), [#&#8203;12065](https://github.com/phpstan/phpstan/issues/12065), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Patch wrong namespace prefixing in PHAR in WindowsRegistryLogicalFinder (https://github.com/phpstan/phpstan-src/commit/f61d3247db160c875a2e1893aaee519963830f99), [#&#8203;12076](https://github.com/phpstan/phpstan/issues/12076) - Fix `static` return type in php-8-stubs (https://github.com/phpstan/phpstan-src/commit/162f774858b461b9cc89f0c604c798381053dc32), [#&#8203;12077](https://github.com/phpstan/phpstan/issues/12077) - Retain list type when assigning to offset 1 of `non-empty-list` ([#&#8203;3682](https://github.com/phpstan/phpstan-src/pull/3682)), [#&#8203;12131](https://github.com/phpstan/phpstan/issues/12131), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Function signature fixes 🤖 - `Closure::bind` and `bindTo` return benevolent union with null (https://github.com/phpstan/phpstan-src/commit/b049d8d7d7e25df00c80b1ec585beb2dd2896123) - Remove `sha256` function definition ([#&#8203;3664](https://github.com/phpstan/phpstan-src/pull/3664)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.11`](https://github.com/phpstan/phpstan/releases/tag/1.12.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.10...1.12.11) # Improvements 🔧 - Update `fidry/cpu-core-counter` ([#&#8203;3632](https://github.com/phpstan/phpstan-src/pull/3632)), https://github.com/phpstan/phpstan/discussions/12026 - Add `TypeCombinator::removeTruthy()` method ([#&#8203;3633](https://github.com/phpstan/phpstan-src/pull/3633)), thanks [@&#8203;canvural](https://github.com/canvural)! - Add basic type narrowing for `$a != ''` ([#&#8203;3304](https://github.com/phpstan/phpstan-src/pull/3304)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Use the correct type for final constants ([#&#8203;3638](https://github.com/phpstan/phpstan-src/pull/3638)), thanks [@&#8203;thg2k](https://github.com/thg2k)! # Bugfixes 🐛 - Fix resolving class constant type using `self::` in a class attribute argument (https://github.com/phpstan/phpstan-src/commit/3447391001f7a5c2bfb77f66c2d0e157242c1dae), [#&#8203;12011](https://github.com/phpstan/phpstan/issues/12011), [#&#8203;10314](https://github.com/phpstan/phpstan/issues/10314) - Do not report nonexistent variable passed to by-ref parameter with checkImplicitMixed (level 10 in 2.0) (https://github.com/phpstan/phpstan-src/commit/f158d5bf32135d90a31f14993a3d2196cb456b3b), [#&#8203;12015](https://github.com/phpstan/phpstan/issues/12015) - Add `null` to `array_map(null, $a, $b)` ([#&#8203;3562](https://github.com/phpstan/phpstan-src/pull/3562)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix `ArrayType<mixed, X>` with `checkImplicitMixed` (level 10 in 2.0) ([#&#8203;3636](https://github.com/phpstan/phpstan-src/pull/3636)), [#&#8203;12051](https://github.com/phpstan/phpstan/issues/12051), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - Fix `extract()` signature ([#&#8203;3512](https://github.com/phpstan/phpstan-src/pull/3512)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve signature for `get_defined_constants()` ([#&#8203;3635](https://github.com/phpstan/phpstan-src/pull/3635)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - `fgetcsv` accepts `null` for `$length` ([#&#8203;3077](https://github.com/phpstan/phpstan-src/pull/3077)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.10`](https://github.com/phpstan/phpstan/releases/tag/1.12.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.9...1.12.10) # Bugfixes 🐛 - ClassReflection: resolve missing template type to its default (if set) rather than bound ([#&#8203;3623](https://github.com/phpstan/phpstan-src/pull/3623)), [#&#8203;11899](https://github.com/phpstan/phpstan/issues/11899), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Fix `for` endless loop detection ([#&#8203;3622](https://github.com/phpstan/phpstan-src/pull/3622)), [#&#8203;11992](https://github.com/phpstan/phpstan/issues/11992), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix tagging Docker image (https://github.com/phpstan/phpstan/commit/379b9a230ededc558195620de0f31d251bbe6166) ### [`v1.12.9`](https://github.com/phpstan/phpstan/releases/tag/1.12.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.8...1.12.9) # Improvements 🔧 - Support `@readonly` PHPDoc on the class as alternative to `@immutable` ([#&#8203;3523](https://github.com/phpstan/phpstan-src/pull/3523)), [#&#8203;11775](https://github.com/phpstan/phpstan/issues/11775), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Fix too early lowercase-string inference ([#&#8203;3585](https://github.com/phpstan/phpstan-src/pull/3585)), [#&#8203;11852](https://github.com/phpstan/phpstan/issues/11852), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Support `for` endless loops ([#&#8203;3573](https://github.com/phpstan/phpstan-src/pull/3573)), [#&#8203;6807](https://github.com/phpstan/phpstan/issues/6807), [#&#8203;8463](https://github.com/phpstan/phpstan/issues/8463), [#&#8203;9374](https://github.com/phpstan/phpstan/issues/9374), thanks [@&#8203;herndlm](https://github.com/herndlm)! - More precise types for `preg_match` greater than `0` ([#&#8203;3612](https://github.com/phpstan/phpstan-src/pull/3612)), [#&#8203;11293](https://github.com/phpstan/phpstan/issues/11293), thanks [@&#8203;staabm](https://github.com/staabm)! - Too-wide return type - do not report void in PHPDoc union type (https://github.com/phpstan/phpstan-src/commit/5f0b1ccfa47060c209ead7116005214183c0e56f), [#&#8203;11980](https://github.com/phpstan/phpstan/issues/11980) - Too-wide return type - allow `void` return type in a union when the returned expr is originally `void` (https://github.com/phpstan/phpstan-src/commit/80c1df2d73210227776db5443dbc28c2d71fa289), [#&#8203;11980](https://github.com/phpstan/phpstan/issues/11980) - RichParser - fix `@phpstan-ignore` with trait in the same file (https://github.com/phpstan/phpstan-src/commit/381c1370e7ce3b1c2d8de6c5b30913908c362eb8), [#&#8203;11981](https://github.com/phpstan/phpstan/issues/11981) # Internals 🔍 - Result DTOs - make reasons unique (https://github.com/phpstan/phpstan-src/commit/ccfb4ab7a19151925b9434e3245892006b3d9dcd) ### [`v1.12.8`](https://github.com/phpstan/phpstan/releases/tag/1.12.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.7...1.12.8) # Improvements 🔧 - OffsetAccessValueAssignmentRule optimization for huge arrays (https://github.com/phpstan/phpstan-src/commit/a07996a9cad15c0c6e6e8fd57338236734a5c0dd) - Fix performance issue with big appended arrays (https://github.com/phpstan/phpstan-src/commit/537c12c0c3f14371ceaf59051fc5445339857a97), [#&#8203;11913](https://github.com/phpstan/phpstan/issues/11913) - processAssignVar optimization for arrays (https://github.com/phpstan/phpstan-src/commit/16f63b3a48105ddce37d816e157f004fe9164cf9), - Another micro optimization (https://github.com/phpstan/phpstan-src/commit/c04555b9387dea448a5649348546e9629063dda8) - Optimization of huge unions of oversized arrays (https://github.com/phpstan/phpstan-src/commit/4dfbe16ed9cdf0808027f3bcbdb26980ec39df3f) - Avoid new HasOffsetValueType being intersected with oversized array (https://github.com/phpstan/phpstan-src/commit/deef91983766dd61c18d4f9d819ffc94fb701cd5) - Add ArrayFindFunctionReturnTypeExtension (PHP 8.4) ([#&#8203;3518](https://github.com/phpstan/phpstan-src/pull/3518), [#&#8203;3608](https://github.com/phpstan/phpstan-src/pull/3608)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Do not transform `$this` in return type even in final classes ([#&#8203;3599](https://github.com/phpstan/phpstan-src/pull/3599)), [#&#8203;11857](https://github.com/phpstan/phpstan/issues/11857), thanks [@&#8203;calebdw](https://github.com/calebdw)! - Exclude `E_DEPRECATED` from error_reporting (https://github.com/phpstan/phpstan-src/commit/277e34b23a43b7ff0cca0c141789d0a786690e9b), [#&#8203;11937](https://github.com/phpstan/phpstan/issues/11937) - More precise types in immediately invoked callables ([#&#8203;3593](https://github.com/phpstan/phpstan-src/pull/3593), [#&#8203;3602](https://github.com/phpstan/phpstan-src/pull/3602)), [#&#8203;11561](https://github.com/phpstan/phpstan/issues/11561), [#&#8203;11945](https://github.com/phpstan/phpstan/issues/11945), thanks [@&#8203;staabm](https://github.com/staabm)! - Only use last for condition to filter scope ([#&#8203;3578](https://github.com/phpstan/phpstan-src/pull/3578)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Preserve correct UnionType subclass in `filterTypes()` ([#&#8203;3535](https://github.com/phpstan/phpstan-src/pull/3535)), [#&#8203;11663](https://github.com/phpstan/phpstan/issues/11663), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - `Imagick::writeImage(s)File` supporting `format` parameter ([#&#8203;3588](https://github.com/phpstan/phpstan-src/pull/3588)), thanks [@&#8203;kingjia90](https://github.com/kingjia90)! # Internals 🔍 - Remove unnecessary `instanceof ConstantBooleanType` in loop analysis ([#&#8203;3577](https://github.com/phpstan/phpstan-src/pull/3577)), [#&#8203;11913](https://github.com/phpstan/phpstan/issues/11913), thanks [@&#8203;herndlm](https://github.com/herndlm)! - NodeScopeResolver - refactoring before optimization (https://github.com/phpstan/phpstan-src/commit/1a0099dc61674ff1eb0ef8d68c90011f2206a64b) - Add `@api` to TypeExpr ([#&#8203;3601](https://github.com/phpstan/phpstan-src/pull/3601)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Split ArrayFilterFunctionReturnTypeExtension to Helper ([#&#8203;3606](https://github.com/phpstan/phpstan-src/pull/3606)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Introduce `UnionType::filterTypes` ([#&#8203;3607](https://github.com/phpstan/phpstan-src/pull/3607)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.7`](https://github.com/phpstan/phpstan/releases/tag/1.12.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.6...1.12.7) # Major new features 🚀 - **Implement template default types** ([#&#8203;3457](https://github.com/phpstan/phpstan-src/pull/3457)), [#&#8203;4801](https://github.com/phpstan/phpstan/issues/4801), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - See https://x.com/OndrejMirtes/status/1843920480342057154 # Improvements 🔧 - Move result cache output from debug (`-vvv`) to very verbose (`-vv`) mode ([#&#8203;3345](https://github.com/phpstan/phpstan-src/pull/3345)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Support for `non-empty-array` and `non-empty-list` array shape kind (https://github.com/phpstan/phpstan-src/commit/107a7e38e2173d8b8b4f18e5d592fc8ead02b96a) - Improve lowercase string verbosity level ([#&#8203;3567](https://github.com/phpstan/phpstan-src/pull/3567)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Show TypeResult reasons in StrictComparisonOfDifferentTypesRule (https://github.com/phpstan/phpstan-src/commit/34bacd74410573cf79754348231849b474b7312e) - Decorate reasons when comparing ConstantArrayType (https://github.com/phpstan/phpstan-src/commit/dc5d8f4d3eef18b1d80b8ffb3a1adfe8de6d7268), [#&#8203;11799](https://github.com/phpstan/phpstan/issues/11799), [#&#8203;10421](https://github.com/phpstan/phpstan/issues/10421) # Bugfixes 🐛 - Fix nextAutoIndexes in array coming from ArrayCombineFunctionReturnTypeExtension (https://github.com/phpstan/phpstan-src/commit/c4ba43462cecb03ef57805ffd683f77d57b79a4a), [#&#8203;11819](https://github.com/phpstan/phpstan/issues/11819) - Fix return type of `array_reverse()` with optional keys ([#&#8203;3406](https://github.com/phpstan/phpstan-src/pull/3406)), [#&#8203;11549](https://github.com/phpstan/phpstan/issues/11549), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Try to quit the child process only after internal errors were accounted for (https://github.com/phpstan/phpstan-src/commit/dcd69eba14ed57b32c2f1b759cd8289772f364ac), [#&#8203;11826](https://github.com/phpstan/phpstan/issues/11826) - react/http PHP 8.4 patch (https://github.com/phpstan/phpstan-src/commit/40e461d2e8dff171cdf588e380eb20e782e94eb1) # Function signature fixes 🤖 - functionMap: more precise `get_defined_vars()` ([#&#8203;3546](https://github.com/phpstan/phpstan-src/pull/3546)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Reflection `getAttributes` returns `list` ([#&#8203;3548](https://github.com/phpstan/phpstan-src/pull/3548)), thanks [@&#8203;ManuelHu](https://github.com/ManuelHu)! - More precise md5/sha1 return type ([#&#8203;3541](https://github.com/phpstan/phpstan-src/pull/3541)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve return type of token_name() and PhpToken::getTokenName() ([#&#8203;3558](https://github.com/phpstan/phpstan-src/pull/3558)), [#&#8203;11808](https://github.com/phpstan/phpstan/issues/11808), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Internals 🔍 - Fix typo (https://github.com/phpstan/phpstan-src/commit/5b43d5004648ded12d5a635db9bb82c56efc2c11) - Introduce isSuperTypeOfWithReason ([#&#8203;3538](https://github.com/phpstan/phpstan-src/pull/3538)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Add function `PHPStan\dumpPhpDocType()` ([#&#8203;3559](https://github.com/phpstan/phpstan-src/pull/3559)), [#&#8203;11561](https://github.com/phpstan/phpstan/issues/11561), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Introduce TypeResult (https://github.com/phpstan/phpstan-src/commit/a815d575dc10616e510713e01627369b10980d31) ### [`v1.12.6`](https://github.com/phpstan/phpstan/releases/tag/1.12.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.5...1.12.6) # Bleeding edge 🔪 - Added absent type checks about `@phpstan-assert` PHPDoc tags (https://github.com/phpstan/phpstan-src/commit/ca0a7e9955397eef453b38c94ac67ba6faf7356b), [#&#8203;11780](https://github.com/phpstan/phpstan/issues/11780) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Update nikic/php-parser to v4.19.4 (https://github.com/phpstan/phpstan-src/commit/0b9ce98cfad4a1f7e98e85c2cbd813025dbafa77) - Process `ClassConstFetch::$class` when it's a Name node (https://github.com/phpstan/phpstan-src/commit/712c33e02ea2d95542cd333a493e276b22399773) - Process `ClassConstFetch::$name` (https://github.com/phpstan/phpstan-src/commit/b38c852c7c9e1e49baa0dc8700dd13df531d0938) - Fix unused private property is not sometimes detected ([#&#8203;3539](https://github.com/phpstan/phpstan-src/pull/3539)), [#&#8203;11802](https://github.com/phpstan/phpstan/issues/11802), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fixes for `lowercase-string` - Keep lowercase when trim ([#&#8203;3491](https://github.com/phpstan/phpstan-src/pull/3491)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Add support for str_repeat and str_pad for lowercase string ([#&#8203;3490](https://github.com/phpstan/phpstan-src/pull/3490)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update ReplaceFunctionsDynamicReturnTypeExtension for lowercase-string ([#&#8203;3489](https://github.com/phpstan/phpstan-src/pull/3489)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update parse_str for lowercase string ([#&#8203;3492](https://github.com/phpstan/phpstan-src/pull/3492)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - More precise `IntegerRangeType::toString()` ([#&#8203;3475](https://github.com/phpstan/phpstan-src/pull/3475)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add support for lowercase-string on parse_url() ([#&#8203;3493](https://github.com/phpstan/phpstan-src/pull/3493)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve Vsprintf inference ([#&#8203;3496](https://github.com/phpstan/phpstan-src/pull/3496), [#&#8203;3501](https://github.com/phpstan/phpstan-src/pull/3501)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Offset access on lowercase-string is lowercase-string ([#&#8203;3502](https://github.com/phpstan/phpstan-src/pull/3502)), thanks [@&#8203;staabm](https://github.com/staabm)! - IntegerType::toString() is lowercase ([#&#8203;3510](https://github.com/phpstan/phpstan-src/pull/3510)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Handle lowercase string in sprintf ([#&#8203;3498](https://github.com/phpstan/phpstan-src/pull/3498)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update composer/pcre (https://github.com/phpstan/phpstan-src/commit/3cdac94e67bf8e508b150e9ee0e3075b3105ad19), [#&#8203;11786](https://github.com/phpstan/phpstan/issues/11786) - Fix a few regex class parsing usecases ([#&#8203;3488](https://github.com/phpstan/phpstan-src/pull/3488)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix preg_match_all with PREG_SET_ORDER does not see capture group as optional ([#&#8203;3506](https://github.com/phpstan/phpstan-src/pull/3506)), [#&#8203;11661](https://github.com/phpstan/phpstan/issues/11661), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix false-positive with preg_match(): Strict comparison using === between '' and non-falsy-string…ween '' and non-falsy-string ([#&#8203;3509](https://github.com/phpstan/phpstan-src/pull/3509)), [#&#8203;11744](https://github.com/phpstan/phpstan/issues/11744), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - functionMap: a bit more precise get_defined_constants ([#&#8203;3537](https://github.com/phpstan/phpstan-src/pull/3537)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - token_name() returns non-empty-string ([#&#8203;3540](https://github.com/phpstan/phpstan-src/pull/3540)), thanks [@&#8203;staabm](https://github.com/staabm)! - curl_multi_getcontent() can return null ([#&#8203;3527](https://github.com/phpstan/phpstan-src/pull/3527)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update SplFileInfo::getPathInfo return type ([#&#8203;3487](https://github.com/phpstan/phpstan-src/pull/3487)), thanks [@&#8203;DannyvdSluijs](https://github.com/DannyvdSluijs)! - Update return type of `spl_autoload_functions` on PHP8.0+ ([#&#8203;2810](https://github.com/phpstan/phpstan-src/pull/2810)), thanks [@&#8203;ManuelHu](https://github.com/ManuelHu)! # Internals 🔍 - Fix missing ltrim in regex parse ([#&#8203;3495](https://github.com/phpstan/phpstan-src/pull/3495)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Un-deprecate ConstantTypeHelper (https://github.com/phpstan/phpstan-src/commit/3a83f6bec7eb4724d4f1b6c2dedbfe46c0b1112a) - Introduce `Scope::getMaybeDefinedVariables()` ([#&#8203;3521](https://github.com/phpstan/phpstan-src/pull/3521)), [#&#8203;11772](https://github.com/phpstan/phpstan/issues/11772), thanks [@&#8203;ruudk](https://github.com/ruudk)! - TypeInferenceTestCase: allow asserting array offset certainty ([#&#8203;3503](https://github.com/phpstan/phpstan-src/pull/3503)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Simplify preserveKeys TrinaryLogic creation in two extensions ([#&#8203;3516](https://github.com/phpstan/phpstan-src/pull/3516)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::sliceArray()` ([#&#8203;3514](https://github.com/phpstan/phpstan/issues/3514)) ([#&#8203;3514](https://github.com/phpstan/phpstan-src/pull/3514)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Set normalized in BenevolentUnionType ([#&#8203;3522](https://github.com/phpstan/phpstan-src/pull/3522)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Refactor RegexGroupParser for more immutability and less pass-by-ref ([#&#8203;3508](https://github.com/phpstan/phpstan-src/pull/3508)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.5`](https://github.com/phpstan/phpstan/releases/tag/1.12.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.4...1.12.5) # Improvements 🔧 - Deprecate `ParametersAcceptorSelector::selectSingle()` (https://github.com/phpstan/phpstan-src/commit/23c53a2210b715f672ad3087dd476faf34bdec6e) - See: https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md#removed-deprecated-parametersacceptorselectorselectsingle - Introduce `lowercase-string` ([#&#8203;3438](https://github.com/phpstan/phpstan-src/pull/3438)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - More precise mixed-type subtraction in `toInteger()` ([#&#8203;3434](https://github.com/phpstan/phpstan-src/pull/3434)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `MixedType::toString()` with subtracted type ([#&#8203;3420](https://github.com/phpstan/phpstan-src/pull/3420)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `MixedType::toBoolean()` with subtracted type ([#&#8203;3471](https://github.com/phpstan/phpstan-src/pull/3471)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve loose comparison for integer ranges ([#&#8203;3465](https://github.com/phpstan/phpstan-src/pull/3465)), [#&#8203;11694](https://github.com/phpstan/phpstan/issues/11694), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Truthy `isset($arr[$k])` should narrow `$k` ([#&#8203;3453](https://github.com/phpstan/phpstan-src/pull/3453)), [#&#8203;11716](https://github.com/phpstan/phpstan/issues/11716), [#&#8203;8559](https://github.com/phpstan/phpstan/issues/8559), thanks [@&#8203;staabm](https://github.com/staabm)! - `isset()` narrows string-key in int-keyed-array to numeric-string ([#&#8203;3472](https://github.com/phpstan/phpstan-src/pull/3472)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Add generic types for array_values ([#&#8203;3456](https://github.com/phpstan/phpstan-src/pull/3456)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Support IntegerRangeType in ConstantStringType offset-value-type handling ([#&#8203;3462](https://github.com/phpstan/phpstan-src/pull/3462)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix bug with oversized array ([#&#8203;3461](https://github.com/phpstan/phpstan-src/pull/3461)), [#&#8203;11703](https://github.com/phpstan/phpstan/issues/11703), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix ErrorType after ArrayDimFetch ([#&#8203;3460](https://github.com/phpstan/phpstan-src/pull/3460)), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement ClosureType::getReferencedTemplateTypes() ([#&#8203;3458](https://github.com/phpstan/phpstan-src/pull/3458)), [#&#8203;10609](https://github.com/phpstan/phpstan/issues/10609), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Fix substracted union type describe ([#&#8203;3360](https://github.com/phpstan/phpstan-src/pull/3360)), [#&#8203;10227](https://github.com/phpstan/phpstan/issues/10227), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix including relative path (https://github.com/phpstan/phpstan-src/commit/098fb9416779240fab9b2dea1ee730da69668014), [#&#8203;11738](https://github.com/phpstan/phpstan/issues/11738) - Fix `sprintf()` inference for constant values with format-width in pattern ([#&#8203;3474](https://github.com/phpstan/phpstan-src/pull/3474)), thanks [@&#8203;staabm](https://github.com/staabm)! - Drop wrong float comparison for `filter_var()` ([#&#8203;2656](https://github.com/phpstan/phpstan-src/pull/2656)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! # Function signature fixes 🤖 - Change `iptcparse` return type ([#&#8203;3483](https://github.com/phpstan/phpstan-src/pull/3483)), thanks [@&#8203;ManuelHu](https://github.com/ManuelHu)! # Internals 🔍 - More specific return type for methods used to analyse currently entered function or method (https://github.com/phpstan/phpstan-src/commit/0e2587fae6e65be54ecbd47d33277d3f529d44d1) - PhpFunctionFromParserNodeReflection becomes ParametersAcceptorWithPhpDocs (https://github.com/phpstan/phpstan-src/commit/1bea5c79d53e06f6cdd481decba73b504fb4bec0) - Use methods directly on PhpFunctionFromParserNodeReflection instead of `selectSingle()` when analysing function body in rules (https://github.com/phpstan/phpstan-src/commit/41916ba39d429d096d5234acedcfe75f22025785) - Use methods directly on PhpFunctionFromParserNodeReflection instead of `selectSingle()` in MutatingScope (https://github.com/phpstan/phpstan-src/commit/865c618f82030cbc2e915c6da6bd424bc9b8aa41) - Use `ParametersAcceptorSelector::selectFromArgs()` instead of `selectSingle()` wherever possible (https://github.com/phpstan/phpstan-src/commit/e283d3a6df7df502f3c3e70bc086dd2018dc965b) - Use PhpFunctionFromParserNodeReflection as ParametersAcceptor in DependencyResolver (https://github.com/phpstan/phpstan-src/commit/7e216a274f00bf0a77a72628c884fdd4cb6c24c6) - Use methods directly on PhpFunctionFromParserNodeReflection instead of `selectSingle()` in ParametersAcceptorSelector (https://github.com/phpstan/phpstan-src/commit/1322aaf1d029c8db49c4c72742cb3d46f56be132) - Introduce `@internal` `getOnlyVariant()` method on FunctionReflection/ExtendedMethodReflection to use instead of `selectSingle()` (https://github.com/phpstan/phpstan-src/commit/714877be8cafc1ba08610929e4dcb0d43273cc8d) - Add `Type::chunkArray()` ([#&#8203;3408](https://github.com/phpstan/phpstan-src/pull/3408)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add more mixed-type bool subtraction tests ([#&#8203;3421](https://github.com/phpstan/phpstan-src/pull/3421)), thanks [@&#8203;staabm](https://github.com/staabm)! - Made IssetExpr part of BC promise (https://github.com/phpstan/phpstan-src/commit/5677025877c6a8aef51b500cd461e8dbda6dab8c) - Refactor RegexGroupParser for more immutability and less pass-by-ref ([#&#8203;3479](https://github.com/phpstan/phpstan-src/pull/3479)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.4`](https://github.com/phpstan/phpstan/releases/tag/1.12.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.3...1.12.4) # Improvements 🔧 - Special internal error message for Larastan & Laravel (https://github.com/phpstan/phpstan-src/commit/475a18ce8e0e14e340d7a0939906fffa6dd28e8d), [#&#8203;11641](https://github.com/phpstan/phpstan/issues/11641) - Do not truncate offset key in error tip message ([#&#8203;3437](https://github.com/phpstan/phpstan-src/pull/3437)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Errors with `argument.named` are ignorable now (https://github.com/phpstan/phpstan-src/commit/193b4f518d53eb3648b09ff131f83979067fec59) - Normalize path in TypeInferenceTestCase ([#&#8203;3449](https://github.com/phpstan/phpstan-src/pull/3449)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix duplicate paths in `composerAutoloaderProjectPaths` on Windows ([#&#8203;3451](https://github.com/phpstan/phpstan-src/pull/3451)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update nikic/php-parser to 4.19.2 (https://github.com/phpstan/phpstan-src/commit/05630e67fa3809191253e660765573263daab2b9) - Allow toggling `treatPhpDocTypesAsCertain` tip ([#&#8203;3452](https://github.com/phpstan/phpstan-src/pull/3452)), [#&#8203;11689](https://github.com/phpstan/phpstan/issues/11689), thanks [@&#8203;ruudk](https://github.com/ruudk)! # Bugfixes 🐛 - Fix conditional types in `array_map()` return value ([#&#8203;3425](https://github.com/phpstan/phpstan-src/pull/3425)), [#&#8203;10715](https://github.com/phpstan/phpstan/issues/10715), [#&#8203;11056](https://github.com/phpstan/phpstan/issues/11056), [#&#8203;10685](https://github.com/phpstan/phpstan/issues/10685), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix false positive when extending SplObjectStorage on PHP < 8.4 by updating BetterReflection (https://github.com/Roave/BetterReflection/pull/1448, https://github.com/phpstan/phpstan-src/commit/fd25c2779ca7fd4decee7038282ab9743b16d167), [#&#8203;11665](https://github.com/phpstan/phpstan/issues/11665), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Prevent warning in `range()` on PHP 7.x ([#&#8203;3424](https://github.com/phpstan/phpstan-src/pull/3424)), thanks [@&#8203;staabm](https://github.com/staabm)! - Process expression assignments other than Variable in by-ref parameters (https://github.com/phpstan/phpstan-src/commit/d3a2a92fcd612bf42bbfd19cd3a5625481ff7522), [#&#8203;11667](https://github.com/phpstan/phpstan/issues/11667), [#&#8203;8781](https://github.com/phpstan/phpstan/issues/8781) - Allow nonexistent other-than-Variable expressions in by-ref parameters (https://github.com/phpstan/phpstan-src/commit/00d2caf39514380610899b0a305413f60c1c5830), [#&#8203;11617](https://github.com/phpstan/phpstan/issues/11617), [#&#8203;5077](https://github.com/phpstan/phpstan/issues/5077), [#&#8203;9361](https://github.com/phpstan/phpstan/issues/9361), [#&#8203;7251](https://github.com/phpstan/phpstan/issues/7251), [#&#8203;2313](https://github.com/phpstan/phpstan/issues/2313), [#&#8203;11655](https://github.com/phpstan/phpstan/issues/11655), [#&#8203;2634](https://github.com/phpstan/phpstan/issues/2634) - Fix false positive when type casting in If\_ statement ([#&#8203;3431](https://github.com/phpstan/phpstan-src/pull/3431)), [#&#8203;11674](https://github.com/phpstan/phpstan/issues/11674), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify abs return type ([#&#8203;3433](https://github.com/phpstan/phpstan-src/pull/3433)), [#&#8203;9224](https://github.com/phpstan/phpstan/issues/9224), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix late static binding calls ([#&#8203;3361](https://github.com/phpstan/phpstan-src/pull/3361)), [#&#8203;10469](https://github.com/phpstan/phpstan/issues/10469), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix string types sorting ([#&#8203;3441](https://github.com/phpstan/phpstan-src/pull/3441)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - RegexArrayShapeMatcher - Fix matching literal dot character ([#&#8203;3444](https://github.com/phpstan/phpstan-src/pull/3444)), [#&#8203;11699](https://github.com/phpstan/phpstan/issues/11699), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix infer new templated type from initial assign into static property ([#&#8203;3364](https://github.com/phpstan/phpstan-src/pull/3364)), [#&#8203;5551](https://github.com/phpstan/phpstan/issues/5551), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - `range()` with float step should return an array of floats ([#&#8203;3447](https://github.com/phpstan/phpstan-src/pull/3447)), [#&#8203;11692](https://github.com/phpstan/phpstan/issues/11692), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow string on `*strlen()` with positive-int ([#&#8203;3407](https://github.com/phpstan/phpstan-src/pull/3407)), [#&#8203;11558](https://github.com/phpstan/phpstan/issues/11558), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix late static binding calls for first class callable ([#&#8203;3435](https://github.com/phpstan/phpstan-src/pull/3435)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - E_ALL value is different on PHP 8.4 (https://github.com/phpstan/phpstan-src/commit/cb8f9103f4191f176d1b52cc45f661c3326f194f) # Function signature fixes 🤖 - Fix SplObjectStorage generic stub for PHP 8.4 (https://github.com/phpstan/phpstan-src/commit/9d9fb560907fcd4f6dd16789af4278ac7f683736) # Internals 🔍 - Extract getMessageFromInternalError (https://github.com/phpstan/phpstan-src/commit/d047c7f8ef8da296d0498696635735eed1762a4e) - Optimize NodeScopeResolverTest when running with `paratest` ([#&#8203;3440](https://github.com/phpstan/phpstan-src/pull/3440)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Expose `Output::isDecorated` and `Output::isVeryVerbose` ([#&#8203;3436](https://github.com/phpstan/phpstan-src/pull/3436)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Simplify SubstrDynamicReturnTypeExtension ([#&#8203;3439](https://github.com/phpstan/phpstan-src/pull/3439)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - CollectedDataNode is VirtualNode (https://github.com/phpstan/phpstan-src/commit/2d613997f5a9298b2446d1a0b2f01a565ed8a457) ### [`v1.12.3`](https://github.com/phpstan/phpstan/releases/tag/1.12.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.2...1.12.3) # Improvements 🔧 - PHPStan Pro: debug corrupted PHAR signature message (https://github.com/phpstan/phpstan-src/commit/9815bbba4535b0605aef5b5cb9dd64a63bc44b1f) # Bugfixes 🐛 - Revert "Fix phar.yml workflow" (https://github.com/phpstan/phpstan-src/commit/6973519742ab804f57885c099b74971f465c7b24), [#&#8203;11638](https://github.com/phpstan/phpstan/issues/11638) - Refactor `ArrayFilterFunctionReturnTypeReturnTypeExtension` and support first-class callable ([#&#8203;3329](https://github.com/phpstan/phpstan-src/pull/3329)), [#&#8203;11337](https://github.com/phpstan/phpstan/issues/11337), thanks [@&#8203;takaram](https://github.com/takaram)! - Prevent resolving conditional types in callable param/return types ([#&#8203;3405](https://github.com/phpstan/phpstan-src/pull/3405)), [#&#8203;11472](https://github.com/phpstan/phpstan/issues/11472), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix wrongly convertion of `list<T>` to `array{T}` ([#&#8203;3412](https://github.com/phpstan/phpstan-src/pull/3412)), [#&#8203;11642](https://github.com/phpstan/phpstan/issues/11642), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix internal error (https://github.com/phpstan/phpstan-src/commit/052f6b130f53ad50f571b81d4d468b0b0026c2fd), [#&#8203;11649](https://github.com/phpstan/phpstan/issues/11649) - Missing typehints should be consistently checked on level 6 (https://github.com/phpstan/phpstan-src/commit/e3e80f6c9c246d13e41188d508f0f4afb631b9af), [#&#8203;11657](https://github.com/phpstan/phpstan/issues/11657) # Function signature fixes 🤖 - Don't prevent checking for `curl_init()` false returns ([#&#8203;3409](https://github.com/phpstan/phpstan-src/pull/3409)), [#&#8203;11640](https://github.com/phpstan/phpstan/issues/11640), thanks [@&#8203;tscni](https://github.com/tscni)! - Update phpstorm-stubs and patch ([#&#8203;3393](https://github.com/phpstan/phpstan-src/pull/3393)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - The `COMPOSER_ROOT_VERSION` hack should no longer be necessary ([#&#8203;3414](https://github.com/phpstan/phpstan-src/pull/3414)) - Add non regression test ([#&#8203;3416](https://github.com/phpstan/phpstan-src/pull/3416)), [#&#8203;4960](https://github.com/phpstan/phpstan/issues/4960), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Add non regression test ([#&#8203;3415](https://github.com/phpstan/phpstan-src/pull/3415)), [#&#8203;10499](https://github.com/phpstan/phpstan/issues/10499), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.12.2`](https://github.com/phpstan/phpstan/releases/tag/1.12.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.1...1.12.2) # Improvements 🔧 - PHP 8.4 - report deprecated implicitly nullable parameter types (https://github.com/phpstan/phpstan-src/commit/9bd027c56330c0f5cc2abab2159549373539583d), [#&#8203;11413](https://github.com/phpstan/phpstan/issues/11413) # Bugfixes 🐛 - Run `@mixin` class reflection extensions after all other class reflection extensions (https://github.com/phpstan/phpstan-src/commit/c889baa9ec60394e9201b2a7054486c66b40fa9b), [#&#8203;11624](https://github.com/phpstan/phpstan/issues/11624), [#&#8203;11342](https://github.com/phpstan/phpstan/issues/11342), [#&#8203;10159](https://github.com/phpstan/phpstan/issues/10159), https://github.com/larastan/larastan/issues/2032 - RegexArrayShapeMatcher - Don't optimize alternations with optional groups for tagged unions ([#&#8203;3395](https://github.com/phpstan/phpstan-src/pull/3395)), [#&#8203;11604](https://github.com/phpstan/phpstan/issues/11604), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow array on `count()` with `positive-int` ([#&#8203;3389](https://github.com/phpstan/phpstan-src/pull/3389)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve narrowing after string functions ([#&#8203;3390](https://github.com/phpstan/phpstan-src/pull/3390)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `Type::reverseArray()` ([#&#8203;3344](https://github.com/phpstan/phpstan-src/pull/3344)), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Function signature fixes 🤖 - `version_compare()` operator arg can be null ([#&#8203;3399](https://github.com/phpstan/phpstan-src/pull/3399)), [#&#8203;4457](https://github.com/phpstan/phpstan/issues/4457), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Regression test ([#&#8203;3396](https://github.com/phpstan/phpstan-src/pull/3396)), [#&#8203;6642](https://github.com/phpstan/phpstan/issues/6642), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Simplify isFloat checks ([#&#8203;3397](https://github.com/phpstan/phpstan-src/pull/3397)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.12.1`](https://github.com/phpstan/phpstan/releases/tag/1.12.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.12.0...1.12.1) # Bleeding edge 🔪 - Check if required file exists ([#&#8203;3294](https://github.com/phpstan/phpstan-src/pull/3294)), [#&#8203;3397](https://github.com/phpstan/phpstan/issues/3397), thanks [@&#8203;Bellangelo](https://github.com/Bellangelo)! - Check generics `@method` `@template` tags above traits (https://github.com/phpstan/phpstan-src/commit/aadbf62d3ae4517fc7a212b07130bedcef8d13ac) - Check `@mixin` PHPDoc tag above traits (https://github.com/phpstan/phpstan-src/commit/0d0de946900adf4eb3c799b1b547567536e23147) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Allow dot-prefixed config files ([#&#8203;3354](https://github.com/phpstan/phpstan-src/pull/3354)), thanks [@&#8203;sreichel](https://github.com/sreichel)! - Respect dist order over dot order ([#&#8203;3379](https://github.com/phpstan/phpstan-src/pull/3379)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update PhpStorm stubs + refactor WithoutSideEffectsRule classes ([#&#8203;3377](https://github.com/phpstan/phpstan-src/pull/3377)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - TypeSpecifier: Narrow `(bool) $expr` like `$expr != false` ([#&#8203;3380](https://github.com/phpstan/phpstan-src/pull/3380)), [#&#8203;8881](https://github.com/phpstan/phpstan/issues/8881), [#&#8203;7685](https://github.com/phpstan/phpstan/issues/7685), [#&#8203;6006](https://github.com/phpstan/phpstan/issues/6006), [#&#8203;10528](https://github.com/phpstan/phpstan/issues/10528), thanks [@&#8203;staabm](https://github.com/staabm)! - TypeSpecifier: Narrow `(string) $expr` like `$expr != false` ([#&#8203;3387](https://github.com/phpstan/phpstan-src/pull/3387)), thanks [@&#8203;staabm](https://github.com/staabm)! - TypeSpecifier: Narrow `(int) $expr` like `$expr != false` ([#&#8203;3384](https://github.com/phpstan/phpstan-src/pull/3384)), thanks [@&#8203;staabm](https://github.com/staabm)! - TypeSpecifier: Narrow `(float) $expr` like `$expr != false` ([#&#8203;3391](https://github.com/phpstan/phpstan-src/pull/3391)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add missing rule to StubValidator (https://github.com/phpstan/phpstan-src/commit/085fcf40fefa63fc3672897276e460a6405206fb) - Support `@mixin` above traits (https://github.com/phpstan/phpstan-src/commit/f5e2e32932644d61b3745e3b0f2c0910f722a86d) # Bugfixes 🐛 - Fix `array_filter` with callback optional persistance ([#&#8203;3366](https://github.com/phpstan/phpstan-src/pull/3366)), [#&#8203;11570](https://github.com/phpstan/phpstan/issues/11570), thanks [@&#8203;robotomarvin](https://github.com/robotomarvin)! - RegexArrayShapeMatcher - infer constant string types in alternations ([#&#8203;3369](https://github.com/phpstan/phpstan-src/pull/3369)), [#&#8203;11222](https://github.com/phpstan/phpstan/issues/11222), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - improve type inference in alternations ([#&#8203;3375](https://github.com/phpstan/phpstan-src/pull/3375)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix error on offset assignment to specialized strings ([#&#8203;3365](https://github.com/phpstan/phpstan-src/pull/3365)), [#&#8203;11572](https://github.com/phpstan/phpstan/issues/11572), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow string on `strlen() ==` and `===` comparison with integer range ([#&#8203;3342](https://github.com/phpstan/phpstan-src/pull/3342)), [#&#8203;11548](https://github.com/phpstan/phpstan/issues/11548), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `get_debug_type` produces wrong type for anonymous classes with parent ([#&#8203;3374](https://github.com/phpstan/phpstan-src/pull/3374)), [#&#8203;11562](https://github.com/phpstan/phpstan/issues/11562), thanks [@&#8203;patrickkusebauch](https://github.com/patrickkusebauch)! - Fix preserving list when setting union offset type to a ConstantArrayTypeBuilder ([#&#8203;3382](https://github.com/phpstan/phpstan-src/pull/3382)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `preg_replace()` return type ([#&#8203;3338](https://github.com/phpstan/phpstan-src/pull/3338)), [#&#8203;11547](https://github.com/phpstan/phpstan/issues/11547), thanks [@&#8203;staabm](https://github.com/staabm)! - Detect function variadic-ness anywhere deep in the declaration file ([#&#8203;3370](https://github.com/phpstan/phpstan-src/pull/3370)), [#&#8203;11559](https://github.com/phpstan/phpstan/issues/11559), [#&#8203;4753](https://github.com/phpstan/phpstan/issues/4753), thanks [@&#8203;staabm](https://github.com/staabm)! - Add DateTimeSubMethodThrowTypeExtension ([#&#8203;3378](https://github.com/phpstan/phpstan-src/pull/3378)), [#&#8203;11503](https://github.com/phpstan/phpstan/issues/11503), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Do not report `static` in PHPDoc tags above traits as an error (https://github.com/phpstan/phpstan-src/commit/777a82a0dc9d6a64a709c30a2e5bdb030b634464), [#&#8203;11591](https://github.com/phpstan/phpstan/issues/11591) - RegexArrayShapeMatcher - Fix alternations containing a `$`-only case ([#&#8203;3394](https://github.com/phpstan/phpstan-src/pull/3394)), [#&#8203;11622](https://github.com/phpstan/phpstan/issues/11622), thanks [@&#8203;staabm](https://github.com/staabm)! - Do not report missing implementation abstract method from trait when it's implicitly implemented by enum (https://github.com/phpstan/phpstan-src/commit/c50b71fd961e9009419b8fddac835b15696f4ff5), [#&#8203;11592](https://github.com/phpstan/phpstan/issues/11592) - Fix how well conditional types play with pre-existing `@param-out` variable after assignment (https://github.com/phpstan/phpstan-src/commit/5892e8debfbe2f44306e6707c457665784b7dacd), [#&#8203;11580](https://github.com/phpstan/phpstan/issues/11580), [#&#8203;6642](https://github.com/phpstan/phpstan/issues/6642) # Internals 🔍 - Debugging function - `PHPStan\debugScope()` (https://github.com/phpstan/phpstan-src/commit/5909fb2dc78cbee46927c2cb23f7491dfef34165) - Added regression test ([#&#8203;3368](https://github.com/phpstan/phpstan-src/pull/3368)), [#&#8203;7856](https://github.com/phpstan/phpstan/issues/7856), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify specifyTypesForConstantBinaryExpression ([#&#8203;3392](https://github.com/phpstan/phpstan-src/pull/3392)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactoring: introduce MethodTagTemplateTypeCheck (https://github.com/phpstan/phpstan-src/commit/47a85bf1453a076bade7a30c94c06c0825abca7c) - Simplify extensions (https://github.com/phpstan/phpstan-src/commit/c47730f1f97e4dc6ca9f120e2675ca709fc1402c) - Refactoring - extract MixinCheck (https://github.com/phpstan/phpstan-src/commit/57ccd8c4d4b16c7edec4c2c2de8589956de8284d) - MixinCheck - prepare for trait rules (https://github.com/phpstan/phpstan-src/commit/ba591420c26b174ae561e26aeed01ccf34da9dee) ### [`v1.12.0`](https://github.com/phpstan/phpstan/releases/tag/1.12.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.11...1.12.0) [**Read all about PHPStan 1.12 on phpstan.org »**](https://phpstan.org/blog/phpstan-1-12-road-to-phpstan-2-0) # Major new features 🚀 - Precise type for `$matches` from `preg_match` generally available, out of bleeding edge (https://github.com/phpstan/phpstan-src/commit/bd2cec118592f7c66dff5a7ae28882654daf6468) - PHP 8.4 runtime support - PHPStan runs on PHP 8.4 without emitting deprecation notices - Full support for PHP 8.4 including new syntax and rules is coming later, after PHPStan 2.0 release # Bleeding edge 🔪 - More precise types for bcmath function parameters ([#&#8203;2217](https://github.com/phpstan/phpstan-src/pull/2217)), thanks [@&#8203;Warxcell](https://github.com/Warxcell)! - Enforce `@no-named-arguments` (https://github.com/phpstan/phpstan-src/commit/74ba8c23696948f2647d880df72f375346f41010), [#&#8203;5968](https://github.com/phpstan/phpstan/issues/5968) - Check too wide private property type (https://github.com/phpstan/phpstan-src/commit/7453f4f75fae3d635063589467842aae29d88b54) - Consider implicit throw points when the only explicit one is Throw\_ (https://github.com/phpstan/phpstan-src/commit/22eef6d5ab9a4afafb2305258fea273be6cc06e4) - Check existing classes in `@param-out` (https://github.com/phpstan/phpstan-src/commit/30c4b9e80f51af8b5f166ba3aae93d8409c9c0ea), [#&#8203;10260](https://github.com/phpstan/phpstan/issues/10260) - Check existing classes in `@param-closure-this` (https://github.com/phpstan/phpstan-src/commit/2fa539a39e06bcc3155b109fd8d246703ceb176d), [#&#8203;10933](https://github.com/phpstan/phpstan/issues/10933) - Check invalid `@param-closure-this` (https://github.com/phpstan/phpstan-src/commit/95c0a5806c65c975201b9d3a464873f75a04c8b8), [#&#8203;10932](https://github.com/phpstan/phpstan/issues/10932) - Check `@param-immediately-invoked-callable` and `@param-later-invoked-callable` (https://github.com/phpstan/phpstan-src/commit/580a6add422f4e34191df9e7a77ba1655e914bda), [#&#8203;10932](https://github.com/phpstan/phpstan/issues/10932) - Check existing classes in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9) - Check missing types in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/892b319f25f04bc1b55c3d0063b607909612fe6d) - Check missing types in local type aliases (https://github.com/phpstan/phpstan-src/commit/ce7ffaf02d624a7fb9d38f8e5dffc9739f1233fc) - Check nonexistent classes in local type aliases (https://github.com/phpstan/phpstan-src/commit/2485b2e9c129e789ec3b2d7db81ca30f87c63911) - Check unresolvable types in local type aliases (https://github.com/phpstan/phpstan-src/commit/5f7d12b2fb2809525ab0e96eeae95093204ea4d3) - Check generics in local type aliases (https://github.com/phpstan/phpstan-src/commit/5a2d4416d94ab77a2a2e7e1bfaba4c5ed2a13c25) - Check missing types in `@mixin` (https://github.com/phpstan/phpstan-src/commit/3175c81f26fd5bcb4a161b24e774921870ed2533) - Check types in `@property` tags (https://github.com/phpstan/phpstan-src/commit/55ea2ae516df22a071ab873fdd6f748a3af0520e), [#&#8203;10752](https://github.com/phpstan/phpstan/issues/10752), [#&#8203;9356](https://github.com/phpstan/phpstan/issues/9356) - Check types in `@method` tags (https://github.com/phpstan/phpstan-src/commit/5b7e474680eaf33874b7ed6a227677adcbed9ca5) - Check `@extends`, `@implements`, `@use` for unresolvable types (https://github.com/phpstan/phpstan-src/commit/2bb528233edb75312614166e282776f279cf2018), [#&#8203;11552](https://github.com/phpstan/phpstan/issues/11552) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Internal classes made `final`, `@api` classes made `@final` ([#&#8203;3264](https://github.com/phpstan/phpstan-src/pull/3264), https://github.com/phpstan/phpstan-src/commit/5baa146510b56c9571b3d85eba71c02d86f683bb) - Repair `PhpParser\Node\Stmt\Class_::isAnonymous()` ([#&#8203;3343](https://github.com/phpstan/phpstan-src/pull/3343)), thanks [@&#8203;tscni](https://github.com/tscni)! - Improve `curl_init()` return type analysis ([#&#8203;3346](https://github.com/phpstan/phpstan-src/pull/3346)), thanks [@&#8203;tscni](https://github.com/tscni)! - StubValidator - added missing rules (https://github.com/phpstan/phpstan-src/commit/7fc5ab8dfb3be8cc0c1daff7c17b6c6d98d8ca7a) - Do not allow `@phpstan-self-out` above static method (https://github.com/phpstan/phpstan-src/commit/0dfd8217699fc1c4796bcafbf2f6e04137938365) - Check unresolvable types in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/e182c0662df24e57c81b1d49e22963cad5ff5d13) - Check generics in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/9ebc315589ba2086279dd4c404ef77a33f8b43a7) - ConstExprNodeResolver - support ConstFetchNode for class constants (https://github.com/phpstan/phpstan-src/commit/3e51899dd7ed0e2785846f8ec820b4cd8214b993) - allowed in default parameter values in `@method` # Bugfixes 🐛 - PHPStanDiagnoseExtension - skip showing config files in "Included configs from Composer packages" if already present in the "Extension installer" section (https://github.com/phpstan/phpstan-src/commit/6c4477c9fcc2d62579cb1e353ca902b4b9ebb888) - Support multiple anonymous class definitions on the same line ([#&#8203;3328](https://github.com/phpstan/phpstan-src/pull/3328)), [#&#8203;5597](https://github.com/phpstan/phpstan/issues/5597), [#&#8203;11511](https://github.com/phpstan/phpstan/issues/11511), thanks [@&#8203;tscni](https://github.com/tscni)! - Fix ConstantArrayType not accepting NeverType ([#&#8203;3327](https://github.com/phpstan/phpstan-src/pull/3327)), [#&#8203;11517](https://github.com/phpstan/phpstan/issues/11517), thanks [@&#8203;tscni](https://github.com/tscni)! - Narrow to non-falsy-string from `strlen()` on integer range ([#&#8203;3337](https://github.com/phpstan/phpstan-src/pull/3337)), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow arrays in union based on `count()` with integer range ([#&#8203;3335](https://github.com/phpstan/phpstan-src/pull/3335)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix description escaping in UsedTraitsRule (https://github.com/phpstan/phpstan-src/commit/4ffbb3b126d3c98fad4ad0906c76d24febdb89ed) # Internals 🔍 - Cleanup TypeSpecifier ([#&#8203;3340](https://github.com/phpstan/phpstan-src/pull/3340)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor ReplaceFunctionsDynamicReturnTypeExtension ([#&#8203;3339](https://github.com/phpstan/phpstan-src/pull/3339)), thanks [@&#8203;staabm](https://github.com/staabm)! - BetterReflectionSourceLocator - playground mode (https://github.com/phpstan/phpstan-src/commit/7d1bde44afc0c0f7e3b29f2d75a7c33d5e6a56ec) - Internal PHPStan rule - class must be abstract or final (https://github.com/phpstan/phpstan-src/commit/d631120bea6af099cdcc85e3e12dc9f26bf6f1f5) - Downgrade PHP files in build/PHPStan (https://github.com/phpstan/phpstan-src/commit/fe503cad77b684f845a932644007c50684161b8d) - ExtendedPropertyReflection (https://github.com/phpstan/phpstan-src/commit/d65138a11f0654b710a27b4b563bff2ccf0b2c1b) - Replace `highlight_string()` stub with a return type extension ([#&#8203;3350](https://github.com/phpstan/phpstan-src/pull/3350)) - Issue bot - test PHP 8.4 ([#&#8203;3358](https://github.com/phpstan/phpstan-src/pull/3358)) ### [`v1.11.11`](https://github.com/phpstan/phpstan/releases/tag/1.11.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.10...1.11.11) # Improvements 🔧 - Narrow arrays in union based on count() with smaller/greater operator ([#&#8203;3324](https://github.com/phpstan/phpstan-src/pull/3324)), [#&#8203;11480](https://github.com/phpstan/phpstan/issues/11480), thanks [@&#8203;staabm](https://github.com/staabm)! - PHPStanDiagnoseExtension - show Composer packages with included config files (https://github.com/phpstan/phpstan-src/commit/58d202fddc5597a1fa274ca3b64c352717818c4f) # Bugfixes 🐛 - RegexArrayShapeMatcher - optional non-last groups can be empty-string ([#&#8203;3306](https://github.com/phpstan/phpstan-src/pull/3306)), [#&#8203;11479](https://github.com/phpstan/phpstan/issues/11479), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - fix capturing item-array-shapes for preg_match_all ([#&#8203;3307](https://github.com/phpstan/phpstan-src/pull/3307)), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Fix shape of single top level alternations ([#&#8203;3299](https://github.com/phpstan/phpstan-src/pull/3299)), [#&#8203;11462](https://github.com/phpstan/phpstan/issues/11462), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Fix matching literal "-" in character classes ([#&#8203;3314](https://github.com/phpstan/phpstan-src/pull/3314)), [#&#8203;11490](https://github.com/phpstan/phpstan/issues/11490), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve sprintf support ([#&#8203;3310](https://github.com/phpstan/phpstan-src/pull/3310)), [#&#8203;11491](https://github.com/phpstan/phpstan/issues/11491), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Handle union and mixed in plus operation ([#&#8203;3320](https://github.com/phpstan/phpstan-src/pull/3320)), [#&#8203;3759](https://github.com/phpstan/phpstan/issues/3759), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix union with float should accept integer range ([#&#8203;3318](https://github.com/phpstan/phpstan-src/pull/3318)), [#&#8203;10248](https://github.com/phpstan/phpstan/issues/10248), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix array_intersect_key ([#&#8203;3317](https://github.com/phpstan/phpstan-src/pull/3317)), [#&#8203;10561](https://github.com/phpstan/phpstan/issues/10561), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve non strict `in_array()` ([#&#8203;3319](https://github.com/phpstan/phpstan-src/pull/3319)), [#&#8203;9436](https://github.com/phpstan/phpstan/issues/9436), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - String offset access leads to non-empty-string (single character) (https://github.com/phpstan/phpstan-src/commit/9439bba42047ab9561a091292568d7adf58e42ce), [#&#8203;11506](https://github.com/phpstan/phpstan/issues/11506) - Fix `AccessoryLiteralStringType::setOffsetValueType()` (https://github.com/phpstan/phpstan-src/commit/93c5226cb5711c8b1b846fcfe6d5ef2586d2b162) - Fix `AccessoryNonFalsyStringType::setOffsetValueType()` (https://github.com/phpstan/phpstan-src/commit/c28c9362376286044b37755bedf49ab2228801dc) - Improve IntDivThrowTypeExtension to support integer ranges ([#&#8203;3325](https://github.com/phpstan/phpstan-src/pull/3325)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix array intersection between HasOffsetType and HasOffsetValueType (https://github.com/phpstan/phpstan-src/commit/07d64058830765dbb3bf194cffdf66c98db20a38), [#&#8203;11518](https://github.com/phpstan/phpstan/issues/11518) - Fix item type in list to constant array conversion with `count()` ([#&#8203;3309](https://github.com/phpstan/phpstan-src/pull/3309)), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Fix imagick definition ([#&#8203;3316](https://github.com/phpstan/phpstan-src/pull/3316)), [#&#8203;10803](https://github.com/phpstan/phpstan/issues/10803), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Turn Regex classes immutable where possible ([#&#8203;3305](https://github.com/phpstan/phpstan-src/pull/3305)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.11.10`](https://github.com/phpstan/phpstan/releases/tag/1.11.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.9...1.11.10) # Bleeding edge 🔪 - Precise array shape for `preg_replace_callback()` `$matches` ([#&#8203;3281](https://github.com/phpstan/phpstan-src/pull/3281)), thanks [@&#8203;staabm](https://github.com/staabm)! - Report invalid exclude paths in PHP config (https://github.com/phpstan/phpstan-src/commit/9718c14f1ffac81ba3d2bf331b4e8b4041a4d004) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Allow nonexistent paths in excludePaths by appending `(?)` (https://github.com/phpstan/phpstan-src/commit/39649c2b9db016edabdb813dfe39ae0fd46e0c09, https://github.com/phpstan/phpstan-src/commit/be65babffe40c48c303411abf8a56116a274b893), [#&#8203;11436](https://github.com/phpstan/phpstan/issues/11436) - Do not report nonexistent paths in ignoreErrors if `reportUnmatchedIgnoredErrors: false` (https://github.com/phpstan/phpstan-src/commit/b7fe9900d5933ffdbdeeb2b10877fd2764cb8bb8), [#&#8203;11436](https://github.com/phpstan/phpstan/issues/11436) - Narrow tagged unions based on `count()` with array size ([#&#8203;3302](https://github.com/phpstan/phpstan-src/pull/3302)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - RegularExpressionPatternRule: fix false positive in preg_quote() handling ([#&#8203;3280](https://github.com/phpstan/phpstan-src/pull/3280)), [#&#8203;11432](https://github.com/phpstan/phpstan/issues/11432), thanks [@&#8203;staabm](https://github.com/staabm)! - Support literal strings in RegexGroupParser ([#&#8203;3284](https://github.com/phpstan/phpstan-src/pull/3284)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support classes of literal strings in RegexGroupParser ([#&#8203;3285](https://github.com/phpstan/phpstan-src/pull/3285)), thanks [@&#8203;staabm](https://github.com/staabm)! - Don't infer constant types for "i"-modfied patterns ([#&#8203;3288](https://github.com/phpstan/phpstan-src/pull/3288)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support non-falsy-string in RegexGroupParser ([#&#8203;3289](https://github.com/phpstan/phpstan-src/pull/3289)), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexGroupParser: Ignore whitespaces on "x"-modified patterns ([#&#8203;3291](https://github.com/phpstan/phpstan/issues/3291)) ([#&#8203;3291](https://github.com/phpstan/phpstan-src/pull/3291)), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher: fix preg_match_all with PREG_OFFSET_CAPTURE ([#&#8203;3292](https://github.com/phpstan/phpstan-src/pull/3292)), [#&#8203;11457](https://github.com/phpstan/phpstan/issues/11457), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Fix subject types ([#&#8203;3300](https://github.com/phpstan/phpstan-src/pull/3300)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `ConstantArrayType::isSuperTypeOf()` for empty array (https://github.com/phpstan/phpstan-src/commit/ed6bc0b93499b5c7463ba05aefb1377b9eb9d1e0) - is_resource: adjust type specification for truthy context only ([#&#8203;3298](https://github.com/phpstan/phpstan-src/pull/3298)), [#&#8203;9687](https://github.com/phpstan/phpstan/issues/9687), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Fix loose comparison between '1' and '+1' ([#&#8203;3301](https://github.com/phpstan/phpstan-src/pull/3301)), thanks [@&#8203;thg2k](https://github.com/thg2k)! # Function signature fixes 🤖 - Update some mysqli function return types ([#&#8203;3279](https://github.com/phpstan/phpstan-src/pull/3279)), [#&#8203;8345](https://github.com/phpstan/phpstan/issues/8345), thanks [@&#8203;mattschlosser](https://github.com/mattschlosser)! # Internals 🔍 - Extracted RegexGroupParser from RegexArrayShapeMatcher ([#&#8203;3278](https://github.com/phpstan/phpstan-src/pull/3278)), thanks [@&#8203;staabm](https://github.com/staabm)! - E2E test about path validation in ignoreErrors and excludePaths (https://github.com/phpstan/phpstan-src/commit/9246976958fb22e3464f7a25ef2ab97caed5aa44) - RegularExpressionPatternRuleTest: utilize `preg_match()` array shape tests ([#&#8203;3290](https://github.com/phpstan/phpstan-src/pull/3290)), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify RegexArrayShapeMatcher ([#&#8203;3293](https://github.com/phpstan/phpstan-src/pull/3293)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor RegexGroupParser - extract RegexAlternation class ([#&#8203;3296](https://github.com/phpstan/phpstan-src/pull/3296)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.11.9`](https://github.com/phpstan/phpstan/releases/tag/1.11.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.8...1.11.9) # Bleeding edge 🔪 - RegularExpressionPatternRule: validate preg_quote'd patterns ([#&#8203;3270](https://github.com/phpstan/phpstan-src/pull/3270)), thanks [@&#8203;staabm](https://github.com/staabm)! - No implicit wildcard in FileExcluder (https://github.com/phpstan/phpstan-src/commit/e19e6e5f8cfa706cc30e44a17276a6bc269f995c), [#&#8203;10299](https://github.com/phpstan/phpstan/issues/10299) - Precise array shape for `preg_match_all()` $matches ([#&#8203;3256](https://github.com/phpstan/phpstan-src/pull/3256)), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - DefaultStubFilesProvider - consider all composerAutoloaderProjectPaths when filtering 3rd party stub files (https://github.com/phpstan/phpstan-src/commit/582a0f8a744fa2ebda2d98783c55c78183e8bbed), [#&#8203;11393](https://github.com/phpstan/phpstan/issues/11393) # Bugfixes 🐛 - RegexArrayShapeMatcher: Fix non-emptiness of leading optional groups ([#&#8203;3267](https://github.com/phpstan/phpstan-src/pull/3267)), [#&#8203;11376](https://github.com/phpstan/phpstan/issues/11376), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher: Support resolving of constants in patterns ([#&#8203;3265](https://github.com/phpstan/phpstan-src/pull/3265)), [#&#8203;11384](https://github.com/phpstan/phpstan/issues/11384), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexExpressionHelper - Support all bracket style delimiters ([#&#8203;3273](https://github.com/phpstan/phpstan-src/pull/3273)), thanks [@&#8203;staabm](https://github.com/staabm)! - Regex parsing fixes for newline characters and marker verbs ([#&#8203;3268](https://github.com/phpstan/phpstan-src/pull/3268)), [#&#8203;11360](https://github.com/phpstan/phpstan/issues/11360), [#&#8203;8948](https://github.com/phpstan/phpstan/issues/8948), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - RegexArrayShapeMatcher - Support 'n' modifier ([#&#8203;3271](https://github.com/phpstan/phpstan-src/pull/3271)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `abs()` return type ([#&#8203;3263](https://github.com/phpstan/phpstan-src/pull/3263)), [#&#8203;11367](https://github.com/phpstan/phpstan/issues/11367), thanks [@&#8203;julienfalque](https://github.com/julienfalque)! - UselessFunctionReturnValueRule: More precise error message ([#&#8203;3266](https://github.com/phpstan/phpstan-src/pull/3266)), [#&#8203;11377](https://github.com/phpstan/phpstan/issues/11377), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Extract RegexExpressionHelper ([#&#8203;3270](https://github.com/phpstan/phpstan-src/pull/3270)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor RegexArrayShapeMatcher ([#&#8203;3274](https://github.com/phpstan/phpstan-src/pull/3274)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.11.8`](https://github.com/phpstan/phpstan/releases/tag/1.11.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.7...1.11.8) # Bleeding edge 🔪 - Report useless return values of function calls like `var_export` without `$return=true` ([#&#8203;3225](https://github.com/phpstan/phpstan-src/pull/3225)), [#&#8203;11320](https://github.com/phpstan/phpstan/issues/11320), thanks [@&#8203;staabm](https://github.com/staabm)! - Check mixed in binary operator ([#&#8203;3231](https://github.com/phpstan/phpstan-src/pull/3231)), [#&#8203;7538](https://github.com/phpstan/phpstan/issues/7538), [#&#8203;10440](https://github.com/phpstan/phpstan/issues/10440), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Check vprintf/vsprintf arguments against placeholder count ([#&#8203;3126](https://github.com/phpstan/phpstan-src/pull/3126)), thanks [@&#8203;staabm](https://github.com/staabm)! - Check mixed in unary operator ([#&#8203;3253](https://github.com/phpstan/phpstan-src/pull/3253)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Report "missing return" error closer to where the return is missing (https://github.com/phpstan/phpstan-src/commit/04f8636e6577cbcaefc944725eed74c0d7865ead) - Stricter ++/-- operator check ([#&#8203;3255](https://github.com/phpstan/phpstan-src/pull/3255)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Check preg_quote delimiter sanity ([#&#8203;3252](https://github.com/phpstan/phpstan-src/pull/3252)), [#&#8203;11338](https://github.com/phpstan/phpstan/issues/11338), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Precise array shape for `$matches` from `preg_match()` improvements: - RegexArrayShapeMatcher - trailling groups are not optional when PREG_UNMATCHED_AS_NULL ([#&#8203;3219](https://github.com/phpstan/phpstan-src/pull/3219)), [#&#8203;11311](https://github.com/phpstan/phpstan/issues/11311), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix preg_match named capturing groups ([#&#8203;3228](https://github.com/phpstan/phpstan-src/pull/3228)), [#&#8203;11323](https://github.com/phpstan/phpstan/issues/11323), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Fix optional groups with PREG_UNMATCHED_AS_NULL ([#&#8203;3229](https://github.com/phpstan/phpstan-src/pull/3229)), thanks [@&#8203;staabm](https://github.com/staabm)! - Allow overriding the PHP 7.2 support for PREG_UNMATCHED_AS_NULL ([#&#8203;3226](https://github.com/phpstan/phpstan-src/pull/3226)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with optional leading groups ([#&#8203;3234](https://github.com/phpstan/phpstan-src/pull/3234)), [#&#8203;11331](https://github.com/phpstan/phpstan/issues/11331), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Support preg_quote()'d patterns ([#&#8203;3233](https://github.com/phpstan/phpstan-src/pull/3233)), [#&#8203;11332](https://github.com/phpstan/phpstan/issues/11332), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - Fix PREG_UNMATCHED_AS_NULL with top level alternation ([#&#8203;3238](https://github.com/phpstan/phpstan-src/pull/3238)), thanks [@&#8203;staabm](https://github.com/staabm)! - RegexArrayShapeMatcher - More precise non-empty-string and numeric-string ([#&#8203;3249](https://github.com/phpstan/phpstan-src/pull/3249)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix regex parsing by completing the grammar ([#&#8203;3244](https://github.com/phpstan/phpstan-src/pull/3244)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - RegexArrayShapeMatcher - `(\d*)` can be empty-string ([#&#8203;3257](https://github.com/phpstan/phpstan-src/pull/3257)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `diagnose` command to run DiagnoseExtensions (https://github.com/phpstan/phpstan-src/commit/22c84d2e64dd30780c995d8a720a487bb484dc02) - Diagnose extension: Info about extensions installed via extension-installer (https://github.com/phpstan/phpstan-src/commit/db71f04aa14f5be6421e92d7b76031605de5ad80) - Diagnose extension - where is PHPStan running from (https://github.com/phpstan/phpstan-src/commit/76464eed45dee10154cb25b9f05586c346046adc) - Parallel scheduler becomes DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/c7c9689cd86a9811eeaa2bb365ab5bc302109802) - ResultCacheManager: output restore time in debug mode ([#&#8203;3224](https://github.com/phpstan/phpstan-src/pull/3224)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Add hint as to what might be wrong when invalid identifiers are used ([#&#8203;3230](https://github.com/phpstan/phpstan-src/pull/3230)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Optimize array_map with many arrays (https://github.com/phpstan/phpstan-src/commit/09fbc92c415a2b9789463b3ca8fa7c73cc3475bd), [#&#8203;11297](https://github.com/phpstan/phpstan/issues/11297) - Improved `sprintf()` inference ([#&#8203;3232](https://github.com/phpstan/phpstan-src/pull/3232)), thanks [@&#8203;staabm](https://github.com/staabm)! - Print elapsed analysis time with `-v` ([#&#8203;3239](https://github.com/phpstan/phpstan-src/pull/3239), [#&#8203;3242](https://github.com/phpstan/phpstan-src/pull/3242)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - More precise `sprintf()` format arg-based return type ([#&#8203;3192](https://github.com/phpstan/phpstan-src/pull/3192)), [#&#8203;11248](https://github.com/phpstan/phpstan/issues/11248), [#&#8203;10493](https://github.com/phpstan/phpstan/issues/10493), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix return type of round/ceil/floor in non strict type environment ([#&#8203;3223](https://github.com/phpstan/phpstan-src/pull/3223)), [#&#8203;11319](https://github.com/phpstan/phpstan/issues/11319), thanks [@&#8203;BackEndTea](https://github.com/BackEndTea)! - Fix statement analysis after early-terminating statements ([#&#8203;3227](https://github.com/phpstan/phpstan-src/pull/3227)), [#&#8203;11179](https://github.com/phpstan/phpstan/issues/11179), thanks [@&#8203;takaram](https://github.com/takaram)! - Fix match of union of enums (https://github.com/phpstan/phpstan-src/commit/44e40f054569f3eeed81280bf0d2f50659fb1056), [#&#8203;11313](https://github.com/phpstan/phpstan/issues/11313) - Fix `pathinfo()` return type for union type flags ([#&#8203;3120](https://github.com/phpstan/phpstan-src/pull/3120)), [#&#8203;10760](https://github.com/phpstan/phpstan/issues/10760), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix and simplify discovering composer autoloader project path (https://github.com/phpstan/phpstan-src/commit/2cc6cda6969a63267e70c2074efa0477b69c9083) - Ignore non-explicit NeverType in purity check ([#&#8203;3243](https://github.com/phpstan/phpstan-src/pull/3243)), [#&#8203;11207](https://github.com/phpstan/phpstan/issues/11207), thanks [@&#8203;staabm](https://github.com/staabm)! - Non-numeric strings in `pow()` lead to error ([#&#8203;2796](https://github.com/phpstan/phpstan-src/pull/2796)), [#&#8203;10125](https://github.com/phpstan/phpstan/issues/10125), thanks [@&#8203;staabm](https://github.com/staabm)! - Closure with by-ref parameter is impure (https://github.com/phpstan/phpstan-src/commit/f1abacddb3787ce279e51b1f88f1543d52b9759c), [#&#8203;11361](https://github.com/phpstan/phpstan/issues/11361) - PathRoutingParser - check if the file is a symlink that might be in analysed paths (https://github.com/phpstan/phpstan-src/commit/c9a6d2e61edfad189a765df3c3a06674a10d4fb5), [#&#8203;6585](https://github.com/phpstan/phpstan/issues/6585) # Function signature fixes 🤖 - Fix new headers functions in php 8.4 ([#&#8203;3221](https://github.com/phpstan/phpstan-src/pull/3221)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! # Internals 🔍 - Indicate file on TypeInferenceTestCase validation errors ([#&#8203;3166](https://github.com/phpstan/phpstan-src/pull/3166)), thanks [@&#8203;staabm](https://github.com/staabm)! - nette/di - patch for PHP 8.4 support (https://github.com/phpstan/phpstan-src/commit/1245ea73e5a24aefc4fac87ebe73d9720deac7c9) - InternalError is part of `@api` ([#&#8203;3240](https://github.com/phpstan/phpstan-src/pull/3240)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Refactor RegexArrayShapeMatcher ([#&#8203;3248](https://github.com/phpstan/phpstan-src/pull/3248)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor PrintfParametersRule ([#&#8203;3247](https://github.com/phpstan/phpstan-src/pull/3247)), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify RegularExpressionPatternRule ([#&#8203;3251](https://github.com/phpstan/phpstan-src/pull/3251)), thanks [@&#8203;staabm](https://github.com/staabm)! - Copy regex grammar from hoa/regex into the project (https://github.com/phpstan/phpstan-src/commit/bacb3c6d11edb5f30176e70ade6e72ac4f2e23dd) - Apply Grammar.patch to reflect previous phpstan state (https://github.com/phpstan/phpstan-src/commit/e71cff468aa4695e9bfa09d01e0ec5194890e7f1) - ExecutionEndNode always has a statement (https://github.com/phpstan/phpstan-src/commit/27e0f91efad4c9fcacae98b2e3394c069e9e5095) - Fix PHP_VERSION_ID comparison in test ([#&#8203;3254](https://github.com/phpstan/phpstan-src/pull/3254)), thanks [@&#8203;staabm](https://github.com/staabm)! - Apply the stricter signatures for PHP 8.0 after the basic ones for PHP 8.0 ([#&#8203;3259](https://github.com/phpstan/phpstan-src/pull/3259)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Refactor function signature map files loading ([#&#8203;3262](https://github.com/phpstan/phpstan-src/pull/3262)), thanks [@&#8203;thg2k](https://github.com/thg2k)! ### [`v1.11.7`](https://github.com/phpstan/phpstan/releases/tag/1.11.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.6...1.11.7) # Improvements 🔧 - Rework `match` expression analysis with enum with performance in mind (https://github.com/phpstan/phpstan-src/commit/b98abe01ca2a589c964970ea42128ae9b752890b), [#&#8203;11263](https://github.com/phpstan/phpstan/issues/11263) - DiagnoseExtension (https://github.com/phpstan/phpstan-src/commit/d55933fa0c8d6c9d91c5d30f70313e1c15b2c7f9) - This extension can output any diagnostic information to stderr after analysis - PHPStan displays this information when running the "analyse" command with `-vvv` CLI option. - Result cache - debug message about successfully restored cache (https://github.com/phpstan/phpstan-src/commit/979055fceeaefec30c1eded52550012f0c1333b6) - Show a hint about `-vv` for unignorable errors when generating the baseline (https://github.com/phpstan/phpstan-src/commit/d931c8987563fbe5a05e411722a6f53da6f1b555), [#&#8203;3973](https://github.com/phpstan/phpstan/issues/3973) - Limit the depth when resolving closure type for performance reasons (https://github.com/phpstan/phpstan-src/commit/2c08dfa8d0f975654d52fe279a950c54415076b5?w=1), [#&#8203;11283](https://github.com/phpstan/phpstan/issues/11283) - `MutatingScope::resolveType()` - cache closure body analysis data (https://github.com/phpstan/phpstan-src/commit/fd3115652b76278fa6ddf8ba40b41fc751642153), [#&#8203;11283](https://github.com/phpstan/phpstan/issues/11283) # Bugfixes 🐛 - Observe `@no-named-arguments` above class (https://github.com/phpstan/phpstan-src/commit/815270d8933b9cdefa4613f0baf17bcbff91be6f), [#&#8203;11275](https://github.com/phpstan/phpstan/issues/11275) - Fix `count()` narrowing on $matches ([#&#8203;3210](https://github.com/phpstan/phpstan-src/pull/3210)), [#&#8203;11277](https://github.com/phpstan/phpstan/issues/11277), thanks [@&#8203;staabm](https://github.com/staabm)! - Try preventing "Method was not found in reflection of class" when getting a method prototype (https://github.com/phpstan/phpstan-src/commit/25658f64f0bcfe784893104864d92032cce33e96), [#&#8203;11269](https://github.com/phpstan/phpstan/issues/11269), [#&#8203;11251](https://github.com/phpstan/phpstan/issues/11251) - RegexArrayShapeMatcher - support resetting non-capturing groups ([#&#8203;3212](https://github.com/phpstan/phpstan-src/pull/3212)), [#&#8203;11291](https://github.com/phpstan/phpstan/issues/11291), thanks [@&#8203;staabm](https://github.com/staabm)! - Prevent out-of-memory errors while regex array shape inference ([#&#8203;3213](https://github.com/phpstan/phpstan-src/pull/3213)), [#&#8203;11292](https://github.com/phpstan/phpstan/issues/11292), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - `getimagesize`, `getimagesizefromstring`: zero is a possible value for height and width ([#&#8203;3207](https://github.com/phpstan/phpstan-src/pull/3207)), thanks [@&#8203;mfruehauf](https://github.com/mfruehauf)! # Internals 🔍 - Faster `ObjectType::getEnumCases()` ([#&#8203;3203](https://github.com/phpstan/phpstan-src/pull/3203), [#&#8203;3204](https://github.com/phpstan/phpstan-src/pull/3204)), [#&#8203;11263](https://github.com/phpstan/phpstan/issues/11263), thanks [@&#8203;staabm](https://github.com/staabm)! - Update composer-dependency-analyser to 1.6.0 ([#&#8203;3205](https://github.com/phpstan/phpstan-src/pull/3205)), thanks [@&#8203;janedbal](https://github.com/janedbal)! ### [`v1.11.6`](https://github.com/phpstan/phpstan/releases/tag/1.11.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.5...1.11.6) # Bleeding edge 🔪 - Precise array shapes for `preg_match()` for `$matches` by-ref parameter ([#&#8203;2589](https://github.com/phpstan/phpstan-src/pull/2589)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improved the type of the `$mode` parameter for the `count()` ([#&#8203;3190](https://github.com/phpstan/phpstan-src/pull/3190)), thanks [@&#8203;kuma3](https://github.com/kuma3)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - PHPStan Pro - report fatal errors more nicely (https://github.com/phpstan/phpstan-src/commit/a99c71e3bed8f393fad26faaab5def7a5bfa0c03) - PHPStan Pro - do not repeat ProcessCrashedException in CLI output because it's already presented in the UI (https://github.com/phpstan/phpstan-src/commit/6e700418d6609c51154d672a197e43bd74fa761f) - Add Cloudflare CA to composer/ca-bundle cacert.pem (https://github.com/phpstan/phpstan-src/commit/30f68ba7555e88ad9bdb326a1bed735d79fb29ea) - Implement ParameterOutTypeExtensions ([#&#8203;3083](https://github.com/phpstan/phpstan-src/pull/3083)), thanks [@&#8203;staabm](https://github.com/staabm)! - Do not output some internal errors twice (https://github.com/phpstan/phpstan-src/commit/4f75ba6bdc856ed6db4ba2862b610394cdbfbf15, https://github.com/phpstan/phpstan-src/commit/9967f48574a045af8305ebbcc585f6951e013a36) - Forbid \_HumbugBox prefixed classes ([#&#8203;3186](https://github.com/phpstan/phpstan-src/pull/3186)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix return type of sprintf with single `%s` format ([#&#8203;3167](https://github.com/phpstan/phpstan-src/pull/3167)), [#&#8203;11201](https://github.com/phpstan/phpstan/issues/11201), thanks [@&#8203;pilif](https://github.com/pilif)! - Add PCRE_VERSION predefined constant ([#&#8203;3169](https://github.com/phpstan/phpstan-src/pull/3169)), [#&#8203;11202](https://github.com/phpstan/phpstan/issues/11202), thanks [@&#8203;curry684](https://github.com/curry684)! - Cast non-zero IntegerRangeType toString() is a non-falsy-string ([#&#8203;3170](https://github.com/phpstan/phpstan-src/pull/3170)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `UnitEnum::cases()` return type (https://github.com/phpstan/phpstan-src/commit/32f351a24ce103f120f413cd104bc411608df109), [#&#8203;11244](https://github.com/phpstan/phpstan/issues/11244), [#&#8203;11233](https://github.com/phpstan/phpstan/issues/11233) - Reset remembered match cond when entering match (https://github.com/phpstan/phpstan-src/commit/07995276abd80b766407534055f58592ffe1a1a5), [#&#8203;11246](https://github.com/phpstan/phpstan/issues/11246), [#&#8203;9879](https://github.com/phpstan/phpstan/issues/9879), thanks [@&#8203;jdecool](https://github.com/jdecool)! # Function signature fixes 🤖 - Fix type of return value for `WeakMap::offsetGet()` ([#&#8203;3165](https://github.com/phpstan/phpstan-src/pull/3165)), [#&#8203;11194](https://github.com/phpstan/phpstan/issues/11194), thanks [@&#8203;sonnymilton](https://github.com/sonnymilton)! - Treat SplFileObject methods as impure/having side effects ([#&#8203;3174](https://github.com/phpstan/phpstan-src/pull/3174)), [#&#8203;11200](https://github.com/phpstan/phpstan/issues/11200), thanks [@&#8203;mind-bending-forks](https://github.com/mind-bending-forks)! - More precise `getimagesize*` return type ([#&#8203;3183](https://github.com/phpstan/phpstan-src/pull/3183)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Prevent unnecesary calls to `Type::isSuperTypeOf()` ([#&#8203;3164](https://github.com/phpstan/phpstan-src/pull/3164)), [#&#8203;11194](https://github.com/phpstan/phpstan/issues/11194), thanks [@&#8203;staabm](https://github.com/staabm)! - Update phpcs config with proper exclude pattern ([#&#8203;3150](https://github.com/phpstan/phpstan-src/pull/3150)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Use bashunit for e2e tests ([#&#8203;3160](https://github.com/phpstan/phpstan-src/pull/3160)), [#&#8203;11202](https://github.com/phpstan/phpstan/issues/11202), thanks [@&#8203;staabm](https://github.com/staabm)! - issue-bot: subshell is eating the exit code ([#&#8203;3171](https://github.com/phpstan/phpstan-src/pull/3171)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix typo in FunctionDefinitionCheck ([#&#8203;3176](https://github.com/phpstan/phpstan-src/pull/3176)), thanks [@&#8203;szepeviktor](https://github.com/szepeviktor)! - Add spelling workflow ([#&#8203;3179](https://github.com/phpstan/phpstan-src/pull/3179)), thanks [@&#8203;szepeviktor](https://github.com/szepeviktor)! - Refactor SprintfFunctionDynamicReturnTypeExtension ([#&#8203;3187](https://github.com/phpstan/phpstan-src/pull/3187)), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify SprintfFunctionDynamicReturnTypeExtension ([#&#8203;3188](https://github.com/phpstan/phpstan-src/pull/3188)), thanks [@&#8203;staabm](https://github.com/staabm)! - Added regression test ([#&#8203;3198](https://github.com/phpstan/phpstan-src/pull/3198)), thanks [@&#8203;staabm](https://github.com/staabm)! - Use early-returns in TypeCombinator ([#&#8203;3197](https://github.com/phpstan/phpstan-src/pull/3197)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.11.5`](https://github.com/phpstan/phpstan/releases/tag/1.11.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.4...1.11.5) # Bleeding edge 🔪 - Check array functions which require stringish values ([#&#8203;3132](https://github.com/phpstan/phpstan-src/pull/3132)), [#&#8203;11141](https://github.com/phpstan/phpstan/issues/11141), [#&#8203;5848](https://github.com/phpstan/phpstan/issues/5848), [#&#8203;3694](https://github.com/phpstan/phpstan/issues/3694), [#&#8203;11111](https://github.com/phpstan/phpstan/issues/11111), thanks [@&#8203;schlndh](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - When internal errors occur, do not show other reported errors (https://github.com/phpstan/phpstan-src/commit/aa921137be5b510408bc8df9b8b6fe632ed09db5) - It's important to first solve internal errors before seeing other reported errors - Inspired by https://github.com/phpstan/phpstan/discussions/11107 (ReviewDog was eating up important errors) - Show internal errors nicely in PHPStan Pro # Bugfixes 🐛 - Fix bug in `get_debug_type()` DynamicFunctionReturnTypeExtension ([#&#8203;3128](https://github.com/phpstan/phpstan-src/pull/3128)), thanks [@&#8203;patrickkusebauch](https://github.com/patrickkusebauch)! - Include path when counting errors ignored by identifier ([#&#8203;3154](https://github.com/phpstan/phpstan-src/pull/3154)), [#&#8203;11177](https://github.com/phpstan/phpstan/issues/11177), thanks [@&#8203;pilif](https://github.com/pilif)! - Implement bit shift operation on integers and unions ([#&#8203;3145](https://github.com/phpstan/phpstan-src/pull/3145)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Fix division type result with even integer range ([#&#8203;3152](https://github.com/phpstan/phpstan-src/pull/3152)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Solve identical comparison bug in call-site variance ([#&#8203;3153](https://github.com/phpstan/phpstan-src/pull/3153)), [#&#8203;11161](https://github.com/phpstan/phpstan/issues/11161), [#&#8203;10697](https://github.com/phpstan/phpstan/issues/10697), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - `gnupg_init()` `options` parameter is optional ([#&#8203;3129](https://github.com/phpstan/phpstan-src/pull/3129)), thanks [@&#8203;yphoenix](https://github.com/yphoenix)! - Update outdated `RedisCluster::__construct` signature ([#&#8203;3130](https://github.com/phpstan/phpstan-src/pull/3130)), [#&#8203;11158](https://github.com/phpstan/phpstan/issues/11158), thanks [@&#8203;wolfgangzwiauer](https://github.com/wolfgangzwiauer)! - Improve image related functions signature ([#&#8203;3127](https://github.com/phpstan/phpstan-src/pull/3127)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Update/fix ext-amqp signatures ([#&#8203;3139](https://github.com/phpstan/phpstan-src/pull/3139)), thanks [@&#8203;ben-challis](https://github.com/ben-challis)! - fix `AMQPQueue::unbind()` routingKey type ([#&#8203;3143](https://github.com/phpstan/phpstan-src/pull/3143)), thanks [@&#8203;ben-challis](https://github.com/ben-challis)! - Add parameter definitions to `AMQPQueue::consume()` callback ([#&#8203;3144](https://github.com/phpstan/phpstan-src/pull/3144)), [#&#8203;9445](https://github.com/phpstan/phpstan/issues/9445), thanks [@&#8203;ben-challis](https://github.com/ben-challis)! - Add int ranges to AMQP typings ([#&#8203;3146](https://github.com/phpstan/phpstan-src/pull/3146)), thanks [@&#8203;ben-challis](https://github.com/ben-challis)! - Various fixes to the return signature of `IntlDateFormatter` methods ([#&#8203;3149](https://github.com/phpstan/phpstan-src/pull/3149)), thanks [@&#8203;chosten](https://github.com/chosten)! - Fix `Exception::getTrace()` return type (https://github.com/phpstan/phpstan-src/commit/492cd89932d873147cdf7acf49c88d432cbce69f) - fix posix_getpwuid ([#&#8203;3157](https://github.com/phpstan/phpstan-src/pull/3157)), thanks [@&#8203;pistej](https://github.com/pistej)! # Internals 🔍 - Regression test ([#&#8203;3136](https://github.com/phpstan/phpstan-src/pull/3136)), thanks [@&#8203;staabm](https://github.com/staabm)! - Relax test version restriction ([#&#8203;3140](https://github.com/phpstan/phpstan-src/pull/3140)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Fix `PrepareCommand::fixComposerJson()` (https://github.com/phpstan/phpstan-src/commit/4537ef1445b910930afa32d7fd8f22b044fdc726) - Internal errors as structured objects (https://github.com/phpstan/phpstan-src/commit/7cd03f02a5c32ca4e51006dc21d6184f73835a14) - WorkerCommand - do not return exit code 1 in case of internal errors, they are handled anyway (https://github.com/phpstan/phpstan-src/commit/f76d836d13fb94e9887260ae18229ad2ca2ce2ce) - NodeScopeResolverTest - remove requires (https://github.com/phpstan/phpstan-src/commit/f6b989881e66445197f6526bfcde868a60472098) - Fix discrepancy between `lint >=` and `PHP_VERSION_ID` in NodeScopeResolverTest (https://github.com/phpstan/phpstan-src/commit/b530b0d53d3fc990dcb0225e0d997af06ee15180) - `TypeInferenceTestCase::gatherAssertTypesFromDirectory()` (https://github.com/phpstan/phpstan-src/commit/595de78d35124d00eed90c09f5fd73cb40351e02) - Take advantage of gatherAssertTypesFromDirectory in NodeScopeResolverTest ([#&#8203;3159](https://github.com/phpstan/phpstan-src/pull/3159)) - Turn TraitsCachingIssueIntegrationTest into a e2e test ([#&#8203;3151](https://github.com/phpstan/phpstan-src/pull/3151)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.11.4`](https://github.com/phpstan/phpstan/releases/tag/1.11.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.3...1.11.4) # Improvements 🔧 - Detect `--generate-baseline` combined with `--pro` (https://github.com/phpstan/phpstan-src/commit/dd028cb4ccc44c6aa12b51f443e8761d5d4efc1d), [#&#8203;11093](https://github.com/phpstan/phpstan/issues/11093) - Add error identifier to RawErrorFormatter ([#&#8203;3112](https://github.com/phpstan/phpstan-src/pull/3112)), [#&#8203;11125](https://github.com/phpstan/phpstan/issues/11125), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Pass current rule level to PHPStan Pro (https://github.com/phpstan/phpstan-src/commit/7af14fbfc027b15e3342ac95be783bd3fa1df413) - Read and enforce PHPStan version constraints from `phpstan/extension-installer` v1.4 (https://github.com/phpstan/phpstan-src/commit/1d005ef1e72f77afada37bad491f2b6602f4cc92) # Bugfixes 🐛 - Consider `numeric-string` types after string concat ([#&#8203;3117](https://github.com/phpstan/phpstan-src/pull/3117)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix type loss with recursive `count()` ([#&#8203;2812](https://github.com/phpstan/phpstan-src/pull/2812)), thanks [@&#8203;staabm](https://github.com/staabm)! - `array_slice()` returns `non-empty-array` for existing offsets and positive limit ([#&#8203;3124](https://github.com/phpstan/phpstan-src/pull/3124)), [#&#8203;10721](https://github.com/phpstan/phpstan/issues/10721), thanks [@&#8203;staabm](https://github.com/staabm)! - Consider a `ClosureType()` as maybe impure by default when no `$impurePoints` array provided ([#&#8203;3125](https://github.com/phpstan/phpstan-src/pull/3125)), [#&#8203;11135](https://github.com/phpstan/phpstan/issues/11135), thanks [@&#8203;jf-m](https://github.com/jf-m)! # Function signature fixes 🤖 - Make the return type of `tempnam()` and `tmpfile()` to benevolent union ([#&#8203;3111](https://github.com/phpstan/phpstan-src/pull/3111)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Fix `gnupg_init` function ([#&#8203;3118](https://github.com/phpstan/phpstan-src/pull/3118)), thanks [@&#8203;pistej](https://github.com/pistej)! # Internals 🔍 - Update `react/promise` (https://github.com/phpstan/phpstan-src/commit/da754e2294a619bacc95cd42426e94c17a57365b) ### [`v1.11.3`](https://github.com/phpstan/phpstan/releases/tag/1.11.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.2...1.11.3) # Improvements 🔧 - Add new `*ParameterClosureTypeExtension` ([#&#8203;3089](https://github.com/phpstan/phpstan-src/pull/3089)), thanks [@&#8203;canvural](https://github.com/canvural)! - DynamicFunctionReturnTypeExtension for the `get_debug_type` function ([#&#8203;2910](https://github.com/phpstan/phpstan-src/pull/2910)), [#&#8203;10558](https://github.com/phpstan/phpstan/issues/10558), [#&#8203;10585](https://github.com/phpstan/phpstan/issues/10585), thanks [@&#8203;patrickkusebauch](https://github.com/patrickkusebauch)! - Infer more duplicated array keys ([#&#8203;3058](https://github.com/phpstan/phpstan-src/pull/3058)), [#&#8203;6976](https://github.com/phpstan/phpstan/issues/6976), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve `explode` return type precision ([#&#8203;3096](https://github.com/phpstan/phpstan-src/pull/3096)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make assigning property via reference impure ([#&#8203;3082](https://github.com/phpstan/phpstan-src/pull/3082)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Support new PHP 8.4 mb_lcfirst, mb_ucfirst function variants ([#&#8203;3095](https://github.com/phpstan/phpstan-src/pull/3095)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Make `array_map` argument take into account unpack ([#&#8203;2901](https://github.com/phpstan/phpstan-src/pull/2901)), [#&#8203;10527](https://github.com/phpstan/phpstan/issues/10527), thanks [@&#8203;ryium](https://github.com/ryium)! - Fixes incorrect types reported by `parse_url` ([#&#8203;2918](https://github.com/phpstan/phpstan-src/pull/2918)), [#&#8203;4754](https://github.com/phpstan/phpstan/issues/4754), thanks [@&#8203;ChrisBrenton](https://github.com/ChrisBrenton)! - Ensure `$http_response_header` is a `list<string>` ([#&#8203;2959](https://github.com/phpstan/phpstan-src/pull/2959)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Keep numeric-strings in `str_repeat()` ([#&#8203;2914](https://github.com/phpstan/phpstan-src/pull/2914)), [#&#8203;10572](https://github.com/phpstan/phpstan/issues/10572), thanks [@&#8203;staabm](https://github.com/staabm)! - Array is non-empty even when `in_array` is not strict ([#&#8203;2539](https://github.com/phpstan/phpstan-src/pull/2539)), [#&#8203;9662](https://github.com/phpstan/phpstan/issues/9662), [#&#8203;10228](https://github.com/phpstan/phpstan/issues/10228), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `substr()` type narrowing for possibly single char result ([#&#8203;3081](https://github.com/phpstan/phpstan-src/pull/3081)), [#&#8203;11035](https://github.com/phpstan/phpstan/issues/11035), [#&#8203;9804](https://github.com/phpstan/phpstan/issues/9804), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix escaping of the error message in various output formatters ([#&#8203;3087](https://github.com/phpstan/phpstan-src/pull/3087)), thanks [@&#8203;mousetail](https://github.com/mousetail)! - `$this` cannot be reassigned when passed by reference ([#&#8203;3097](https://github.com/phpstan/phpstan-src/pull/3097)), [#&#8203;10477](https://github.com/phpstan/phpstan/issues/10477), thanks [@&#8203;takaram](https://github.com/takaram)! - Subtract zero-float when comparing against zero-int ([#&#8203;3102](https://github.com/phpstan/phpstan-src/pull/3102)), [#&#8203;5309](https://github.com/phpstan/phpstan/issues/5309), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix fatal error on `constant('')` ([#&#8203;3013](https://github.com/phpstan/phpstan-src/pull/3013)), [#&#8203;10867](https://github.com/phpstan/phpstan/issues/10867), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Add new header functions for PHP 8.4 ([#&#8203;3093](https://github.com/phpstan/phpstan-src/pull/3093)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Fix wrong return type for `SplFileObject::fgets()` ([#&#8203;3103](https://github.com/phpstan/phpstan-src/pull/3103)), thanks [@&#8203;DanielSiepmann](https://github.com/DanielSiepmann)! - Update `Locale` signatures ([#&#8203;2880](https://github.com/phpstan/phpstan-src/pull/2880)), [#&#8203;7855](https://github.com/phpstan/phpstan/issues/7855), [#&#8203;8149](https://github.com/phpstan/phpstan/issues/8149), thanks [@&#8203;devnix](https://github.com/devnix)! - Fix wrong `fread()` length parameter type and return type ([#&#8203;3105](https://github.com/phpstan/phpstan-src/pull/3105)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - ReflectionFunction and ReflectionMethod::getClosure cannot return null (https://github.com/phpstan/phpstan-src/commit/dae9335075964f197aa5d965b3d38c12788a6405), [#&#8203;10839](https://github.com/phpstan/phpstan/issues/10839) - Make method names `non-falsy-string` ([#&#8203;3108](https://github.com/phpstan/phpstan-src/pull/3108)), thanks [@&#8203;schlndh](https://github.com/schlndh)! # Internals 🔍 - Add regression test ([#&#8203;3066](https://github.com/phpstan/phpstan-src/pull/3066)), [#&#8203;3300](https://github.com/phpstan/phpstan/issues/3300), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Update phpdoc-parser ([#&#8203;3107](https://github.com/phpstan/phpstan-src/pull/3107)) - `TemplateTagValueNode::$name` cannot be empty string (https://github.com/phpstan/phpdoc-parser/commit/fcaefacf2d5c417e928405b71b400d4ce10daaf4), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix property descriptions in ReflectionProviderGoldenTest ([#&#8203;3109](https://github.com/phpstan/phpstan-src/pull/3109)), thanks [@&#8203;schlndh](https://github.com/schlndh)! ### [`v1.11.2`](https://github.com/phpstan/phpstan/releases/tag/1.11.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.1...1.11.2) # Improvements 🔧 - Stricter `@phpstan-ignore` identifiers parser ([#&#8203;3079](https://github.com/phpstan/phpstan-src/pull/3079), [#&#8203;3090](https://github.com/phpstan/phpstan-src/pull/3090), [#&#8203;3091](https://github.com/phpstan/phpstan-src/pull/3091)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - The parser now rejects some syntax that was possible but undocumented in 1.11.0 and 1.11.1 - The parser now allows to attach comment to each single identifier in a list: `@phpstan-ignore identifier (comment), identifier2 (comment2)` - Resolving type of closure - get `$passedToType` from `inFunctionCallsStack` (https://github.com/phpstan/phpstan-src/commit/ca41b7d8c2d54407156d07dab5375a3a5ebbeb29, https://github.com/phpstan/phpstan-src/commit/da4fd7a4122615d9dbae55083bdfd290026fa08e), [#&#8203;5508](https://github.com/phpstan/phpstan/issues/5508), [#&#8203;10254](https://github.com/phpstan/phpstan/issues/10254), [#&#8203;10732](https://github.com/phpstan/phpstan/issues/10732) - Do not lose generic type when the closure has native return type (https://github.com/phpstan/phpstan-src/commit/7e9cd45701562fb02f1aa9cab1f89b58a58f6526), [#&#8203;9086](https://github.com/phpstan/phpstan/issues/9086) # Function signature fixes 🤖 - More concrete return types for some database functions ([#&#8203;3078](https://github.com/phpstan/phpstan-src/pull/3078)), thanks [@&#8203;devnix](https://github.com/devnix)! # Internals 🔍 - Fix Composer by referencing deleted tag of `nette/di` (https://github.com/phpstan/phpstan-src/commit/2ab647e12fe46d970fa630b78f9ca962354b3d16) - Specify `array_filter` callbacks (https://github.com/phpstan/phpstan-src/commit/754b7b8e170cd36ed7bc8633b90651eff16cc893) - Add `@api` annotation to `AcceptsResult::__construct` ([#&#8203;3092](https://github.com/phpstan/phpstan-src/pull/3092)), thanks [@&#8203;canvural](https://github.com/canvural)! ### [`v1.11.1`](https://github.com/phpstan/phpstan/releases/tag/1.11.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.11.0...1.11.1) # Improvements 🔧 - Support integer ranges in `sprintf()` constant result inference ([#&#8203;3075](https://github.com/phpstan/phpstan-src/pull/3075)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Do not complain about `impure(Function|Method).pure` if it has `@phpstan-assert` tags (https://github.com/phpstan/phpstan-src/commit/9544f8a6b52dbd6068800bbfc5bdaf67fe04a8c2) - Remove tip about deprecated config option (https://github.com/phpstan/phpstan-src/commit/d603c7b676e3b91f4b7ba81d46aee3e9a593f883), [#&#8203;11000](https://github.com/phpstan/phpstan/issues/11000) - Fix false positive with `reportPossiblyNonexistentConstantArrayOffset: true` (https://github.com/phpstan/phpstan-src/commit/5277630459518024b16272bf6b6fd216eb3d10ed), [#&#8203;10997](https://github.com/phpstan/phpstan/issues/10997) - Fix parent keyword case sensitivity ([#&#8203;3064](https://github.com/phpstan/phpstan-src/pull/3064)), thanks [@&#8203;staabm](https://github.com/staabm)! - InlineHTML is an impure point ([#&#8203;3072](https://github.com/phpstan/phpstan-src/pull/3072)), thanks [@&#8203;staabm](https://github.com/staabm)! - UnionTypeHelper - prevent infinite recursion (https://github.com/phpstan/phpstan-src/commit/bb3da26d562727c3122a344622059ded2239d6ab), [#&#8203;11027](https://github.com/phpstan/phpstan/issues/11027) - Fix more potential for infinite recursion (https://github.com/phpstan/phpstan-src/commit/1d02c4f27684644e8361cf2a2bc5713adef9b95e) - RangeFunctionReturnTypeExtension - fix internal ValueError (https://github.com/phpstan/phpstan-src/commit/fe3895ada98940d1a71c2eb115d61afda9fd7a2c), [#&#8203;11026](https://github.com/phpstan/phpstan/issues/11026) - Property unset is an impure point (https://github.com/phpstan/phpstan-src/commit/702ddcd7805ba08c0765bdf0930beaef0e6b4fc1), [#&#8203;11001](https://github.com/phpstan/phpstan/issues/11001) - Fix property assign not being an impure point in arrow function (https://github.com/phpstan/phpstan-src/commit/35ff6895f48b74e8bc0dda7ec94c40e73c84099b), [#&#8203;11001](https://github.com/phpstan/phpstan/issues/11001) - Fix internal error when accessing enum case by class-string (https://github.com/phpstan/phpstan-src/commit/1116e03389f0f47297c2638b5b67c84f4d339478), [#&#8203;10985](https://github.com/phpstan/phpstan/issues/10985) - Fix resolving `self` and `static` in `@phpstan-closure-this` from trait stub file (https://github.com/phpstan/phpstan-src/commit/93402494ee92dd2e7264f112105151586203e0ec), [#&#8203;11009](https://github.com/phpstan/phpstan/issues/11009) - CallToMethodStatementWithoutImpurePointsRule - fix for methods called on unions (https://github.com/phpstan/phpstan-src/commit/ee33f1e48b5ae9d6e99500814c186cd31e7a764f), [#&#8203;11011](https://github.com/phpstan/phpstan/issues/11011) # Function signature fixes 🤖 - Offset `uri` in `stream_get_meta_data` calls is always present on PHP 8.3+ (https://github.com/phpstan/phpstan-src/commit/885d46bc8d7555a8b762914821ad2f0f5871e517), [#&#8203;11024](https://github.com/phpstan/phpstan/issues/11024), [#&#8203;10999](https://github.com/phpstan/phpstan/issues/10999) ### [`v1.11.0`](https://github.com/phpstan/phpstan/releases/tag/1.11.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.67...1.11.0) [**Read the article about PHPStan 1.11 on phpstan.org »**](https://phpstan.org/blog/phpstan-1-11-errors-identifiers-phpstan-pro-reboot) # Major new features 🚀 - **Error identifiers** - A way to categorize reported errors by a stable identifier. Up until now you had to use specific and ever-changing error messages - Can be used for [ignoring specific errors locally](https://phpstan.org/user-guide/ignoring-errors#ignoring-in-code-using-phpdocs) with new `@phpstan-ignore` comment (uses current or next line automatically) - Can be used for [ignoring specific errors in `ignoreErrors`](https://phpstan.org/user-guide/ignoring-errors#ignoring-in-configuration-file) section of your configuration file (phpstan.neon) - Can be used in [output formatters](https://phpstan.org/user-guide/output-format) - Can be seen in PHPStan Pro GUI or in TableErrorFormatter with `-v` - Catalogue with source code links: https://phpstan.org/error-identifiers - **PHPStan Pro Reboot** - A new migration wizard will effortlessly migrate all your `@phpstan-ignore-line` and `@phpstan-ignore-next-line` to the new `@phpstan-ignore` comment style with error identifiers. The old comment style is dangerous because it ignores all errors, current and future, on that line. - Revamped UI for much more comfortable viewing and browsing of reported errors - The new UI also lets you **browse ignored errors**, from `ignoreErrors`, from your baseline and also ignored locally in source code using comments - Streaming errors during launch: You don't have to wait for the analysis to complete, you can see errors as they come in during the analysis - Support for mapping file paths to the host filesystem when running in Docker or remotely - Try it out by running PHPStan with `--pro` CLI option - PHPDoc tags describing callable lifecycle: `@param-immediately-invoked-callable`, `@param-later-invoked-callable` - Useful for exception analysis (https://phpstan.org/blog/bring-your-exceptions-under-control) and `@phpstan-pure` - PHPDoc tag `@param-closure-this` to describe what `$this` is bound to in a passed closure - Two new config options around stricter offset checks in arrays ([#&#8203;3028](https://github.com/phpstan/phpstan-src/pull/3028)), [#&#8203;7553](https://github.com/phpstan/phpstan/issues/7553), thanks [@&#8203;ttomdewit](https://github.com/ttomdewit)! - `reportPossiblyNonexistentGeneralArrayOffset` - `reportPossiblyNonexistentConstantArrayOffset` - [Learn more in the documentation](https://phpstan.org/config-reference#reportpossiblynonexistentgeneralarrayoffset) # Bleeding edge 🔪 - Checking truthiness of `@phpstan-pure` above functions and methods - Check `new`/function call/method call/static method call on a separate line without any side effects even without `@phpstan-pure` PHPDoc tag on the declaration side - https://github.com/phpstan/phpstan-src/commit/281a87d1ab61809076ecfa6dfc2cc86e3babe235 - [#&#8203;3020](https://github.com/phpstan/phpstan-src/pull/3020), thanks [@&#8203;staabm](https://github.com/staabm)! - [#&#8203;3022](https://github.com/phpstan/phpstan-src/pull/3022), thanks [@&#8203;staabm](https://github.com/staabm)! - [#&#8203;3023](https://github.com/phpstan/phpstan-src/pull/3023), thanks [@&#8203;staabm](https://github.com/staabm)! - BetterNoopRule - take advantage of impure points (https://github.com/phpstan/phpstan-src/commit/a6470521b65d7424f552633c1f3827704c6262c3), [#&#8203;10389](https://github.com/phpstan/phpstan/issues/10389) - Run missing type check on `@param-out` (https://github.com/phpstan/phpstan-src/commit/56b20024386d983927c64dfa895ff026bed2798c) - CallToConstructorStatementWithoutSideEffectsRule - report class with no constructor (https://github.com/phpstan/phpstan-src/commit/b116d25a6e4ba6c09f59af6569d9e6f6fd20aff4) - Deprecated: returning plain strings as errors, use RuleErrorBuilder - Learn more: [Using RuleErrorBuilder to enrich reported errors in custom rules](https://phpstan.org/blog/using-rule-error-builder) - Deprecated: returning RuleError without identifier (https://github.com/phpstan/phpstan-src/commit/969e6fa31d5484d42dab902703cfc6820a983cfd) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Generic RuleErrorBuilder (https://github.com/phpstan/phpstan-src/commit/9a3ed85178097e2d74f27623dd02bdd72c571e5b) - Deprecate `checkMissingIterableValueType: false` and `checkGenericClassInNonGenericObjectType: false` in favour of ignoring via identifiers (https://github.com/phpstan/phpstan-src/commit/a64998108b318581b0203e84582711c3e4d1e43c) - Deprecate old NoopRule - replaced by BetterNoopRule in bleeding edge (https://github.com/phpstan/phpstan-src/commit/109083571de6102cb854b9975c1463551ef678d0) - Allow ignoring errors from CollectedDataNode with local comments (https://github.com/phpstan/phpstan-src/commit/dc3b75ab4a2acd863405416620240302b284973a) - Introduce `new` type ([#&#8203;3050](https://github.com/phpstan/phpstan-src/pull/3050)), [#&#8203;9704](https://github.com/phpstan/phpstan/issues/9704), thanks [@&#8203;ruudk](https://github.com/ruudk)! - RuleTestCase - fail on PHP warnings, notices etc. ([#&#8203;3030](https://github.com/phpstan/phpstan-src/pull/3030)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Check duplicate assignment of redeclared promoted readonly properties ([#&#8203;3049](https://github.com/phpstan/phpstan-src/pull/3049)), [#&#8203;8101](https://github.com/phpstan/phpstan/issues/8101), [#&#8203;9863](https://github.com/phpstan/phpstan/issues/9863), [#&#8203;9864](https://github.com/phpstan/phpstan/issues/9864), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Remove line from "nikic/php-parser" error message ([#&#8203;2845](https://github.com/phpstan/phpstan-src/pull/2845)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Stub validator - PHPStan classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/d004c239677fb7abe41aa16e8e1b45bfac63f773) - Stub validator - PhpParser classes are known without extra stubs (https://github.com/phpstan/phpstan-src/commit/3e498e1592221f3a01527c10318424014d52f85d) - CheckstyleErrorFormatter - include error identifier in source attribute (https://github.com/phpstan/phpstan-src/commit/f66cf5badd2c98317d1d296ba24c3be77efcda18), [#&#8203;1205](https://github.com/phpstan/phpstan/issues/1205) - BaselinePhpErrorFormatter - error identifiers in comments (https://github.com/phpstan/phpstan-src/commit/4b32cac2d1b98c6af65c07041fdbc64e5d3f3baf) - `RuleErrorBuilder::file()` - file path needs to exist (https://github.com/phpstan/phpstan-src/commit/c453f29f60992167a5aa46d4926c18a420ae7b26) - AbstractMethodInNonAbstractClassRule - better error message for enums (https://github.com/phpstan/phpstan-src/commit/b5dd34e492b03566458e98b314c6852cfd683916) - Fixed Xdebug spelling ([#&#8203;2746](https://github.com/phpstan/phpstan-src/pull/2746)), thanks [@&#8203;derickr](https://github.com/derickr)! - Track invalidated `$this` and used variables after invoking closure ([#&#8203;2980](https://github.com/phpstan/phpstan-src/pull/2980)) - Support `@phan-` prefixes on recognized PHPDoc tags ([#&#8203;3000](https://github.com/phpstan/phpstan-src/pull/3000)), thanks [@&#8203;anomiex](https://github.com/anomiex)! - `pure-callable` and `pure-Closure` PHPDoc types (https://github.com/phpstan/phpstan-src/commit/cdaff5f00d621c3a94e048b8bd9fa864d47b3228) - `highlight_string()` flips side-effects depending on $return ([#&#8203;3021](https://github.com/phpstan/phpstan-src/pull/3021)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve types for predefined constants ([#&#8203;3054](https://github.com/phpstan/phpstan-src/pull/3054)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Make `AccessoryNonFalsyStringType::toInteger()` return `IntegerType` instead of non-zero ([#&#8203;3018](https://github.com/phpstan/phpstan-src/pull/3018)), [#&#8203;10893](https://github.com/phpstan/phpstan/issues/10893), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Filter scope by non-empty array after foreach regardless of `polluteScopeWithAlwaysIterableForeach` ([#&#8203;3029](https://github.com/phpstan/phpstan-src/pull/3029)), [#&#8203;10922](https://github.com/phpstan/phpstan/issues/10922), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Preserve large arrays with same keys through union ([#&#8203;3032](https://github.com/phpstan/phpstan-src/pull/3032)), [#&#8203;9397](https://github.com/phpstan/phpstan/issues/9397), [#&#8203;10080](https://github.com/phpstan/phpstan/issues/10080), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix `count($x) > $n === true` negation ([#&#8203;3037](https://github.com/phpstan/phpstan-src/pull/3037)), [#&#8203;10952](https://github.com/phpstan/phpstan/issues/10952), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix NAN not accepting NAN ([#&#8203;3036](https://github.com/phpstan/phpstan-src/pull/3036)), [#&#8203;10956](https://github.com/phpstan/phpstan/issues/10956), [#&#8203;10297](https://github.com/phpstan/phpstan/issues/10297), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - DateTimeInstantiationRule - fix error message for `new` with wrong name case (https://github.com/phpstan/phpstan-src/commit/59ac31a554203a7ae3fb9449bbd5b61f3afe2e20) - Process ConstFetch (https://github.com/phpstan/phpstan-src/commit/b5c63c296783bd067b14bad410dab2b87a1b7b3c) - Fix `preg_match_all` behaviour with no flags (https://github.com/phpstan/phpstan-src/commit/a856ec7ab5540cb4a8d30e9e170958a32a7165b2) - `file_get_contents` is an impure function (https://github.com/phpstan/phpstan-src/commit/2b5b3174c7f00e56b7692b4c26552b2ad13c73d5) - Fix `ClosureType::equals()` (https://github.com/phpstan/phpstan-src/commit/29c35b584a948e9a3c90e2d56312069ce073e6e6) - Use statement result of analysed anonymous class to inform about throw points and impure points (https://github.com/phpstan/phpstan-src/commit/70a75f68896e5f7eaa988c0cb7f20dad32c3c172) - Filter out implicit throw points from callables when `exceptions.implicitThrows: false` ([#&#8203;3016](https://github.com/phpstan/phpstan-src/pull/3016)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Fix `ConstantArrayType::hasOffsetValueType()` for offset union type where all types are valid (https://github.com/phpstan/phpstan-src/commit/26e949b0d093751c98e9a106f680092abf3b28d9) - `non-empty-list` always has offset 0 (https://github.com/phpstan/phpstan-src/commit/f4d1d481472b45c56ba2cd49ae98065092217f36) - Narrow to `non-empty-string`/`non-falsey-string` after `mb_strlen()` ([#&#8203;3038](https://github.com/phpstan/phpstan-src/pull/3038)), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement `Type::isOffsetAccessLegal()` to detect offset access that crashes even in `isset()` ([#&#8203;3045](https://github.com/phpstan/phpstan-src/pull/3045)), [#&#8203;8393](https://github.com/phpstan/phpstan/issues/8393), [#&#8203;10926](https://github.com/phpstan/phpstan/issues/10926), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Specify types on `match()` condition correctly ([#&#8203;3053](https://github.com/phpstan/phpstan-src/pull/3053)), [#&#8203;10974](https://github.com/phpstan/phpstan/issues/10974), [#&#8203;9694](https://github.com/phpstan/phpstan/issues/9694), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - `json_decode` with force array flag: subtract all objects, not just stdClass ([#&#8203;3052](https://github.com/phpstan/phpstan-src/pull/3052)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix `strlen($x) > $n === true` negation ([#&#8203;3040](https://github.com/phpstan/phpstan-src/pull/3040)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support multi-byte string function variants ([#&#8203;3039](https://github.com/phpstan/phpstan-src/pull/3039)), thanks [@&#8203;staabm](https://github.com/staabm)! - Final scope from `Continue_` points should not be used for `while (true)` ([#&#8203;3057](https://github.com/phpstan/phpstan-src/pull/3057)), [#&#8203;10980](https://github.com/phpstan/phpstan/issues/10980), thanks [@&#8203;greew](https://github.com/greew)! - Fix enum performance problem ([#&#8203;3062](https://github.com/phpstan/phpstan-src/pull/3062), [#&#8203;3060](https://github.com/phpstan/phpstan-src/pull/3060)), [#&#8203;10979](https://github.com/phpstan/phpstan/issues/10979), thanks [@&#8203;staabm](https://github.com/staabm)! - NULL and null as a property default value are treated differently when overriding a parent property ([#&#8203;3063](https://github.com/phpstan/phpstan-src/pull/3063)), [#&#8203;10987](https://github.com/phpstan/phpstan/issues/10987), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Make the url key of metadata returned by `stream_get_meta_data()` optional ([#&#8203;3024](https://github.com/phpstan/phpstan-src/pull/3024)), [#&#8203;10887](https://github.com/phpstan/phpstan/issues/10887), thanks [@&#8203;hirokinoue](https://github.com/hirokinoue)! - Narrow `Closure::bind` `$newScope` param ([#&#8203;2817](https://github.com/phpstan/phpstan-src/pull/2817)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Infer object type mysqli_fetch_object ([#&#8203;2675](https://github.com/phpstan/phpstan/issues/2675)) ([#&#8203;2675](https://github.com/phpstan/phpstan-src/pull/2675)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `Imagick::identifyImage()` return type ([#&#8203;3017](https://github.com/phpstan/phpstan-src/pull/3017)), thanks [@&#8203;SVillette](https://github.com/SVillette)! # Internals 🔍 - Clean up old identifiers and metadata (https://github.com/phpstan/phpstan-src/commit/c476a8611d06ed5ce850ba74bd087ed0fa9304ad) - Delete StatementOrderVisitor that is no longer needed (https://github.com/phpstan/phpstan-src/commit/017d321f47b2a49c11b0337a920235b0770da164) - Introduce `ClassReflection::getClassTypeDescription()` (https://github.com/phpstan/phpstan-src/commit/dec9e435a7e0cea96079eb08c799df6b49b92e82) - Fix classname typo in tests ([#&#8203;2461](https://github.com/phpstan/phpstan-src/pull/2461)), thanks [@&#8203;szepeviktor](https://github.com/szepeviktor)! - Fix various typos ([#&#8203;2463](https://github.com/phpstan/phpstan-src/pull/2463)), thanks [@&#8203;szepeviktor](https://github.com/szepeviktor)! - Added text regarding patch issues during installation ([#&#8203;2670](https://github.com/phpstan/phpstan-src/pull/2670)), thanks [@&#8203;mt-satak](https://github.com/mt-satak)! - Fix typo in ArgumentsNormalizer ([#&#8203;2705](https://github.com/phpstan/phpstan-src/pull/2705)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Rich PHPDoc for ExceptionTypeResolver (https://github.com/phpstan/phpstan-src/commit/e7ab4f741c0ec22cf70457c7a542b7978202b10a) - Hide internal commands ([#&#8203;2833](https://github.com/phpstan/phpstan-src/pull/2833)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Test invalidated object in static closure ([#&#8203;2981](https://github.com/phpstan/phpstan-src/pull/2981)), thanks [@&#8203;staabm](https://github.com/staabm)! - PHPDoc: address multiple variables defined in one [@&#8203;param](https://github.com/param) ([#&#8203;3001](https://github.com/phpstan/phpstan-src/pull/3001)), thanks [@&#8203;Muqsit](https://github.com/Muqsit)! - Do not assume every contributor uses PhpStorm (https://github.com/phpstan/phpstan-src/commit/d1834e69d06e0f85a45db8f5fb7a2c5a6ce898b6) - TypeInferenceTestCase: ability to disable implicit throws ([#&#8203;3015](https://github.com/phpstan/phpstan-src/pull/3015)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Slightly reduce comparing and calling methods for trivial optimizations ([#&#8203;3004](https://github.com/phpstan/phpstan-src/pull/3004)), [#&#8203;10926](https://github.com/phpstan/phpstan/issues/10926), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - AnalyserResultFinalizer - DRY of running CollectedDataNode rules (https://github.com/phpstan/phpstan-src/commit/38e2c96ee45733c8d3b44d048ce27a9b5450718e) - Introduce LocalIgnoresProcessor (https://github.com/phpstan/phpstan-src/commit/d026655260727c7c6e4cd69d50d57569e9128c13) - Introduce `RuleErrorBuilder::treatPhpDocTypesAsCertainTip()` for a bit more DRYness ([#&#8203;3035](https://github.com/phpstan/phpstan-src/pull/3035)), thanks [@&#8203;axlon](https://github.com/axlon)! - Make ResultCacheEndToEndTest pass level 9 ([#&#8203;3055](https://github.com/phpstan/phpstan-src/pull/3055)), [#&#8203;10977](https://github.com/phpstan/phpstan/issues/10977), thanks [@&#8203;AJenbo](https://github.com/AJenbo)! - ClassReflection - cache enum cases (https://github.com/phpstan/phpstan-src/commit/39ce0425737cdbacfee5fbc08160d023cb5bc639), [#&#8203;10979](https://github.com/phpstan/phpstan/issues/10979) ### [`v1.10.67`](https://github.com/phpstan/phpstan/releases/tag/1.10.67) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.66...1.10.67) **This is the last release, or one of the last releases, in 1.10.x series. The next one is going to be PHPStan 1.11, and it's going to be released at some point in May 2024.** # Improvements 🔧 - Forbid PHPUnitPHAR prefixed classes ([#&#8203;3002](https://github.com/phpstan/phpstan-src/pull/3002)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve error messages on unnamed parameters ([#&#8203;3010](https://github.com/phpstan/phpstan-src/pull/3010)), [#&#8203;10814](https://github.com/phpstan/phpstan/issues/10814), thanks [@&#8203;takaram](https://github.com/takaram)! # Bugfixes 🐛 - Improve `date()` return types ([#&#8203;2888](https://github.com/phpstan/phpstan-src/pull/2888)), [#&#8203;10468](https://github.com/phpstan/phpstan/issues/10468), [#&#8203;6613](https://github.com/phpstan/phpstan/issues/6613), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Default value null does not make promoted property type nullable (https://github.com/phpstan/phpstan-src/commit/b2177e350f79176a5d53eaf75e37e5dce0053f8a), [#&#8203;9839](https://github.com/phpstan/phpstan/issues/9839) - Fix socket_select array types after call (https://github.com/phpstan/phpstan-src/commit/24c52494be982429eb6782ad859fb6cbd6fb3dee), https://github.com/phpstan/phpstan/discussions/10285 - Fix conditional types in PHPDocs from stubs for native functions (https://github.com/phpstan/phpstan-src/commit/8ae0b28a5c1e6f4e2c692caff0cd99df07f2486e) - Fix env int key problem (https://github.com/phpstan/phpstan-src/commit/e606fbedaea7e887456a771ce0dbb9572d16accf), [#&#8203;10833](https://github.com/phpstan/phpstan/issues/10833) - Fix false positives about uninitialized properties ([#&#8203;2897](https://github.com/phpstan/phpstan-src/pull/2897)), [#&#8203;10523](https://github.com/phpstan/phpstan/issues/10523), [#&#8203;10822](https://github.com/phpstan/phpstan/issues/10822), thanks [@&#8203;staabm](https://github.com/staabm)! - Incremented numeric-string should change to int/float ([#&#8203;2797](https://github.com/phpstan/phpstan-src/pull/2797)), [#&#8203;10122](https://github.com/phpstan/phpstan/issues/10122), [#&#8203;10187](https://github.com/phpstan/phpstan/issues/10187), thanks [@&#8203;staabm](https://github.com/staabm)! - Do not generalize big array when combined with empty array ([#&#8203;3003](https://github.com/phpstan/phpstan-src/pull/3003)), [#&#8203;10834](https://github.com/phpstan/phpstan/issues/10834), thanks [@&#8203;RobertMe](https://github.com/RobertMe)! - Fix string concatenation with benevolent union type (https://github.com/phpstan/phpstan-src/commit/4a4c739f9ff85b6c73659c21f8f3b8b7af8c82c9), [#&#8203;10863](https://github.com/phpstan/phpstan/issues/10863) - Treat `get_defined_vars()` as using constructor arguments ([#&#8203;3012](https://github.com/phpstan/phpstan-src/pull/3012)), [#&#8203;10865](https://github.com/phpstan/phpstan/issues/10865), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Allow undefined variables passed into by-ref parameters only if the type is nullable (https://github.com/phpstan/phpstan-src/commit/7f8f9cce7f3903e505916c7afe04b7912570b5e2, https://github.com/phpstan/phpstan-src/commit/7961f7ae1fe815b0796e4d73717f1b117d4a7163), [#&#8203;1916](https://github.com/phpstan/phpstan/issues/1916) # Function signature fixes 🤖 - More precise `gc_status()` signature for PHP8.3+ ([#&#8203;2996](https://github.com/phpstan/phpstan-src/pull/2996)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add object shape for `mysqli_result::fetch_fields` ([#&#8203;3005](https://github.com/phpstan/phpstan-src/pull/3005)), thanks [@&#8203;schlndh](https://github.com/schlndh)! # Internals 🔍 - composer-dependency-analyser: update to 1.5.0 (support functions) ([#&#8203;3011](https://github.com/phpstan/phpstan-src/pull/3011)), thanks [@&#8203;janedbal](https://github.com/janedbal)! ### [`v1.10.66`](https://github.com/phpstan/phpstan/releases/tag/1.10.66) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.65...1.10.66) # Improvements 🔧 - Detect mismatch between readonly/non-readonly class parent (https://github.com/phpstan/phpstan-src/commit/986cbdfb2fd0c3de71b31ac3f212bd499d2131e1), [#&#8203;10789](https://github.com/phpstan/phpstan/issues/10789) - TypeInferenceTestCase - fix for performance problem with PHPUnit 11 (https://github.com/phpstan/phpstan-src/commit/da87a6541f97b01e35d309524f05c0d3d0bc0a00), [#&#8203;10757](https://github.com/phpstan/phpstan/issues/10757) # Bugfixes 🐛 - `array_push` preserves list (https://github.com/phpstan/phpstan-src/commit/5473b6701c1a9dd3ca1eb676b3b2c0dec43f2535) # Function signature fixes 🤖 - Fix `redis::get` signature ([#&#8203;2990](https://github.com/phpstan/phpstan-src/pull/2990)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Prevent unnecessary calls into reflection from JSON extensions ([#&#8203;2994](https://github.com/phpstan/phpstan-src/pull/2994)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.65`](https://github.com/phpstan/phpstan/releases/tag/1.10.65) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.64...1.10.65) # Improvements 🔧 - Fix slow enum cases union with lots of cases ([#&#8203;2985](https://github.com/phpstan/phpstan-src/pull/2985)), [#&#8203;10772](https://github.com/phpstan/phpstan/issues/10772), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Update BetterReflection ([#&#8203;2988](https://github.com/phpstan/phpstan-src/pull/2988)) - Fix ReflectionSourceStubber compatibility before PHP 8.1 (https://github.com/ondrejmirtes/BetterReflection/commit/94ca1336c58332604a74012d20286a240db376ea), https://github.com/larastan/larastan/pull/1882 - Fix trait method visibility (https://github.com/ondrejmirtes/BetterReflection/commit/d6153d513eb9111f01740394c61ff72142030089?w=1) # Function signature fixes 🤖 - Add benevolent union return types ([#&#8203;2986](https://github.com/phpstan/phpstan-src/pull/2986)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Internals 🔍 - Add more tests for issue [#&#8203;10622](https://github.com/phpstan/phpstan/issues/10622) ([#&#8203;2961](https://github.com/phpstan/phpstan-src/pull/2961)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Remove unnecessary method calls in ClassReflection ([#&#8203;2984](https://github.com/phpstan/phpstan-src/pull/2984)), thanks [@&#8203;staabm](https://github.com/staabm)! - Use `TrinaryLogic::describe()` in test (https://github.com/phpstan/phpstan-src/commit/222a66cdbf67f2ae367b251ed56acda53a3d8286) ### [`v1.10.64`](https://github.com/phpstan/phpstan/releases/tag/1.10.64) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.63...1.10.64) # Bleeding edge 🔪 - Fail build when project config uses custom extensions outside of analysed paths - This will only occur after a run that uses already present and valid result cache *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Introduce `ForbiddenClassNameExtension` for append additional forbidden class prefixes ([#&#8203;2979](https://github.com/phpstan/phpstan-src/pull/2979)), thanks [@&#8203;kamil-zacek](https://github.com/kamil-zacek)! - Add `AlwaysUsedMethodExtension` ([#&#8203;2927](https://github.com/phpstan/phpstan-src/pull/2927)), thanks [@&#8203;axlon](https://github.com/axlon)! - Warn about possibly stale result cache with custom extensions (https://github.com/phpstan/phpstan-src/commit/9338fdfe1611f742c65c61e5035315e1d64c4972) - This is how it looks: https://twitter.com/OndrejMirtes/status/1770024563113390437 # Bugfixes 🐛 - Fix deprecated parameter order ([#&#8203;2971](https://github.com/phpstan/phpstan-src/pull/2971)), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! # Function signature fixes 🤖 - Fix `DOMDocument::load` return type ([#&#8203;2975](https://github.com/phpstan/phpstan-src/pull/2975)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix `SplObjectStorage::removeAll/Except` ([#&#8203;2892](https://github.com/phpstan/phpstan-src/pull/2892)), thanks [@&#8203;schlndh](https://github.com/schlndh)! ### [`v1.10.63`](https://github.com/phpstan/phpstan/releases/tag/1.10.63) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.62...1.10.63) # Improvements 🔧 - Resolve PHPStan issue with deprecated parameter order in PHP 8.1 and 8.3 ([#&#8203;2963](https://github.com/phpstan/phpstan-src/pull/2963)), thanks [@&#8203;sayuprc](https://github.com/sayuprc)! - Update nikic/php-parser (https://github.com/phpstan/phpstan-src/commit/7ceeb2195031ca71e71f9f70b2570c8a73201048, https://github.com/phpstan/phpstan-src/commit/063f6a866c52cd054d37c5decbbbbc2743ae5f55) - Solve duplicates in UnionType description ([#&#8203;2973](https://github.com/phpstan/phpstan-src/pull/2973)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Bugfixes 🐛 - Revert "Update nette/di" (https://github.com/phpstan/phpstan-src/commit/969ff31ab29cd424aab2b2e32344a1825093bdea), [#&#8203;10727](https://github.com/phpstan/phpstan/issues/10727) - Fix password_hash algo constant passing on PHP <7.4 (https://github.com/phpstan/phpstan-src/commit/fc4e5891f786d0db1f509a11516eca58adb1eb67), [#&#8203;9246](https://github.com/phpstan/phpstan/issues/9246) - ArrayType - use `getIterableKeyType()`, it preserves array-key (https://github.com/phpstan/phpstan-src/commit/d5bf23b18f0c7484771c0298a6cd5359345eab94), [#&#8203;9307](https://github.com/phpstan/phpstan/issues/9307) # Function signature fixes 🤖 - Add false return type to `exec()` ([#&#8203;2974](https://github.com/phpstan/phpstan-src/pull/2974)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Cleanup `AnalyserIntegrationTest->runAnalyse()` ([#&#8203;2960](https://github.com/phpstan/phpstan-src/pull/2960)), thanks [@&#8203;staabm](https://github.com/staabm)! - `ReflectionProvider::hasClass()` narrows `$className` arg ([#&#8203;2976](https://github.com/phpstan/phpstan-src/pull/2976)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.62`](https://github.com/phpstan/phpstan/releases/tag/1.10.62) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.61...1.10.62) # Improvements 🔧 - Too wide return type - report for conditional return types (https://github.com/phpstan/phpstan-src/commit/de1c07ea68c36854b46c43ee575145ad4ae2386a) # Bugfixes 🐛 - Constants deprecation depends on PHP version in comment ([#&#8203;2967](https://github.com/phpstan/phpstan-src/pull/2967)), [#&#8203;10700](https://github.com/phpstan/phpstan/issues/10700), thanks [@&#8203;staabm](https://github.com/staabm)! - Make `@param-out` work even if it is the only conditional type in a function signature (https://github.com/phpstan/phpstan-src/commit/787c1e2b46a40ccac9bb254fd45204a310f6ff2f) - ParameterOutAssignedTypeRule - fix for conditional types (https://github.com/phpstan/phpstan-src/commit/19497ba0317be7e37f2c969118c93ce3be1e6fd2) - ParameterOutExecutionEndTypeRule - fix for conditional types (https://github.com/phpstan/phpstan-src/commit/27c73f7f67ba74688d4ed0b3b0f5c0c3a9c60012) - Too wide `@param-out` - fix for conditional types (https://github.com/phpstan/phpstan-src/commit/5a4789339e5768628bf9bb2abdf38eff135553cd) ### [`v1.10.61`](https://github.com/phpstan/phpstan/releases/tag/1.10.61) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.60...1.10.61) # Improvements 🔧 - Update BetterReflection to 6.25.0 - Implement PHP Version dependent deprecations for constants (https://github.com/Roave/BetterReflection/pull/1396), thanks [@&#8203;staabm](https://github.com/staabm)! - Support for `final` modifier in traits (https://github.com/Roave/BetterReflection/pull/1383), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Support for conditional types in `@param-out` (https://github.com/phpstan/phpstan-src/commit/effad95da555c2b6c7b305178a221e84c831df61), [#&#8203;10699](https://github.com/phpstan/phpstan/issues/10699) - Check conditional types in `@param-out` (https://github.com/phpstan/phpstan-src/commit/67f9420cba9fa45501cdca87770d50c5c22bd508) # Bugfixes 🐛 - Too wide `@param-out` type - consider all execution ends at once (https://github.com/phpstan/phpstan-src/commit/d1bcf786eedbce9fee74f43f080678fa7788e4e3), [#&#8203;10687](https://github.com/phpstan/phpstan/issues/10687), [#&#8203;10684](https://github.com/phpstan/phpstan/issues/10684) # Internals 🔍 - MethodReturnStatementsNode - use ExtendedMethodReflection (https://github.com/phpstan/phpstan-src/commit/3cc1a545641b172b2cb1e89030cde9baa6b0c527) ### [`v1.10.60`](https://github.com/phpstan/phpstan/releases/tag/1.10.60) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.59...1.10.60) [**Learn more about this release**](https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference) in an article on phpstan.org! # Major new features 🚀 - Generic `@method` tags: `@method T doFoo<T>(T $p)`, [#&#8203;6371](https://github.com/phpstan/phpstan/issues/6371) - [Learn more](https://twitter.com/OndrejMirtes/status/1760994823073370509) - [#&#8203;2931](https://github.com/phpstan/phpstan-src/pull/2931), [#&#8203;2935](https://github.com/phpstan/phpstan-src/pull/2935), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Generic callable types: `callable<T>(T): T`, [#&#8203;8964](https://github.com/phpstan/phpstan/issues/8964) - [#&#8203;2938](https://github.com/phpstan/phpstan-src/pull/2938), [#&#8203;2945](https://github.com/phpstan/phpstan-src/pull/2945), [#&#8203;2946](https://github.com/phpstan/phpstan-src/pull/2946), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Error on references of prefixed internal class names from PHAR files ([#&#8203;2932](https://github.com/phpstan/phpstan-src/pull/2932)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bleeding edge 🔪 - **Enhancements in Handling Parameters Passed by Reference** - [Learn more on phpstan.org](https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference) - [#&#8203;2941](https://github.com/phpstan/phpstan-src/pull/2941), thanks [@&#8203;ljmaskey](https://github.com/ljmaskey)! - Add option `reportAnyTypeWideningInVarTag` ([#&#8203;2840](https://github.com/phpstan/phpstan-src/pull/2840)), thanks [@&#8203;janedbal](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Add support for constructor assertions ([#&#8203;2950](https://github.com/phpstan/phpstan-src/pull/2950)), [#&#8203;10645](https://github.com/phpstan/phpstan/issues/10645), thanks [@&#8203;axlon](https://github.com/axlon)! - Report uses of deprecated constants ([#&#8203;2953](https://github.com/phpstan/phpstan-src/pull/2953)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix how union of callables is understood ([#&#8203;2902](https://github.com/phpstan/phpstan-src/pull/2902)), [#&#8203;10442](https://github.com/phpstan/phpstan/issues/10442), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Fix for inferring closure parameter type from callable union (https://github.com/phpstan/phpstan-src/commit/c10476d268bedc5e7bc66b44d160a453edb1cacb) - ArrayType - string offset might exist as integer offset ([#&#8203;2928](https://github.com/phpstan/phpstan-src/pull/2928)), [#&#8203;10610](https://github.com/phpstan/phpstan/issues/10610), thanks [@&#8203;michalbundyra](https://github.com/michalbundyra)! - Truncate description of huge UnionType (https://github.com/phpstan/phpstan-src/commit/039a3dc135bf9f23971437ebd4718291a1404d2d), [#&#8203;10614](https://github.com/phpstan/phpstan/issues/10614) - fix type of `$a?->b::c()` and `$a?->b::$c` ([#&#8203;2933](https://github.com/phpstan/phpstan-src/pull/2933)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - fix `fn() => __FUNCTION__` and `__METHOD__` ([#&#8203;2934](https://github.com/phpstan/phpstan-src/pull/2934)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Some sort functions do not preserve a list (https://github.com/phpstan/phpstan-src/commit/034f7313064b207883a13f1e25a76975560215b9, https://github.com/phpstan/phpstan-src/commit/0977a7b0259cbe4055c6fb0200708b2ec137d770), [#&#8203;10627](https://github.com/phpstan/phpstan/issues/10627) - ArgumentsNormalizer - keep named arguments for unknown parameters (https://github.com/phpstan/phpstan-src/commit/ad34452cb12cdebd19c80a3f34ef2819c2e37bbb), [#&#8203;10628](https://github.com/phpstan/phpstan/issues/10628) - Check `T of mixed&Foo` and `T of mixed|Foo` ([#&#8203;2940](https://github.com/phpstan/phpstan-src/pull/2940)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Use narrowed conditional type if/else types for subtype checks ([#&#8203;2948](https://github.com/phpstan/phpstan-src/pull/2948)), [#&#8203;10622](https://github.com/phpstan/phpstan/issues/10622), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix `isSuperTypeOf` of callable/Closure when parameter count differ ([#&#8203;2949](https://github.com/phpstan/phpstan-src/pull/2949)), [#&#8203;10594](https://github.com/phpstan/phpstan/issues/10594), thanks [@&#8203;takaram](https://github.com/takaram)! # Function signature fixes 🤖 - Fix `ReflectionFunctionAbstract::getExtension` return type (https://github.com/phpstan/phpstan-src/commit/2ece1f82b0e95541908f052d74a1cb29f2a4b4b7) - Correct return type of `date_sun_info()` function ([#&#8203;2947](https://github.com/phpstan/phpstan-src/pull/2947)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Fix return values of `mysqli get_warnings` ([#&#8203;2929](https://github.com/phpstan/phpstan-src/pull/2929)), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Internals 🔍 - Replace composer-require-checker with composer-dependency-analyser ([#&#8203;2875](https://github.com/phpstan/phpstan-src/pull/2875)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Use `Type::isNull()` in `Nullsafe(MethodCall|PropertyFetch)Rule` ([#&#8203;2942](https://github.com/phpstan/phpstan-src/pull/2942)), thanks [@&#8203;takaram](https://github.com/takaram)! ### [`v1.10.59`](https://github.com/phpstan/phpstan/releases/tag/1.10.59) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.58...1.10.59) # Bleeding edge 🔪 - `array_values` rule (report when a `list` type is always passed in) ([#&#8203;2917](https://github.com/phpstan/phpstan-src/pull/2917)), thanks [@&#8203;kamil-zacek](https://github.com/kamil-zacek)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - ArrayFilterRule - tip message about `treatPhpDocTypesAsCertain` (https://github.com/phpstan/phpstan-src/commit/f5b198c9801282d7002f5310d5ff5318eec54465) - ArgumentsNormalizer - skip unused arguments in non-variadic signatures, still return a normalized call (https://github.com/phpstan/phpstan-src/commit/17e5bac093c3695a449cf54a2193e74677c0223f) - Methods in fluent interfaces are considered impure (https://github.com/phpstan/phpstan-src/commit/b0261263e2e3a3643a9a89eb0931c07d8e71dc18) - Add type-specifying extension for `settype()` ([#&#8203;2920](https://github.com/phpstan/phpstan-src/pull/2920)), thanks [@&#8203;ChrisBrenton](https://github.com/ChrisBrenton)! # Bugfixes 🐛 - MethodAssertRule - do not report implicitly inherited assert tags (https://github.com/phpstan/phpstan-src/commit/299df5130a14d5a23073edb044b46209ee7b5426), [#&#8203;10573](https://github.com/phpstan/phpstan/issues/10573) - Gets rid of the annoying error "Asserted type ... with type ... does not narrow down the type." - ConstantArrayType - string offset might exist as integer offset (https://github.com/phpstan/phpstan-src/commit/2fb66328fdd7119922ce4579f8951ee776320ef6), [#&#8203;10577](https://github.com/phpstan/phpstan/issues/10577) # Internals 🔍 - Parallelize levels tests ([#&#8203;2916](https://github.com/phpstan/phpstan-src/pull/2916)), thanks [@&#8203;staabm](https://github.com/staabm)! - `FunctionReflection::isPure()` and `ExtendedMethodReflection::isPure()` (https://github.com/phpstan/phpstan-src/commit/03d01eae4a59592f7388bc46b14e5db8eff57df8) ### [`v1.10.58`](https://github.com/phpstan/phpstan/releases/tag/1.10.58) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.57...1.10.58) # Improvements 🔧 - Verify property type after `unset` (https://github.com/phpstan/phpstan-src/commit/aeadbe28e0b0a05a3a48723ac310cf6c0d852711), [#&#8203;10506](https://github.com/phpstan/phpstan/issues/10506), [#&#8203;6773](https://github.com/phpstan/phpstan/issues/6773) # Bugfixes 🐛 - InvalidThrowsPhpDocValueRule: support `@phpstan-require-extends` ([#&#8203;2890](https://github.com/phpstan/phpstan-src/pull/2890)), [#&#8203;10475](https://github.com/phpstan/phpstan/issues/10475), thanks [@&#8203;RobertMe](https://github.com/RobertMe)! - `sort()`, `rsort()` and `usort()` convert an array to list ([#&#8203;2891](https://github.com/phpstan/phpstan-src/pull/2891)), [#&#8203;6467](https://github.com/phpstan/phpstan/issues/6467), [#&#8203;10423](https://github.com/phpstan/phpstan/issues/10423), [#&#8203;3312](https://github.com/phpstan/phpstan/issues/3312), thanks [@&#8203;takaram](https://github.com/takaram)! - Fix stale result cache with imported type aliases ([#&#8203;2894](https://github.com/phpstan/phpstan-src/pull/2894)), [#&#8203;10449](https://github.com/phpstan/phpstan/issues/10449), thanks [@&#8203;staabm](https://github.com/staabm)! - Avoid internal error with `T<X>` where `T` bound consist of intersection type (https://github.com/phpstan/phpstan-src/commit/778b56999967ed2fb6630462fe26fdb1e022bba7), [#&#8203;10509](https://github.com/phpstan/phpstan/issues/10509) - Recognize `[1 => 'method', 0 => $obj]` as callable ([#&#8203;2896](https://github.com/phpstan/phpstan-src/pull/2896)), [#&#8203;10502](https://github.com/phpstan/phpstan/issues/10502), thanks [@&#8203;staabm](https://github.com/staabm)! - SprintfFunctionDynamicReturnTypeExtension - limit combinatorial explosion (https://github.com/phpstan/phpstan-src/commit/51cffd49dcf08e17f201f3fb70c29a589d94a234), [#&#8203;10538](https://github.com/phpstan/phpstan/issues/10538) - Fix implicit `@phpstan-assert` PHPDoc inheritance with generics ([#&#8203;2909](https://github.com/phpstan/phpstan-src/pull/2909)), [#&#8203;10037](https://github.com/phpstan/phpstan/issues/10037), [#&#8203;9123](https://github.com/phpstan/phpstan/issues/9123), thanks [@&#8203;RobertMe](https://github.com/RobertMe)! # Internals 🔍 - Prevent unnecessary `isSuperTypeOf()` calls ([#&#8203;2895](https://github.com/phpstan/phpstan-src/pull/2895)), thanks [@&#8203;staabm](https://github.com/staabm)! - Simplify `ClassPropertiesNode->getUninitializedProperties()` ([#&#8203;2899](https://github.com/phpstan/phpstan-src/pull/2899)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.57`](https://github.com/phpstan/phpstan/releases/tag/1.10.57) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.56...1.10.57) # Bleeding edge 🔪 - Fix checking generic `mixed` type based on config ([#&#8203;2885](https://github.com/phpstan/phpstan-src/pull/2885)), thanks [@&#8203;schlndh](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Update `ClassReflection::getConstant()` return type (https://github.com/phpstan/phpstan-src/commit/8d4ea60a5710bff1b95c918c2a3ee948fc35bae7) - Cover `ClassConstantReflection` with BC promise (https://github.com/phpstan/phpstan-src/commit/8f82b799c5e65424d85a79ffdc60b3ea14d95731) # Bugfixes 🐛 - Preserve TemplateTypeArray when merging array types (https://github.com/phpstan/phpstan-src/commit/8342785e39da26631f5f2d972de1fe39f3aeafeb), [#&#8203;10445](https://github.com/phpstan/phpstan/issues/10445) - Fix `array_filter` callback return type (https://github.com/phpstan/phpstan-src/commit/59ae706f1333da5de88224a04bfec71a1a8d6acd) - Fix undefined XMLReader properties with local phpstorm-stubs patch (https://github.com/phpstan/phpstan-src/commit/2d364d781c551002ed2a648447b04401744b4b6f), [#&#8203;8629](https://github.com/phpstan/phpstan/issues/8629) - Fix spaceship operator for large constant unions ([#&#8203;2886](https://github.com/phpstan/phpstan-src/pull/2886)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - MissingClassConstantTypehintRule should not apply to native types (https://github.com/phpstan/phpstan-src/commit/6363932c56678f5d49a960f65b09fb2c11cd7dd3) - Do not generalize class-level `@template` type in method call (https://github.com/phpstan/phpstan-src/commit/11268e5eebb2b147007fdc4902d91a3418175594), [#&#8203;10473](https://github.com/phpstan/phpstan/issues/10473) # Function signature fixes 🤖 - `curl_multi_init()` cannot return false ([#&#8203;2882](https://github.com/phpstan/phpstan-src/pull/2882)), thanks [@&#8203;staabm](https://github.com/staabm)! - `error_log()` is impure ([#&#8203;2884](https://github.com/phpstan/phpstan-src/pull/2884)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.56`](https://github.com/phpstan/phpstan/releases/tag/1.10.56) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.55...1.10.56) # Major new feature 🚀 - New PHPDoc tags: `@phpstan-require-extends`, `@phpstan-require-implements`, [#&#8203;10302](https://github.com/phpstan/phpstan/issues/10302), [#&#8203;9899](https://github.com/phpstan/phpstan/issues/9899), [#&#8203;8550](https://github.com/phpstan/phpstan/issues/8550), thanks [@&#8203;staabm](https://github.com/staabm)! - Learn more: [Making `@property` PHPDoc above interfaces work on PHP 8.2+](https://phpstan.org/blog/solving-phpstan-access-to-undefined-property#making-%40property-phpdoc-above-interfaces-work-on-php-8.2%2B) - [Enforcing class inheritance for interfaces and traits](https://phpstan.org/writing-php-code/phpdocs-basics#enforcing-class-inheritance-for-interfaces-and-traits) - [Enforcing implementing an interface for traits](https://phpstan.org/writing-php-code/phpdocs-basics#enforcing-implementing-an-interface-for-traits) - Development of this feature was kindly sponsored by [Pixel & Tonic](https://pixelandtonic.com/), the team behind [Craft CMS](https://craftcms.com/) # Improvements 🔧 - Scope - function call stack includes parameters too (https://github.com/phpstan/phpstan-src/commit/b87e5c4c7e33a91c61341f0335a221c32df603b2), https://github.com/phpstan/phpstan-deprecation-rules/issues/107 # Bugfixes 🐛 - Process `match` arm condition before analysing the body (https://github.com/phpstan/phpstan-src/commit/2b74aa85b87e85bbc2398b96b1bff07234b1f791), [#&#8203;10418](https://github.com/phpstan/phpstan/issues/10418) # Function signature fixes 🤖 - Fix transliterator function maps ([#&#8203;2862](https://github.com/phpstan/phpstan-src/pull/2862)), thanks [@&#8203;PrinsFrank](https://github.com/PrinsFrank)! - Fix duplicate array key `Yaf_Response_Http::__clone` ([#&#8203;2863](https://github.com/phpstan/phpstan-src/pull/2863)), thanks [@&#8203;PrinsFrank](https://github.com/PrinsFrank)! - Add array shape for `transliterator::listIDs` return type ([#&#8203;2865](https://github.com/phpstan/phpstan-src/pull/2865)), thanks [@&#8203;PrinsFrank](https://github.com/PrinsFrank)! - `strtok()` always returns a `non-empty-string` when it does not return false ([#&#8203;2869](https://github.com/phpstan/phpstan-src/pull/2869)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Prevent repetative calls to `Type::getConstantArrays()` ([#&#8203;2864](https://github.com/phpstan/phpstan-src/pull/2864)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove redundant condition in ParametersAcceptorSelector ([#&#8203;2867](https://github.com/phpstan/phpstan-src/pull/2867)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Simplify default return path in extensions ([#&#8203;2868](https://github.com/phpstan/phpstan-src/pull/2868)), thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce unnecessary calls to `Scope::getFunctionType()` ([#&#8203;2872](https://github.com/phpstan/phpstan-src/pull/2872)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.55`](https://github.com/phpstan/phpstan/releases/tag/1.10.55) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.54...1.10.55) # Improvements 🔧 - PHPDoc tag `@phpstan-ignore-next-line` works for first line below the PHPDoc even in bleeding edge (https://github.com/phpstan/phpstan-src/commit/8b6260c21bacbfd653d26b9a8abef7996fd3fe46), [#&#8203;10383](https://github.com/phpstan/phpstan/issues/10383), https://github.com/phpstan/phpstan/discussions/10374 - Add `open-resource` type (https://github.com/phpstan/phpstan-src/commit/bbd9a68478abbc500b6398968cc85d0d1ae8d3eb), [#&#8203;10399](https://github.com/phpstan/phpstan/issues/10399) - Optimize repeated container creation in tests ([#&#8203;2860](https://github.com/phpstan/phpstan-src/pull/2860)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Try to prevent error with PHP-Parser 5 when running PHPUnit tests (https://github.com/phpstan/phpstan-src/commit/9dac90dfd5fc809dd84fdac0532ecd51c6ae66bf), [#&#8203;10401](https://github.com/phpstan/phpstan/issues/10401), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Fix mixing property and param attributes on promoted property ([#&#8203;2825](https://github.com/phpstan/phpstan-src/pull/2825)), [#&#8203;10385](https://github.com/phpstan/phpstan/issues/10385) - Fix detection of shadowed trait methods (https://github.com/phpstan/phpstan-src/commit/22700511d91b748240da0ac8b697f2ab409aad21), [#&#8203;10377](https://github.com/phpstan/phpstan/issues/10377) - Fix int-range return type for range() ([#&#8203;2792](https://github.com/phpstan/phpstan-src/pull/2792)), [#&#8203;10213](https://github.com/phpstan/phpstan/issues/10213), [#&#8203;9573](https://github.com/phpstan/phpstan/issues/9573), thanks [@&#8203;dantleech](https://github.com/dantleech)! # Internals 🔍 - Remove unused DirectClassReflectionExtensionRegistryProvider ([#&#8203;2857](https://github.com/phpstan/phpstan-src/pull/2857)), thanks [@&#8203;staabm](https://github.com/staabm)! - Plumbing for `@phpstan-require-extends` and `@phpstan-require-implements` ([#&#8203;2856](https://github.com/phpstan/phpstan-src/pull/2856)), thanks [@&#8203;staabm](https://github.com/staabm)! - `Scope::getFunctionCallStack()` (https://github.com/phpstan/phpstan-src/commit/9be137675ebc41be5c9c7c230f96cab4dbf1f08e), https://github.com/phpstan/phpstan-deprecation-rules/issues/106 ### [`v1.10.54`](https://github.com/phpstan/phpstan/releases/tag/1.10.54) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.53...1.10.54) # Bleeding edge 🔪 - Revert "ParamAttributesRule - promoted property attribute needs to target both parameters and properties" (https://github.com/phpstan/phpstan-src/commit/02f66df2a2997ad39ee25c92b6a7f7102f09514f), [#&#8203;10385](https://github.com/phpstan/phpstan/issues/10385) - See PHP internals discussion: https://externals.io/message/111942#112021 *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - UsedNamesRule - level 0 ([#&#8203;2849](https://github.com/phpstan/phpstan-src/pull/2849)), thanks [@&#8203;lulco](https://github.com/lulco)! # Bugfixes 🐛 - Simplify TooWideClosureReturnTypehintRule (https://github.com/phpstan/phpstan-src/commit/a81df66485ea7c94655d70f322775e84bef871f9) - Fix falsy isset for all expressions (https://github.com/phpstan/phpstan-src/commit/af14d50e2b5d1b2cf91813059cdc827be63fdb20), [#&#8203;10373](https://github.com/phpstan/phpstan/issues/10373) ### [`v1.10.53`](https://github.com/phpstan/phpstan/releases/tag/1.10.53) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.52...1.10.53) # Improvements 🔧 - Impl `str_increment` / `str_decrement` return type extension ([#&#8203;2776](https://github.com/phpstan/phpstan-src/pull/2776)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Fix loading polyfills twice (https://github.com/phpstan/phpstan/commit/3e7c7c7c6306157e6967ef436e952aeba1097edb?w=1), [#&#8203;10387](https://github.com/phpstan/phpstan/issues/10387) - `array_udiff()` comparator return type is too strict ([#&#8203;2822](https://github.com/phpstan/phpstan-src/pull/2822)), [#&#8203;9697](https://github.com/phpstan/phpstan/issues/9697), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Simplify default return path in extensions ([#&#8203;2816](https://github.com/phpstan/phpstan-src/pull/2816)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.52`](https://github.com/phpstan/phpstan/releases/tag/1.10.52) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.51...1.10.52) # Improvements 🔧 - Do not allow to generate baseline when reflection error occurs (https://github.com/phpstan/phpstan-src/commit/78ea9a621093cde38dd382cc67557c8b211589d8) - Show internal errors that occured when generating a baseline (https://github.com/phpstan/phpstan-src/commit/c997ea9eefb8a57f5e273cff3b3338f423e755b6) # Bugfixes 🐛 - Load PHP polyfills in bootstrap.php (https://github.com/phpstan/phpstan/commit/21df2d347a49a51b3377e4b6553aa110e7072eb6), [#&#8203;10375](https://github.com/phpstan/phpstan/issues/10375) ### [`v1.10.51`](https://github.com/phpstan/phpstan/releases/tag/1.10.51) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.50...1.10.51) # Bleeding edge 🔪 - ParamAttributesRule - promoted property attribute needs to target both parameters and properties (https://github.com/phpstan/phpstan-src/commit/25d15526dbe59216f2b42aaa88a2be23bf9cbf44), [#&#8203;10298](https://github.com/phpstan/phpstan/issues/10298) - More precise `RecursiveIteratorIterator::__construct()` parameter types ([#&#8203;2835](https://github.com/phpstan/phpstan-src/pull/2835)), thanks [@&#8203;staabm](https://github.com/staabm)! - PhpDocParser: add config for lines in its AST & enable ignoring errors within PHPDocs ([#&#8203;2807](https://github.com/phpstan/phpstan-src/pull/2807)), thanks [@&#8203;janedbal](https://github.com/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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Missing ThrowExprTypeRule - level 3 (https://github.com/phpstan/phpstan-src/commit/0359ebc78fa7bc5ed1b3b4032c68363ce70ab673) - Analyse stubs only when not only files are analysed (https://github.com/phpstan/phpstan-src/commit/402024091b215dca7d91b74c415293323d2dbadc) - Nicer error message in case of memory limit exhaustion in child process (https://github.com/phpstan/phpstan-src/commit/816be99361d263df24bf1e7fa078df62fb63d1d7) # Bugfixes 🐛 - Narrow `ReflectionEnum::getBackingType()` after `ReflectionEnum::isBacked()` ([#&#8203;2830](https://github.com/phpstan/phpstan-src/pull/2830)), [#&#8203;10167](https://github.com/phpstan/phpstan/issues/10167), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix coalescing on an optional array offset ([#&#8203;2834](https://github.com/phpstan/phpstan-src/pull/2834)), [#&#8203;10317](https://github.com/phpstan/phpstan/issues/10317), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - More precise `??` type inference (https://github.com/phpstan/phpstan-src/commit/d801919e356a8cecc33b06046311aa036d2492ff), [#&#8203;10327](https://github.com/phpstan/phpstan/issues/10327) # Internals 🔍 - phpstan-src is now downgraded for PHP 7.2+ with [`ondrejmirtes/simple-downgrader`](https://github.com/ondrejmirtes/simple-downgrader) - Forward-compatible changes with PHP-Parser 5 (https://github.com/phpstan/phpstan-src/commit/436bd791bf256ca59334f2746e70a58d581d8574, https://github.com/phpstan/phpstan-src/commit/7eb66f6bd643fc95f8353b3b273c29514ddd8619, https://github.com/phpstan/phpstan-src/commit/bf0b138fbed6fb0960ca696869cc9f5f787d4261), [#&#8203;5086](https://github.com/phpstan/phpstan/issues/5086) - Use `str_starts_with()` and `str_contains()` instead of `strpos()` ([#&#8203;2841](https://github.com/phpstan/phpstan-src/pull/2841)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Building preload script - sort by name for reproducible builds (https://github.com/phpstan/phpstan-src/commit/995de26a4b8009c4e89159683c4e602290dbc508) - Lazier creation of ParameterAcceptor ([#&#8203;2843](https://github.com/phpstan/phpstan-src/pull/2843)), thanks [@&#8203;staabm](https://github.com/staabm)! - Use const instead of properties ([#&#8203;2815](https://github.com/phpstan/phpstan-src/pull/2815)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - PhpDocValueRule: cheapest check first ([#&#8203;2824](https://github.com/phpstan/phpstan-src/pull/2824)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster `ParametersAcceptorSelector::combine()` ([#&#8203;2851](https://github.com/phpstan/phpstan-src/pull/2851)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.50`](https://github.com/phpstan/phpstan/releases/tag/1.10.50) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.49...1.10.50) # Improvements 🔧 - Update `nikic/php-parser` to 4.18.0 (https://github.com/phpstan/phpstan-src/commit/24f92cc2a69cbeecefb8e2093c6db41138cc9398) # Bugfixes 🐛 - `VoidType` - accept `null` (https://github.com/phpstan/phpstan-src/commit/40c8fb2266f040158fb811ac13b21a3e179c022a), [#&#8203;10291](https://github.com/phpstan/phpstan/issues/10291) # Internals 🔍 - `InvalidPromotedPropertiesRule` - use `FunctionLike` as node type ([#&#8203;2823](https://github.com/phpstan/phpstan-src/pull/2823)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Deduplicate inferred template type generalization logic (https://github.com/phpstan/phpstan-src/commit/39fe102d23c8aec32b8c21225152e2d835d224b2) ### [`v1.10.49`](https://github.com/phpstan/phpstan/releases/tag/1.10.49) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.48...1.10.49) # Bleeding edge 🔪 - Do not generalize template types, except when in `GenericObjectType` ([#&#8203;2818](https://github.com/phpstan/phpstan-src/pull/2818), [#&#8203;2821](https://github.com/phpstan/phpstan-src/pull/2821)) - This fixes following **17 issues**: [#&#8203;8166](https://github.com/phpstan/phpstan/issues/8166), [#&#8203;8127](https://github.com/phpstan/phpstan/issues/8127), [#&#8203;7944](https://github.com/phpstan/phpstan/issues/7944), [#&#8203;7283](https://github.com/phpstan/phpstan/issues/7283), [#&#8203;6653](https://github.com/phpstan/phpstan/issues/6653), [#&#8203;6196](https://github.com/phpstan/phpstan/issues/6196), [#&#8203;9084](https://github.com/phpstan/phpstan/issues/9084), [#&#8203;8683](https://github.com/phpstan/phpstan/issues/8683), [#&#8203;8074](https://github.com/phpstan/phpstan/issues/8074), [#&#8203;7984](https://github.com/phpstan/phpstan/issues/7984), [#&#8203;7301](https://github.com/phpstan/phpstan/issues/7301), [#&#8203;7087](https://github.com/phpstan/phpstan/issues/7087), [#&#8203;5594](https://github.com/phpstan/phpstan/issues/5594), [#&#8203;5592](https://github.com/phpstan/phpstan/issues/5592), [#&#8203;9472](https://github.com/phpstan/phpstan/issues/9472), [#&#8203;9764](https://github.com/phpstan/phpstan/issues/9764), [#&#8203;10092](https://github.com/phpstan/phpstan/issues/10092) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Transform `void` return to `null` after call ([#&#8203;2778](https://github.com/phpstan/phpstan-src/pull/2778)), [#&#8203;6720](https://github.com/phpstan/phpstan/issues/6720), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Fix `count(list)` regression ([#&#8203;2813](https://github.com/phpstan/phpstan-src/pull/2813)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make AcceptsResult reasons unique (https://github.com/phpstan/phpstan-src/commit/01aabcff33c9f8cb0f6a04469a75cb3c47a014a2) # Function signature fixes 🤖 - Make `SimpleXMLElement` method return types benevolent (when they return `static|null`) (https://github.com/phpstan/phpstan-src/commit/fb76c9f7d324c854bd2da8bd542b2de6337410e4) ### [`v1.10.48`](https://github.com/phpstan/phpstan/releases/tag/1.10.48) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.47...1.10.48) # Bleeding edge 🔪 - TooWideMethodReturnTypehintRule - always report for final methods (https://github.com/phpstan/phpstan-src/commit/c30e9a484c8245b8126cd63444607ca74d2af761) - LogicalXorConstantConditionRule (https://github.com/phpstan/phpstan-src/commit/3a12724fd636b1bcf36c22b36e8f765d97150895, https://github.com/phpstan/phpstan-src/commit/3b011f6524254dad0f16840fdcfdbe7421548617), [#&#8203;7539](https://github.com/phpstan/phpstan/issues/7539) - NoopRule - report top-level `xor` because that's probably not what the user intended to do (https://github.com/phpstan/phpstan-src/commit/a1fffb3346e09f1e8e8d987d4282263295a55142), [#&#8203;10267](https://github.com/phpstan/phpstan/issues/10267) - Report unused results of `and` and `or` (https://github.com/phpstan/phpstan-src/commit/1d8fff637d70a9e9ed3f11dee5d61b9f796cbf1a) - Report unused result of ternary (https://github.com/phpstan/phpstan-src/commit/9664f7a9d2223c07e750f0dfc949c3accfa6b65e) - Report unused results of `&&` and `||` (https://github.com/phpstan/phpstan-src/commit/cf2c8bbd9ebd2ebe300dbd310e136ad603d7def3) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Narrow `ReflectionEnum::getName()` after `ReflectionEnum::isBacked()` ([#&#8203;2806](https://github.com/phpstan/phpstan-src/pull/2806)), [#&#8203;10192](https://github.com/phpstan/phpstan/issues/10192), thanks [@&#8203;franmomu](https://github.com/franmomu)! - Any variable can exist after include/require (https://github.com/phpstan/phpstan-src/commit/0a3a968b86773a54e102baee4f63d39a556c97fc), https://github.com/phpstan/phpstan/discussions/10252 # Bugfixes 🐛 - ResolvedPhpDocBlock: fix parent return tag merging ([#&#8203;2803](https://github.com/phpstan/phpstan-src/pull/2803)), [#&#8203;6462](https://github.com/phpstan/phpstan/issues/6462), [#&#8203;10208](https://github.com/phpstan/phpstan/issues/10208), [#&#8203;3580](https://github.com/phpstan/phpstan/issues/3580), [#&#8203;4396](https://github.com/phpstan/phpstan/issues/4396), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Merge in-foreach scope even for non-iterable expr (https://github.com/phpstan/phpstan-src/commit/942afbf060419bae5977651bff3102b63ea42206) - TooWideMethodReturnTypehintRule - never report in a trait (https://github.com/phpstan/phpstan-src/commit/e0eb85028d55ebab32be614631639c142b37daa6) - Narrowing list type with `count()` results in type loss ([#&#8203;2811](https://github.com/phpstan/phpstan-src/pull/2811)), [#&#8203;10264](https://github.com/phpstan/phpstan/issues/10264), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix LevelsTestCase for PHPUnit 10 (https://github.com/phpstan/phpstan-src/commit/fa5d5f958b051b088fb0824d377a091273d6436c) # Function signature fixes 🤖 - Update return type information for `SimpleXMLElement::addChild` ([#&#8203;2808](https://github.com/phpstan/phpstan-src/pull/2808)), [#&#8203;10269](https://github.com/phpstan/phpstan/issues/10269), thanks [@&#8203;DaveLiddament](https://github.com/DaveLiddament)! ### [`v1.10.47`](https://github.com/phpstan/phpstan/releases/tag/1.10.47) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.46...1.10.47) # Improvements 🔧 - `ExpressionTypeResolverExtension` ([#&#8203;2789](https://github.com/phpstan/phpstan-src/pull/2789)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - See: [`ExpressionTypeResolverExtension` in API Reference](https://apiref.phpstan.org/1.11.x/PHPStan.Type.ExpressionTypeResolverExtension.html) - This can be used to override inferred types by Scope if existing extension points like DynamicMethodReturnTypeExtension are not sufficient # Bugfixes 🐛 - `array_filter` - handle error types ([#&#8203;2794](https://github.com/phpstan/phpstan-src/pull/2794)), [#&#8203;10189](https://github.com/phpstan/phpstan/issues/10189), thanks [@&#8203;mglaman](https://github.com/mglaman)! - Fix variable certainty after `if ($var ?? null)` (https://github.com/phpstan/phpstan-src/commit/c2ba3415a8876310289ea0c4aa2976f20b5912f3), [#&#8203;10224](https://github.com/phpstan/phpstan/issues/10224) - Fix trait PHPDocs when checking overriden methods (https://github.com/phpstan/phpstan-src/commit/4c4f22f131561795c5f2c6e7627fff2a9aa64b92), [#&#8203;10184](https://github.com/phpstan/phpstan/issues/10184) # Function signature fixes 🤖 - Fix parameter type for `Redis::hMset` ([#&#8203;2793](https://github.com/phpstan/phpstan-src/pull/2793)), thanks [@&#8203;Vaalyn](https://github.com/Vaalyn)! ### [`v1.10.46`](https://github.com/phpstan/phpstan/releases/tag/1.10.46) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.45...1.10.46) # Improvements 🔧 - Improved `isset()` and ternary operator handling ([#&#8203;2710](https://github.com/phpstan/phpstan-src/pull/2710)), [#&#8203;3632](https://github.com/phpstan/phpstan/issues/3632), [#&#8203;8190](https://github.com/phpstan/phpstan/issues/8190), [#&#8203;8366](https://github.com/phpstan/phpstan/issues/8366), [#&#8203;8659](https://github.com/phpstan/phpstan/issues/8659), [#&#8203;9580](https://github.com/phpstan/phpstan/issues/9580), [#&#8203;10064](https://github.com/phpstan/phpstan/issues/10064), [#&#8203;10088](https://github.com/phpstan/phpstan/issues/10088), thanks [@&#8203;staabm](https://github.com/staabm)! - Optimize enums with many cases (https://github.com/phpstan/phpstan-src/commit/b17d5290766ca3a4d413dbfe9e020c9fef4700c3) # Bugfixes 🐛 - Fix namespace of named type in class constant native type by patching PHP-Parser (https://github.com/phpstan/phpstan-src/commit/8234dc0b34c0748f6caa3be4130411562fb03f2c), [#&#8203;10212](https://github.com/phpstan/phpstan/issues/10212) - Do not create conditional expression for the same variable (https://github.com/phpstan/phpstan-src/commit/aec04068119f765ed7181ea737c20cea6916591d) - It's okay to have always-throwing expression in arrow function (https://github.com/phpstan/phpstan-src/commit/758e5f118ac5781d597707666104511258fcaf67), [#&#8203;7890](https://github.com/phpstan/phpstan/issues/7890) # Internals 🔍 - Use dedicated Type methods over `isSuperTypeOf()` ([#&#8203;2788](https://github.com/phpstan/phpstan-src/pull/2788)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.45`](https://github.com/phpstan/phpstan/releases/tag/1.10.45) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.44...1.10.45) # Improvements 🔧 - Introduce InvalidTypesInUnionRule ([#&#8203;2763](https://github.com/phpstan/phpstan-src/pull/2763)), [#&#8203;9185](https://github.com/phpstan/phpstan/issues/9185), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Implement DeclareStrictTypesRule ([#&#8203;2766](https://github.com/phpstan/phpstan-src/pull/2759)), [#&#8203;6195](https://github.com/phpstan/phpstan/issues/6195), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow `enum_exists()` arg to UnitEnum ([#&#8203;2764](https://github.com/phpstan/phpstan-src/pull/2764)), [#&#8203;10169](https://github.com/phpstan/phpstan/issues/10169), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Use dedicated Type methods over `isSuperTypeOf()` ([#&#8203;2772](https://github.com/phpstan/phpstan-src/pull/2772), [#&#8203;2787](https://github.com/phpstan/phpstan-src/pull/2787)), [#&#8203;9778](https://github.com/phpstan/phpstan/issues/9778), [#&#8203;9723](https://github.com/phpstan/phpstan/issues/9723), [#&#8203;6407](https://github.com/phpstan/phpstan/issues/6407), thanks [@&#8203;staabm](https://github.com/staabm)! - Optimize match expression with many conditions (https://github.com/phpstan/phpstan-src/commit/c238fe77f7041dd486c9c0f5ee582fee75bdbadd) - `in_array` - simulate Identical/Equal handling from TypeSpecifier for literal arrays (https://github.com/phpstan/phpstan-src/commit/0177e332f27c7cf7d710c1a535ddcdfd019e9b89), [#&#8203;10201](https://github.com/phpstan/phpstan/issues/10201) # Function signature fixes 🤖 - Fix optional 4th parameter for `Redis::restore` ([#&#8203;2765](https://github.com/phpstan/phpstan-src/pull/2765)), thanks [@&#8203;Vaalyn](https://github.com/Vaalyn)! - Put `str_increment` and `str_decrement` into functionMap ([#&#8203;2777](https://github.com/phpstan/phpstan-src/pull/2777)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Update functionMap ([#&#8203;2783](https://github.com/phpstan/phpstan-src/pull/2783)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Update functionMap for `ext-mongodb` 1.17 ([#&#8203;2768](https://github.com/phpstan/phpstan-src/pull/2768)), thanks [@&#8203;alcaeus](https://github.com/alcaeus)! # Internals 🔍 - Replace with `in_array()` instead of redundant property ([#&#8203;2770](https://github.com/phpstan/phpstan-src/pull/2770)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Fix typo in rule name: `MethodVisibitiliyInInterfaceRule` ([#&#8203;2781](https://github.com/phpstan/phpstan-src/pull/2781)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make extensions that return default types simply `return null` ([#&#8203;2782](https://github.com/phpstan/phpstan-src/pull/2782)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Simplify InArrayFunctionTypeSpecifyingExtension ([#&#8203;2785](https://github.com/phpstan/phpstan-src/pull/2785)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.44`](https://github.com/phpstan/phpstan/releases/tag/1.10.44) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.43...1.10.44) # Improvements 🔧 - PHP 8.3: support for dynamic class constant fetches ([RFC](https://wiki.php.net/rfc/dynamic_class_constant_fetch)) - PHP 8.3: support for anonymous readonly class - RedefinedParametersRule ([#&#8203;2755](https://github.com/phpstan/phpstan-src/pull/2755)), [#&#8203;8025](https://github.com/phpstan/phpstan/issues/8025), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - AbstractPrivateMethodRule ([#&#8203;2756](https://github.com/phpstan/phpstan-src/pull/2756)), thanks [@&#8203;staabm](https://github.com/staabm)! - ReadOnlyClassRule (https://github.com/phpstan/phpstan-src/commit/02b2e3d0885528724a1af91a1758b8f36e2167f4) - InvalidLexicalVariablesInClosureUseRule ([#&#8203;2757](https://github.com/phpstan/phpstan-src/pull/2757)), [#&#8203;1855](https://github.com/phpstan/phpstan/issues/1855), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - AbstractProtectedMethodRule ([#&#8203;2758](https://github.com/phpstan/phpstan-src/pull/2758)), thanks [@&#8203;staabm](https://github.com/staabm)! - VarTagTypeRuleHelper: do not allow widening `list<array{id: int}>` to `mixed[]` ([#&#8203;2760](https://github.com/phpstan/phpstan-src/pull/2760)), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Bugfixes 🐛 - Re-add nullable type to interface to fix `Carbon` PHPStan extension ([#&#8203;2762](https://github.com/phpstan/phpstan-src/pull/2762)), thanks [@&#8203;CalebDW](https://github.com/CalebDW)! - Fix named arguments for few multi-variant methods ([#&#8203;2748](https://github.com/phpstan/phpstan-src/pull/2748)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix overriding `SoapClient` old-style constructor (https://github.com/phpstan/phpstan-src/commit/7765768fd54617616107f76489702d8bcac3d4d2), [#&#8203;10165](https://github.com/phpstan/phpstan/issues/10165) - Apply same fix in MethodSignatureRule from https://github.com/phpstan/phpstan-src/commit/be2b4152837ce05273c55937b8a56daa19cb4d81 (https://github.com/phpstan/phpstan-src/commit/85fcd5f35e5418ce78b7a0734facf11d079fe160), [#&#8203;10166](https://github.com/phpstan/phpstan/issues/10166) # Function signature fixes 🤖 - Remove fake params from `setcookie`/`setrawcookie` ([#&#8203;2752](https://github.com/phpstan/phpstan-src/pull/2752)), [#&#8203;10171](https://github.com/phpstan/phpstan/issues/10171), thanks [@&#8203;schlndh](https://github.com/schlndh)! ### [`v1.10.43`](https://github.com/phpstan/phpstan/releases/tag/1.10.43) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.42...1.10.43) # Improvements 🔧 - Update `phpstan/phpdoc-parser` - Fix HTML description detection for PhpStorm stubs (https://github.com/phpstan/phpdoc-parser/pull/220), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Make `ReflectionEnum` generic (https://github.com/phpstan/phpstan-src/commit/9ce8faf53c7a78c7887a2c33f9d34944605d6aae) # Bugfixes 🐛 - Merge right scope of `??=` with scope before the expression (https://github.com/phpstan/phpstan-src/commit/846f44ee6e027853352674052510bc172a1bfc89), [#&#8203;10151](https://github.com/phpstan/phpstan/issues/10151), [#&#8203;10131](https://github.com/phpstan/phpstan/issues/10131) - Fix return type of parent calls for SplHeap and other internal methods ([#&#8203;2622](https://github.com/phpstan/phpstan-src/pull/2622)), [#&#8203;7162](https://github.com/phpstan/phpstan/issues/7162), [#&#8203;9867](https://github.com/phpstan/phpstan/issues/9867), thanks [@&#8203;schlndh](https://github.com/schlndh)! - `stdClass` does not have `__get` method (https://github.com/phpstan/phpstan-src/commit/baf359ea3cfa99368eb94d80887cfd7bb0a00b85), [#&#8203;10149](https://github.com/phpstan/phpstan/issues/10149) - Fix signature check of method from trait (https://github.com/phpstan/phpstan-src/commit/be2b4152837ce05273c55937b8a56daa19cb4d81), [#&#8203;10153](https://github.com/phpstan/phpstan/issues/10153) - All `universalObjectCratesClasses` allow dynamic properties (https://github.com/phpstan/phpstan-src/commit/2ec416e11202f150b880619c5bc6416bf17b8e3e) - Fix infinite recursion with self-referencing class constant (https://github.com/phpstan/phpstan-src/commit/93af41bf52b47bbfbc533efea75f515a4caddc0e), [#&#8203;10147](https://github.com/phpstan/phpstan/issues/10147) # Internals 🔍 - Add named arguments variants to reflection golden test ([#&#8203;2743](https://github.com/phpstan/phpstan-src/pull/2743)), thanks [@&#8203;schlndh](https://github.com/schlndh)! ### [`v1.10.42`](https://github.com/phpstan/phpstan/releases/tag/1.10.42) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.41...1.10.42) This release closes **25 issues**! 🎉 # Major new features 🚀 - PHP 8.3 - support for natively typed class constants ([RFC](https://wiki.php.net/rfc/typed_class_constants)) - PHP 8.3 - support for `#[\Override]` attribute (https://github.com/phpstan/phpstan-src/commit/e9a563993f76e2504e4f6640a5a3da2e86ba8808) ([RFC](https://wiki.php.net/rfc/marking_overriden_methods)) - New configuration option: `checkMissingOverrideMethodAttribute` (https://phpstan.org/config-reference#checkmissingoverridemethodattribute) (https://github.com/phpstan/phpstan-src/commit/ac4d3de8df284308b4879a5a01168a10c18c0bea) # Bleeding edge 🔪 - Detect overriding `@final` method in OverridingMethodRule, [#&#8203;9135](https://github.com/phpstan/phpstan/issues/9135) - MethodSignatureRule - look at abstract trait method (https://github.com/phpstan/phpstan-src/commit/5fd8cee591ce1b07daa5f98a1ddcdfc723f1b5eb) - MagicConstantContextRule ([#&#8203;2741](https://github.com/phpstan/phpstan-src/pull/2741)), [#&#8203;10099](https://github.com/phpstan/phpstan/issues/10099), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Add ConstantsInTraitsRule ([#&#8203;2718](https://github.com/phpstan/phpstan-src/pull/2718)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Add NoncapturingCatchRule ([#&#8203;2721](https://github.com/phpstan/phpstan-src/pull/2721)), [#&#8203;8663](https://github.com/phpstan/phpstan/issues/8663), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Detect non-abstract methods with no body ([#&#8203;2730](https://github.com/phpstan/phpstan-src/pull/2730)), [#&#8203;4244](https://github.com/phpstan/phpstan/issues/4244), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Detect properties declared in interface ([#&#8203;2731](https://github.com/phpstan/phpstan-src/pull/2731)), [#&#8203;8915](https://github.com/phpstan/phpstan/issues/8915), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Add VariadicParametersDeclarationRule ([#&#8203;2733](https://github.com/phpstan/phpstan-src/pull/2733)), [#&#8203;3802](https://github.com/phpstan/phpstan/issues/3802), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - Add InvalidCallablePropertyTypeRule ([#&#8203;2745](https://github.com/phpstan/phpstan-src/pull/2745)), [#&#8203;4424](https://github.com/phpstan/phpstan/issues/4424), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! - ConflictingTraitConstantsRule (https://github.com/phpstan/phpstan-src/commit/f94a3c365e6bd089695376e06f9abdf81f9f24fc) - Read class constant type when generalizing the type for `dynamicConstantNames` (https://github.com/phpstan/phpstan-src/commit/cb9571b5c0b34bd0e26c9d085281842b3d829e6c) - Rework prototype searching in OverridingMethodRule (https://github.com/phpstan/phpstan-src/commit/4b2ffb82f12c98e65dd6387976cabf8bebc0dc39), [#&#8203;10101](https://github.com/phpstan/phpstan/issues/10101), [#&#8203;7541](https://github.com/phpstan/phpstan/issues/7541), [#&#8203;10043](https://github.com/phpstan/phpstan/issues/10043), [#&#8203;7859](https://github.com/phpstan/phpstan/issues/7859), [#&#8203;8081](https://github.com/phpstan/phpstan/issues/8081), [#&#8203;8500](https://github.com/phpstan/phpstan/issues/8500), [#&#8203;9014](https://github.com/phpstan/phpstan/issues/9014) - OverridingMethodRule - search for method prototype in traits (https://github.com/phpstan/phpstan-src/commit/2df14af6e13cfa2b725c325f3f39eb87476d37bd) - VarTagTypeRuleHelper: fix widening array shapes ([#&#8203;2738](https://github.com/phpstan/phpstan-src/pull/2738)), [#&#8203;10130](https://github.com/phpstan/phpstan/issues/10130), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Note about Xdebug with `--debug` (https://github.com/phpstan/phpstan-src/commit/c534f8cc79680e63a418760aa000c5bb7e3dfb0b) - FunctionSignatureMapProvider - cache data statically (https://github.com/phpstan/phpstan-src/commit/394064bb332d9bdd988895f9c63de6eb9ea538c5), [#&#8203;10039](https://github.com/phpstan/phpstan/issues/10039) # Bugfixes 🐛 - Star projection is always within template type bounds ([#&#8203;2715](https://github.com/phpstan/phpstan-src/pull/2715)), [#&#8203;10097](https://github.com/phpstan/phpstan/issues/10097), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Support `non-empty-string` in `str_shuffle()` ([#&#8203;2717](https://github.com/phpstan/phpstan-src/pull/2717)), thanks [@&#8203;staabm](https://github.com/staabm)! - Look if userland prototype has `ReturnTypeWillChange` or not (https://github.com/phpstan/phpstan-src/commit/eb0c7a1308ad6d45eca98e5f034529aca640b513), [#&#8203;9615](https://github.com/phpstan/phpstan/issues/9615) - Fix wrong tip about returning a list (https://github.com/phpstan/phpstan-src/commit/00adfaa7d1cb427262577df705264701b7de9670, https://github.com/phpstan/phpstan-src/commit/00a9d94685b297d3b1b09d7fe4398b60c3036401) - Fix parameter names for multi-variant functions ([#&#8203;2726](https://github.com/phpstan/phpstan-src/pull/2726)), [#&#8203;9018](https://github.com/phpstan/phpstan/issues/9018), [#&#8203;9399](https://github.com/phpstan/phpstan/issues/9399), [#&#8203;9923](https://github.com/phpstan/phpstan/issues/9923), [#&#8203;9823](https://github.com/phpstan/phpstan/issues/9823), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix iterator_to_array, iterator_count for PHP 8.2 ([#&#8203;2625](https://github.com/phpstan/phpstan-src/pull/2625)), [#&#8203;9793](https://github.com/phpstan/phpstan/issues/9793), [#&#8203;7760](https://github.com/phpstan/phpstan/issues/7760), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Update array_filter signature to allow null as callback ([#&#8203;2740](https://github.com/phpstan/phpstan/issues/2740)) ([#&#8203;2740](https://github.com/phpstan/phpstan-src/pull/2740)), thanks [@&#8203;andyexeter](https://github.com/andyexeter)! # Function signature fixes 🤖 - Fix return value of `mailparse_msg_get_part()` ([#&#8203;2722](https://github.com/phpstan/phpstan-src/pull/2722)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Update functionMaps ([#&#8203;2699](https://github.com/phpstan/phpstan-src/pull/2699)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Change `iptcparse` return type ([#&#8203;2727](https://github.com/phpstan/phpstan-src/pull/2727)), thanks [@&#8203;ManuelHu](https://github.com/ManuelHu)! # Internals 🔍 - Create DirectoryCreator helper class ([#&#8203;2697](https://github.com/phpstan/phpstan-src/pull/2697)), thanks [@&#8203;CalebDW](https://github.com/CalebDW)! - Use PHP 8.3 in Name Collision Detector (https://github.com/phpstan/phpstan-src/commit/8cd239e1fbaebcc5d4a57a757724e31ad4b6e36b) - Golden test for reflection ([#&#8203;2679](https://github.com/phpstan/phpstan-src/pull/2679)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fully qualify the name of the `#[\Override]` attribute in error messages ([#&#8203;10136](https://github.com/phpstan/phpstan-src/pull/10136)), thanks [@&#8203;TimWolla](https://github.com/TimWolla)! - RuleTestCase - allow null tip (https://github.com/phpstan/phpstan-src/commit/f384b43c911ee465abcc479d3efddf97ba2309f8) ### [`v1.10.41`](https://github.com/phpstan/phpstan/releases/tag/1.10.41) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.40...1.10.41) # Bugfixes 🐛 - Fix type-specifying of expression involved in nullsafe property fetch (https://github.com/phpstan/phpstan-src/commit/a849f06ff5195c95d0c03ef14dffc65986fe92a2), [#&#8203;10071](https://github.com/phpstan/phpstan/issues/10071), [#&#8203;9394](https://github.com/phpstan/phpstan/issues/9394), [#&#8203;6922](https://github.com/phpstan/phpstan/issues/6922) - Fix type-specifying for nested assign in `===` and `match` condition (https://github.com/phpstan/phpstan-src/commit/01deed63e01827746fac77921dc6436f5f4f58b5), [#&#8203;10084](https://github.com/phpstan/phpstan/issues/10084) - Improve missing iterable value type check in lists (https://github.com/phpstan/phpstan-src/commit/e705f09a6ac275e352a8c39f14f5e169c4960c41) - Update BetterReflection ([#&#8203;2713](https://github.com/phpstan/phpstan-src/pull/2713)), [#&#8203;10086](https://github.com/phpstan/phpstan/issues/10086) - Reuse same printer instance (https://github.com/ondrejmirtes/BetterReflection/commit/bab47eacdc4016f76cea6d62dcfb170c505fda95) # Function signature fixes 🤖 - Fix many phpredis signatures ([#&#8203;2706](https://github.com/phpstan/phpstan-src/pull/2706)), thanks [@&#8203;Vaalyn](https://github.com/Vaalyn)! # Internals 🔍 - `MutatingScope::debug()` - add info about conditional expressions (https://github.com/phpstan/phpstan-src/commit/80782fb84dcb3d1cff7777da10d957117aa85299) ### [`v1.10.40`](https://github.com/phpstan/phpstan/releases/tag/1.10.40) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.39...1.10.40) # Improvements 🔧 - TemplateTypeCheck tries to resolve template type names such as `self` because they're not usable (https://github.com/phpstan/phpstan-src/commit/c6fad644c7906577e0e360651a5db467a5bca750), [#&#8203;10049](https://github.com/phpstan/phpstan/issues/10049) # Bugfixes 🐛 - Fix used memory reporting ([#&#8203;2686](https://github.com/phpstan/phpstan-src/pull/2686)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix switch statement with enum in the condition ([#&#8203;2687](https://github.com/phpstan/phpstan-src/pull/2687)), [#&#8203;9806](https://github.com/phpstan/phpstan/issues/9806), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix null coalesce assignment type ([#&#8203;2702](https://github.com/phpstan/phpstan-src/pull/2702)), [#&#8203;9995](https://github.com/phpstan/phpstan/issues/9995), thanks [@&#8203;hirokinoue](https://github.com/hirokinoue)! - Fix `!==` with union of constants ([#&#8203;2700](https://github.com/phpstan/phpstan-src/pull/2700)), [#&#8203;10002](https://github.com/phpstan/phpstan/issues/10002), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Process statements inside `declare(ticks=...)` (https://github.com/phpstan/phpstan-src/commit/eb39381d2a3fd370d9881aacebabb3b17c06678a), [#&#8203;10059](https://github.com/phpstan/phpstan/issues/10059) - Fix crash when template types map and variances map are not of equal length (https://github.com/phpstan/phpstan-src/commit/1308c520e763e286809f01a4100af8ba156c1d34), [#&#8203;10049](https://github.com/phpstan/phpstan/issues/10049) # Function signature fixes 🤖 - functionMap.php fixes for YAF 3.3.5 ([#&#8203;2696](https://github.com/phpstan/phpstan-src/pull/2696)), thanks [@&#8203;mbakirov](https://github.com/mbakirov)! - Remove `\` from DateTimeZone in functionMap ([#&#8203;2693](https://github.com/phpstan/phpstan-src/pull/2693)), thanks [@&#8203;simPod](https://github.com/simPod)! - Allow `Redis::pconnect` to have 7 parameters ([#&#8203;2695](https://github.com/phpstan/phpstan-src/pull/2695)), thanks [@&#8203;Vaalyn](https://github.com/Vaalyn)! # Internals 🔍 - Micro-optimize `TypeSpecifier::resolveIdentical` ([#&#8203;2700](https://github.com/phpstan/phpstan-src/pull/2700)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Micro-optimize with `in_array()` ([#&#8203;2698](https://github.com/phpstan/phpstan-src/pull/2698)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.10.39`](https://github.com/phpstan/phpstan/releases/tag/1.10.39) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.38...1.10.39) # Improvements 🔧 - More information about thrown exception in child process (https://github.com/phpstan/phpstan-src/commit/d6a576adcdaf3c6d64ccbeb6fcbae7100cc674f4) - PHPStan Pro - allow overriding `pro.tmpDir` config parameter (https://github.com/phpstan/phpstan-src/commit/4a952068df57b09e8920de756ab2a6b8a0ffdf10, https://github.com/phpstan/phpstan-src/commit/7c4ef6b2aa246a31128b035cd07e64ff202ecc2b) - Optimize memory consumption when doing sha1 file hash ([#&#8203;2680](https://github.com/phpstan/phpstan-src/pull/2680)), thanks [@&#8203;staabm](https://github.com/staabm)! - Optimize memory consumption in ResultCacheManager ([#&#8203;2681](https://github.com/phpstan/phpstan-src/pull/2681)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Filter right side of `??=` with `=== null` (https://github.com/phpstan/phpstan-src/commit/f407ac69ba1d967b2258ff2a506f53c8cf0a8e5d) - Fix possible internal error when analysing code with enums on PHP 7.x (https://github.com/phpstan/phpstan-src/commit/b9d96266478461696d8db461a15601c7b4654d9a), [#&#8203;9974](https://github.com/phpstan/phpstan/issues/9974) - NonexistentOffsetInArrayDimFetchRule - do not report errors on expressions after truthy `isset` check (https://github.com/phpstan/phpstan-src/commit/6fbd6e48b86b995b7ab118e0575c747fe224165b), [#&#8203;9991](https://github.com/phpstan/phpstan/issues/9991) - Use real native function name instead of lowercase one ([#&#8203;2673](https://github.com/phpstan/phpstan-src/pull/2673)), [#&#8203;10003](https://github.com/phpstan/phpstan/issues/10003), thanks [@&#8203;fredden](https://github.com/fredden)! - Include property intializations from parent scope for anonymous functions ([#&#8203;2607](https://github.com/phpstan/phpstan-src/pull/2607)), [#&#8203;9831](https://github.com/phpstan/phpstan/issues/9831), thanks [@&#8203;fabacino](https://github.com/fabacino)! - FileFinder - make list of found files unique (https://github.com/phpstan/phpstan-src/commit/749126094d4ea84f770251dd41a277a46567b47e) - Fix internal error with first-class callable in `array_filter` (https://github.com/phpstan/phpstan-src/commit/0228643a9062c6ceb2eadba4b3f64f8b1a35fea5), [#&#8203;9994](https://github.com/phpstan/phpstan/issues/9994) - Fix subclass acceptability when class alias is involved on "ours" side (https://github.com/phpstan/phpstan-src/commit/d5c599c962cadc13acb206b932a8e3a74fc46025), [#&#8203;10023](https://github.com/phpstan/phpstan/issues/10023) # Function signature fixes 🤖 - Fix incorrect doc for `SQLite3::openBlob` ([#&#8203;2668](https://github.com/phpstan/phpstan-src/pull/2668)), thanks [@&#8203;rodrigoq](https://github.com/rodrigoq)! - Update `number_format` return from `string` to `non-empty-string` ([#&#8203;2678](https://github.com/phpstan/phpstan-src/pull/2678)), thanks [@&#8203;devnix](https://github.com/devnix)! ### [`v1.10.38`](https://github.com/phpstan/phpstan/releases/tag/1.10.38) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.37...1.10.38) # Improvements 🔧 - Remove function signatures that were removed in PHP 8.0 ([#&#8203;2662](https://github.com/phpstan/phpstan-src/pull/2662)), [#&#8203;9954](https://github.com/phpstan/phpstan/issues/9954), thanks [@&#8203;Th3Cod3](https://github.com/Th3Cod3)! # Bugfixes 🐛 - Update BetterReflection - Fix for non-backed enums (https://github.com/ondrejmirtes/BetterReflection/commit/4dd0f2bb17810ab0ee8f2a77c63d6b02f7b6d0d4) - Do not invalidate types passed by value (https://github.com/phpstan/phpstan-src/commit/0b8dca74e5345244a955535b54e9874beae76713), https://github.com/phpstan/phpstan/discussions/9927 - Do not influence types of arguments before the function is called (https://github.com/phpstan/phpstan-src/commit/c45d42dd1d031016668099957d2b77706f208d67) - Fixed collapsing of constant arrays (https://github.com/phpstan/phpstan-src/commit/746de74c5cdd339c9020cfb03784fb39229ed86a), [#&#8203;9985](https://github.com/phpstan/phpstan/issues/9985) # Internals 🔍 - Lazier type-resolving in `isset` checks ([#&#8203;2664](https://github.com/phpstan/phpstan-src/pull/2664)), thanks [@&#8203;staabm](https://github.com/staabm)! - Refactor to invalidate args inside `processArgs` (https://github.com/phpstan/phpstan-src/commit/52eb6f8e5f19a41b8a00ca331ba67c7cba8aa952) - Merge array types a bit later (https://github.com/phpstan/phpstan-src/commit/adbc35a1c72585df4586131f8e99b882bb64677d) ### [`v1.10.37`](https://github.com/phpstan/phpstan/releases/tag/1.10.37) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.36...1.10.37) # Bugfixes 🐛 - Support array shape covariance when the optional key is missing in the subtype ([#&#8203;2655](https://github.com/phpstan/phpstan-src/pull/2655)), [#&#8203;9905](https://github.com/phpstan/phpstan/issues/9905), [#&#8203;5655](https://github.com/phpstan/phpstan/issues/5655), [#&#8203;7273](https://github.com/phpstan/phpstan/issues/7273), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix conditional types ([#&#8203;2659](https://github.com/phpstan/phpstan-src/pull/2659)), [#&#8203;9951](https://github.com/phpstan/phpstan/issues/9951), [#&#8203;9963](https://github.com/phpstan/phpstan/issues/9963), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Handle exception thrown from callable object's `__invoke` method ([#&#8203;2502](https://github.com/phpstan/phpstan-src/pull/2502)), [#&#8203;6233](https://github.com/phpstan/phpstan/issues/6233), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Update BetterReflection - ReflectionSourceStubber - fix enum as default function parameter value (https://github.com/ondrejmirtes/BetterReflection/commit/135a394e2fba447a788ac3a36818e4cde8b87ac4), https://github.com/nunomaduro/larastan/issues/1749 ### [`v1.10.36`](https://github.com/phpstan/phpstan/releases/tag/1.10.36) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.35...1.10.36) # Improvements 🔧 - DumpParametersCommand: `--json` option (https://github.com/phpstan/phpstan-src/commit/91a0002402123b96a08978ba400b5d76d5456693) - Implement `reportUncheckedExceptionDeadCatch` option (defaults to `true`) ([#&#8203;2648](https://github.com/phpstan/phpstan-src/pull/2648)), [#&#8203;9921](https://github.com/phpstan/phpstan/issues/9921), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Support union types in `array_chunk()` ([#&#8203;2635](https://github.com/phpstan/phpstan-src/pull/2635)), thanks [@&#8203;staabm](https://github.com/staabm)! - Result cache: Indicate key differences in cache metadata ([#&#8203;2630](https://github.com/phpstan/phpstan-src/pull/2630)), thanks [@&#8203;staabm](https://github.com/staabm)! - Get rid of annoying "on an unknown class ReflectionEnum" error on PHP < 8.0 (https://github.com/phpstan/phpstan-src/commit/2b9af363a3d2a9620c4b9bfb65e81813b69623d0) # Bugfixes 🐛 - Fix resolving nested conditional types with union subjects ([#&#8203;2641](https://github.com/phpstan/phpstan-src/pull/2641)), [#&#8203;9860](https://github.com/phpstan/phpstan/issues/9860), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Detect array_rand second parameter ([#&#8203;2633](https://github.com/phpstan/phpstan-src/pull/2633)), [#&#8203;9803](https://github.com/phpstan/phpstan/issues/9803), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix subtracting types from union template types ([#&#8203;2652](https://github.com/phpstan/phpstan-src/pull/2652)), [#&#8203;9939](https://github.com/phpstan/phpstan/issues/9939), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - fix infinite cycle due to incorrect implements/extends ([#&#8203;2483](https://github.com/phpstan/phpstan-src/pull/2483)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix ConstantFloatType value dump precision ([#&#8203;2358](https://github.com/phpstan/phpstan-src/pull/2358)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Do not trigger PhpDocInheritanceResolver if we do not need the PHPDoc type when resolving the type of ClassConstFetch ([#&#8203;2414](https://github.com/phpstan/phpstan-src/pull/2414)), [#&#8203;9039](https://github.com/phpstan/phpstan/issues/9039), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - `connection_*` functions are impure ([#&#8203;2555](https://github.com/phpstan/phpstan-src/pull/2555)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add stubs for `mysqli` and `mysqli_result` classes ([#&#8203;2295](https://github.com/phpstan/phpstan-src/pull/2295)), thanks [@&#8203;phansys](https://github.com/phansys)! # Internals 🔍 - E2E test about env variables in config parameters (https://github.com/phpstan/phpstan-src/commit/980ab5bba4de0246587647e8cf6b7abe95697379) - Prevent unnecessary calls to `getFiniteTypes()` ([#&#8203;2636](https://github.com/phpstan/phpstan-src/pull/2636)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove unnecessary IO ([#&#8203;2613](https://github.com/phpstan/phpstan-src/pull/2613)), thanks [@&#8203;staabm](https://github.com/staabm)! - Restrict "Merge maintained branch" workflow to the main repository ([#&#8203;2654](https://github.com/phpstan/phpstan-src/pull/2654)), thanks [@&#8203;thg2k](https://github.com/thg2k)! ### [`v1.10.35`](https://github.com/phpstan/phpstan/releases/tag/1.10.35) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.34...1.10.35) # Major new features 🚀 - Generics: **Type projections aka call-site variance** ([#&#8203;2485](https://github.com/phpstan/phpstan-src/pull/2485)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Learn more: https://phpstan.org/blog/guide-to-call-site-generic-variance # Bugfixes 🐛 - Make `value-of<...>` lazier (https://github.com/phpstan/phpstan-src/commit/234f77d652bf6326be4bf5c25c7aab67145aca71), [#&#8203;9881](https://github.com/phpstan/phpstan/issues/9881) - Update BetterReflection, [#&#8203;9877](https://github.com/phpstan/phpstan/issues/9877) - Fix `ReflectionAttribute::newInstance()` with nested class using named arguments (https://github.com/ondrejmirtes/BetterReflection/commit/8d751dd38f4d089715e748863d0d8e4113bc408c), thanks [@&#8203;enumag](https://github.com/enumag)! - Improve typing of filters that do not accept non-falsy strings ([#&#8203;2620](https://github.com/phpstan/phpstan-src/pull/2620)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Internals 🔍 - name-collision-detector 2.0 (https://github.com/phpstan/phpstan-src/commit/c3cb573c595bf5cc72471fd8d773aa3b0296b035) - Remove `phpstan/phpstan-php-parser` ([#&#8203;2632](https://github.com/phpstan/phpstan-src/pull/2632)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.34`](https://github.com/phpstan/phpstan/releases/tag/1.10.34) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.33...1.10.34) # Improvements 🔧 - Add support and tests for `$this` type assertions ([#&#8203;2609](https://github.com/phpstan/phpstan-src/pull/2609)), [#&#8203;8904](https://github.com/phpstan/phpstan/issues/8904), thanks [@&#8203;ekisu](https://github.com/ekisu)! - Update [phpstan/phpdoc-parser to 1.24.0](https://github.com/phpstan/phpdoc-parser/releases/tag/1.24.0) - Allow asserting the type of `$this` (https://github.com/phpstan/phpdoc-parser/pull/209), thanks [@&#8203;ekisu](https://github.com/ekisu)! - Avoid creating an Exception when it is not necessary (https://github.com/phpstan/phpdoc-parser/pull/208), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Added `--fail-without-result-cache` CLI option ([#&#8203;2611](https://github.com/phpstan/phpstan-src/pull/2611)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make result cache independent from configs include order ([#&#8203;2606](https://github.com/phpstan/phpstan-src/pull/2606)), thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce unnecessary calls into reflection ([#&#8203;2614](https://github.com/phpstan/phpstan-src/pull/2614)), thanks [@&#8203;staabm](https://github.com/staabm)! - Micro-optimize with `in_array()` ([#&#8203;2618](https://github.com/phpstan/phpstan-src/pull/2618)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Cover ArgumentsNormalizer with BC promise (https://github.com/phpstan/phpstan-src/commit/b87db6233f08414e176f02ba2dcf08414cb1d83d) - LastConditionVisitor: condition followed by throw is marked as last ([#&#8203;2405](https://github.com/phpstan/phpstan-src/pull/2405)), thanks [@&#8203;JanTvrdik](https://github.com/JanTvrdik)! # Function signature fixes 🤖 - fix incorrect doc for `inotify_read` ([#&#8203;2605](https://github.com/phpstan/phpstan-src/pull/2605)), thanks [@&#8203;taka-oyama](https://github.com/taka-oyama)! # Internals 🔍 - name-collision-detector (https://github.com/phpstan/phpstan-src/commit/95cdbe577513286c36dcf513fe76f269e8a32125) ### [`v1.10.33`](https://github.com/phpstan/phpstan/releases/tag/1.10.33) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.32...1.10.33) # Improvements 🔧 - Support for referencing environment variables in the config ([#&#8203;2559](https://github.com/phpstan/phpstan-src/pull/2559)), [#&#8203;1918](https://github.com/phpstan/phpstan/issues/1918) - Made parent class reflection resolving lazier ([#&#8203;2584](https://github.com/phpstan/phpstan-src/pull/2584)), thanks [@&#8203;staabm](https://github.com/staabm)! - FileTypeMapper - optimization of type aliases (https://github.com/phpstan/phpstan-src/commit/2be81ac1cffa02da2bd0e3b52961cd3d528f2325) - Use NonAcceptingNeverType in more places (https://github.com/phpstan/phpstan-src/commit/3e03e9d7c15fdf64e6d55539a6c3045b3b8c6604) - MethodCall: mark virtual nullsafe call with attribute ([#&#8203;2598](https://github.com/phpstan/phpstan-src/pull/2598)), [#&#8203;9830](https://github.com/phpstan/phpstan/issues/9830), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Bugfixes 🐛 - Fix `checkBenevolentUnionTypes: true` along with `@template` with `array-key` bound ([#&#8203;2587](https://github.com/phpstan/phpstan-src/pull/2587)), [#&#8203;9766](https://github.com/phpstan/phpstan/issues/9766), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix type inference of `array_sum()` ([#&#8203;2591](https://github.com/phpstan/phpstan-src/pull/2591)), [#&#8203;9808](https://github.com/phpstan/phpstan/issues/9808), thanks [@&#8203;zer0-star](https://github.com/zer0-star)! - Update Symfony polyfills (https://github.com/phpstan/phpstan-src/commit/dfcaa3082c975b13847ff9de5e55438ce7b65fc4), [#&#8203;8538](https://github.com/phpstan/phpstan/issues/8538) # Function signature fixes 🤖 - More precise `inotify` related function signatures ([#&#8203;2599](https://github.com/phpstan/phpstan-src/pull/2599)), thanks [@&#8203;thg2k](https://github.com/thg2k)! # Internals 🔍 - Prevent most `$parentPhpDocBlock->getClassReflection()->isBuiltin()` calls ([#&#8203;2585](https://github.com/phpstan/phpstan-src/pull/2585)), thanks [@&#8203;staabm](https://github.com/staabm)! - micro: use `spl_object_id()` ([#&#8203;2592](https://github.com/phpstan/phpstan-src/pull/2592)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update `nette/di` ([#&#8203;2597](https://github.com/phpstan/phpstan-src/pull/2597)) ### [`v1.10.32`](https://github.com/phpstan/phpstan/releases/tag/1.10.32) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.31...1.10.32) # Improvements 🔧 - Optimize FileTypeMapper for huge PHPDocs ([#&#8203;2582](https://github.com/phpstan/phpstan-src/pull/2582)), [#&#8203;9498](https://github.com/phpstan/phpstan/issues/9498) - This fixes performance issue for projects that use Carbon (`nesbot/carbon`) - Optimize DumpParametersCommand (https://github.com/phpstan/phpstan-src/commit/379008a6a632e6e657ad920147a87772c41438e1) ### [`v1.10.31`](https://github.com/phpstan/phpstan/releases/tag/1.10.31) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.30...1.10.31) # Improvements 🔧 - Cache OptimizedDirectorySourceLocator data for faster subsequent runs and less work needed by child processes (https://github.com/phpstan/phpstan-src/commit/b66210f114f695a23d62f884615874cf5f7c6bab) - `NonAcceptingNeverType` ([#&#8203;2540](https://github.com/phpstan/phpstan-src/pull/2540)), [#&#8203;9133](https://github.com/phpstan/phpstan/issues/9133), [#&#8203;6485](https://github.com/phpstan/phpstan/issues/6485), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - ClearResultCacheCommand - `--xdebug` option (https://github.com/phpstan/phpstan-src/commit/3befb53be3acb9c6807d1ac0834eafb399762440) # Internals 🔍 - Do not pass a fake path to analyse in ClearResultCacheCommand; check paths count later when asking for files (https://github.com/phpstan/phpstan-src/commit/4e37a2d78baed28974f140775bcc7f5cba62cf6b) - FileCacheStorage - reference cache key in a comment (https://github.com/phpstan/phpstan-src/commit/0fbf0eed7ba63bdae6a8ce7ef33a96bd12236b45) ### [`v1.10.30`](https://github.com/phpstan/phpstan/releases/tag/1.10.30) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.29...1.10.30) # Improvements 🔧 - NotAnalysedTraitRule - do not report for analysis of files-only paths (https://github.com/phpstan/phpstan-src/commit/5f59d58b62ba130aaeedd7d804f3d0bb2b19e4fd) # Bugfixes 🐛 - Fix several issues with nullsafe type specification ([#&#8203;2577](https://github.com/phpstan/phpstan-src/pull/2577)), [#&#8203;9105](https://github.com/phpstan/phpstan/issues/9105), [#&#8203;5172](https://github.com/phpstan/phpstan/issues/5172), [#&#8203;8517](https://github.com/phpstan/phpstan/issues/8517), [#&#8203;7980](https://github.com/phpstan/phpstan/issues/7980), [#&#8203;8664](https://github.com/phpstan/phpstan/issues/8664), [#&#8203;9293](https://github.com/phpstan/phpstan/issues/9293), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Do not report unused class elements if the element is used on an uncertain type like `mixed` (https://github.com/phpstan/phpstan-src/commit/cbdb30d596d44cd00361989df72cb15f33f26109), [#&#8203;9765](https://github.com/phpstan/phpstan/issues/9765) - ConditionalTagsExtension: add missing tags ([#&#8203;2574](https://github.com/phpstan/phpstan-src/pull/2574)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - CleaningVisitor - keep closures and arrow functions (https://github.com/phpstan/phpstan-src/commit/0501aaf259f16cd1bd27e2a6ec2d8b1de5af5edf), [#&#8203;9776](https://github.com/phpstan/phpstan/issues/9776) - Fix baseline for access to uninitialized property from trait ([#&#8203;2568](https://github.com/phpstan/phpstan-src/pull/2568)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix generalizing types in loops (https://github.com/phpstan/phpstan-src/commit/c09be9ec0e8ca6b448da52ee5320417bc692adf9), [#&#8203;9753](https://github.com/phpstan/phpstan/issues/9753) - Fix foreach scope when iterating non-array and `polluteScopeWithAlwaysIterableForeach` is `true` (https://github.com/phpstan/phpstan-src/commit/853a1e693eb18b9c1eef87f264c90b4d446db710), [#&#8203;9784](https://github.com/phpstan/phpstan/issues/9784) # Internals 🔍 - Issue bot - special NotAnalysedTraitRule that runs even with `onlyFiles=true` (https://github.com/phpstan/phpstan-src/commit/6c941aecbfd47dd09315d995821eb904288f04c1) - Ability to disable `implicitThrows` in tests ([#&#8203;2576](https://github.com/phpstan/phpstan-src/pull/2576)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Rename duplicate symbols (https://github.com/phpstan/phpstan-src/commit/21717178796e2081d3c4275e6cc54821cfcdcba6) ### [`v1.10.29`](https://github.com/phpstan/phpstan/releases/tag/1.10.29) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.28...1.10.29) # Improvements 🔧 - Update nikic/php-parser to v4.17.1 - PHP 8.3 features are no longer parse errors. Full-fledged PHP 8.3 support is coming later this year. - Update BetterReflection to 6.12.0 # Bugfixes 🐛 - PHPStan Pro - when launching, `PHP_BINARY` needs to be escaped (https://github.com/phpstan/phpstan-src/commit/2c7cfd8b82beb355c1125524049cf6d16495e067) # Function signature fixes 🤖 - Fix FTP-related function signatures ([#&#8203;2551](https://github.com/phpstan/phpstan-src/pull/2551)), thanks [@&#8203;thg2k](https://github.com/thg2k)! ### [`v1.10.28`](https://github.com/phpstan/phpstan/releases/tag/1.10.28) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.27...1.10.28) # Improvements 🔧 - Update BetterReflection to 6.12.0 (https://github.com/phpstan/phpstan-src/commit/7c49c944c7a40a2065f27d2ba94eb90f0f2fc22d) # Bugfixes 🐛 - Nullsafe operator on `null` results in `null` (https://github.com/phpstan/phpstan-src/commit/5c40c853ff91d518dea2afee9449ef58d8479314), [#&#8203;9721](https://github.com/phpstan/phpstan/issues/9721) - Properties set in the native constructor are initialized in additional constructors (https://github.com/phpstan/phpstan-src/commit/1b0c6a0166e6e5199407377d124cfe5cdac74b87), [#&#8203;9619](https://github.com/phpstan/phpstan/issues/9619) - Fix performance problem with nested BooleanOr and BooleanAnd (https://github.com/phpstan/phpstan-src/commit/9adae6c4f8c4797c8e60353430ba9a66dc897bb7), [#&#8203;9690](https://github.com/phpstan/phpstan/issues/9690), [#&#8203;9676](https://github.com/phpstan/phpstan/issues/9676) - CallableTypeHelper - copy variadic parameters if the accepting closure has more parameters (https://github.com/phpstan/phpstan-src/commit/31ed326fb113238df762bf9237da50e4613bde32), [#&#8203;9699](https://github.com/phpstan/phpstan/issues/9699) # Internals 🔍 - Simplify access to ClassReflection in ClassPropertyNode ([#&#8203;2565](https://github.com/phpstan/phpstan-src/pull/2565)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! ### [`v1.10.27`](https://github.com/phpstan/phpstan/releases/tag/1.10.27) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.26...1.10.27) # Bleeding edge 🔪 - More precise `stream_socket_client()` signature ([#&#8203;2519](https://github.com/phpstan/phpstan-src/pull/2519)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `scandir()` signature ([#&#8203;2518](https://github.com/phpstan/phpstan-src/pull/2518)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `extract()` signature ([#&#8203;2517](https://github.com/phpstan/phpstan-src/pull/2517)), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Report trait access to unititialized property in the trait instead of class ([#&#8203;2531](https://github.com/phpstan/phpstan-src/pull/2531)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Type projections, part 2: enforce elementary rules ([#&#8203;2481](https://github.com/phpstan/phpstan-src/pull/2481)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Unify ignoring lines in traits with parser tokens (https://github.com/phpstan/phpstan-src/commit/01294d86b811444b72d7c67c5e75f115daddbd13), [#&#8203;6175](https://github.com/phpstan/phpstan/issues/6175) # Bugfixes 🐛 - Fix json method exception ([#&#8203;2524](https://github.com/phpstan/phpstan-src/pull/2524)), [#&#8203;9568](https://github.com/phpstan/phpstan/issues/9568), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Support of printf with dynamic width ([#&#8203;2543](https://github.com/phpstan/phpstan-src/pull/2543)), [#&#8203;9674](https://github.com/phpstan/phpstan/issues/9674), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Support of printf with dynamic precision (and improved support of dynamic width) ([#&#8203;2544](https://github.com/phpstan/phpstan-src/pull/2544)), [#&#8203;9677](https://github.com/phpstan/phpstan/issues/9677), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Fix types for conditional parameters after checks ([#&#8203;2548](https://github.com/phpstan/phpstan-src/pull/2548)), [#&#8203;7915](https://github.com/phpstan/phpstan/issues/7915), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Prevent `Call to end() on null` (https://github.com/phpstan/phpstan-src/commit/a5e5719bcbe3385f2bac77704e7da850da766a01), [#&#8203;9722](https://github.com/phpstan/phpstan/issues/9722) - Fix internal error in SimpleXMLElementConstructorThrowTypeExtension ([#&#8203;2561](https://github.com/phpstan/phpstan-src/pull/2561)), [#&#8203;9716](https://github.com/phpstan/phpstan/issues/9716), thanks [@&#8203;staabm](https://github.com/staabm)! - Method extensions class name is case-insensitive ([#&#8203;2562](https://github.com/phpstan/phpstan-src/pull/2562)), [#&#8203;9716](https://github.com/phpstan/phpstan/issues/9716), thanks [@&#8203;staabm](https://github.com/staabm)! - InArrayFunctionTypeSpecifyingExtension - fix calls with less than 2 parameters (https://github.com/phpstan/phpstan-src/commit/4d77e98e151599d12fd828df969929ed419a0924), [#&#8203;9711](https://github.com/phpstan/phpstan/issues/9711) # Function signature fixes 🤖 - `uopz_flags` - flags are optional (https://github.com/phpstan/phpstan-src/commit/917750efd8550446492e91ca3069179416fa80f1), [#&#8203;9611](https://github.com/phpstan/phpstan/issues/9611) - Add `base64_decode` overloads to PHP 8+ ([#&#8203;2529](https://github.com/phpstan/phpstan-src/pull/2529)), [#&#8203;9428](https://github.com/phpstan/phpstan/issues/9428), thanks [@&#8203;dktapps](https://github.com/dktapps)! - Mark few Ds methods as impure ([#&#8203;2550](https://github.com/phpstan/phpstan-src/pull/2550)), thanks [@&#8203;simPod](https://github.com/simPod)! # Internals 🔍 - Avoid doing work before its necessary in mutating scope. ([#&#8203;2537](https://github.com/phpstan/phpstan-src/pull/2537)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Changed `linesToIgnore` attribute format (https://github.com/phpstan/phpstan-src/commit/2862a7bf7927a7e76771b71f43206d01dfc5d6ef) - Prevent unnecessary work in MutatingScope ([#&#8203;2554](https://github.com/phpstan/phpstan-src/pull/2554)), thanks [@&#8203;staabm](https://github.com/staabm)! - Validate parameters with parametersSchema each time after container creation ([#&#8203;2558](https://github.com/phpstan/phpstan-src/pull/2558)) ### [`v1.10.26`](https://github.com/phpstan/phpstan/releases/tag/1.10.26) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.25...1.10.26) # Improvements 🔧 - More precise return type for trigger_error ([#&#8203;2526](https://github.com/phpstan/phpstan-src/pull/2526)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! # Bugfixes 🐛 - Fix filtering default stub files on Windows ([#&#8203;2406](https://github.com/phpstan/phpstan-src/pull/2406)), thanks [@&#8203;maryo](https://github.com/maryo)! - FileHelper absolutize and normalize: Fix path with scheme ([#&#8203;2506](https://github.com/phpstan/phpstan-src/pull/2506)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix `array_keys()` and \`array_values()\`\` on constant arrays ([#&#8203;2516](https://github.com/phpstan/phpstan-src/pull/2516)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix access to uninitialized property via extension in additional constructor (https://github.com/phpstan/phpstan-src/commit/218aad0804bebd8f0ad60eea69afb24d8fa4ca48), [#&#8203;9619](https://github.com/phpstan/phpstan/issues/9619) - Fix result cache bug with imported type aliases (https://github.com/phpstan/phpstan-src/commit/553c4b141b62244f629b22fe7e8054196cd73a58), [#&#8203;9622](https://github.com/phpstan/phpstan/issues/9622) - Fix result cache bug with imported type aliases in a trait (https://github.com/phpstan/phpstan-src/commit/d8071d0904e4b06a814a0b8b8d7f343d72db0633) - Fix PHP 8.3 deprecation (`$foo--` with a non-numeric string no longer allowed) (https://github.com/phpstan/phpstan-src/commit/c6f4c4ceb7d7355ef761a6ffaa1b1574469789c6) - Array shape with optional keys might be a list (https://github.com/phpstan/phpstan-src/commit/97f0039fe568eec83607861c36718e8f79c481ff) - ArrayMapFunctionReturnTypeExtension - preserve array being a list (https://github.com/phpstan/phpstan-src/commit/d55c4f2c207a6a07712cff2cdaba670fee950258) # Function signature fixes 🤖 - More precise `ftp_*` mode parameter type ([#&#8203;2513](https://github.com/phpstan/phpstan-src/pull/2513)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix signature of `DOMNode::lookupNamespaceURI` ([#&#8203;2527](https://github.com/phpstan/phpstan-src/pull/2527)), thanks [@&#8203;paulbalandan](https://github.com/paulbalandan)! # Internals 🔍 - Simplify access to class reflections in InClassNode rules ([#&#8203;2514](https://github.com/phpstan/phpstan-src/pull/2514)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Simplify access to class reflections in ClassPropertiesNode ([#&#8203;2520](https://github.com/phpstan/phpstan-src/pull/2520)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Simplify access to function reflection in FunctionReturnStatementsNode rules ([#&#8203;2522](https://github.com/phpstan/phpstan-src/pull/2522)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Set class and method reflection in the MethodReturnStatementNode ([#&#8203;2515](https://github.com/phpstan/phpstan-src/pull/2515)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Simplify access to class reflections in ClassConstantsNode and ClassMethodsNode rules ([#&#8203;2521](https://github.com/phpstan/phpstan-src/pull/2521)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Introduce InTraitNode (https://github.com/phpstan/phpstan-src/commit/657fc54b7d358622b791828f94a6a6d9d0f8207c) - TrinaryLogic for `isList` in ConstantArrayType (https://github.com/phpstan/phpstan-src/commit/158c61c6777acb416fb5ff243916c1483b0f220a, https://github.com/phpstan/phpstan-src/commit/f0a9fd796e1b1d023affdb7fb4ffd344d79becd4) - Add polyfill for PHP 8.1 (https://github.com/phpstan/phpstan-src/commit/a8818be2f31d2bc33ac6ccb3c3f221248e70a514, https://github.com/phpstan/phpstan-src/commit/cda7e69587a3d46afe098bf7657af364f3980356) ### [`v1.10.25`](https://github.com/phpstan/phpstan/releases/tag/1.10.25) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.24...1.10.25) # Improvements 🔧 - Understand that promoted property can come from renamed trait constructor (https://github.com/phpstan/phpstan-src/commit/eafba2e09164846a010dc29e65bbc49c814941ae) - Understand that methods called from constructor throwing exception cannot leave object in an uninitializad state (https://github.com/phpstan/phpstan-src/commit/f4d060b6888c8ef4469e99becfd23eb64c40da89) # Bugfixes 🐛 - Allow promoted properties in trait `__construct` even when renamed (https://github.com/phpstan/phpstan-src/commit/4dd3f753b1438c30e9ee882a3f2b4632b1a8cecc), [#&#8203;9577](https://github.com/phpstan/phpstan/issues/9577) - IllegalConstructorStaticCallRule - fix for renamed trait constructor (https://github.com/phpstan/phpstan-src/commit/65330d3be77c4c7e28a2eb51b19850f8895c147a), [#&#8203;9577](https://github.com/phpstan/phpstan/issues/9577) ### [`v1.10.24`](https://github.com/phpstan/phpstan/releases/tag/1.10.24) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.23...1.10.24) # Improvements 🔧 - Evaluate uninitialized properties based on each execution end in constructor (https://github.com/phpstan/phpstan-src/commit/b2d2a9d08df092e78fa0cd652e158e13f2e63a7d), [#&#8203;7649](https://github.com/phpstan/phpstan/issues/7649) - ConstructorReturnTypeRule (https://github.com/phpstan/phpstan-src/commit/2ebbb5303aad6b757c65ca6f12cafebed79bed83) # Bugfixes 🐛 - Fix `processCalledMethod` when anonymous classes are involved (https://github.com/phpstan/phpstan-src/commit/3f5277975a4c625b0fd6a29ea256a672d0bb77fa) - Do not require return type for renamed trait constructor (https://github.com/phpstan/phpstan-src/commit/f6ca9c88d66af8d272e4baec19dbd63a0ec54a5f), [#&#8203;9571](https://github.com/phpstan/phpstan/issues/9571) - FileTypeMapper - fix PHPDocs for renamed trait methods (https://github.com/phpstan/phpstan-src/commit/0bd48b4ae0f397de435ba657f7a36284d90ef2dd), [#&#8203;9571](https://github.com/phpstan/phpstan/issues/9571), [#&#8203;6856](https://github.com/phpstan/phpstan/issues/6856) - Register `json_validate` stub only on PHP 8.3+ (https://github.com/phpstan/phpstan-src/commit/8f8c1af790395a07eb46016ec20f20485bc42c66), [#&#8203;9574](https://github.com/phpstan/phpstan/issues/9574) # Function signature fixes 🤖 - More precise `session_status()` return type ([#&#8203;2509](https://github.com/phpstan/phpstan-src/pull/2509)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.23`](https://github.com/phpstan/phpstan/releases/tag/1.10.23) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.22...1.10.23) # Improvements 🔧 - Fix false positives and false negatives about uninitialized properties (https://github.com/phpstan/phpstan-src/commit/348debc5c3b38c5f40448bae63d76cc99a6baea8), [#&#8203;7198](https://github.com/phpstan/phpstan/issues/7198) - This leads to uninitialized properties being detected in more places - Lazy initialization of `AnalyserResult::$errors` ([#&#8203;2400](https://github.com/phpstan/phpstan-src/pull/2400)), thanks [@&#8203;takaram](https://github.com/takaram)! - Check additional assign of promoted readonly property (https://github.com/phpstan/phpstan-src/commit/8fe4401489c58da040889ed18bffda10ba89f05c) # Bugfixes 🐛 - Fix readonly property assigned in if-else (https://github.com/phpstan/phpstan-src/commit/ce3c1641926e8abf7ce6dca055717e1657deb792), [#&#8203;6402](https://github.com/phpstan/phpstan/issues/6402) - Fix ConstantArrayTypeBuilder's isList flag ([#&#8203;2408](https://github.com/phpstan/phpstan-src/pull/2408)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - TypeSpecifier - handle AlwaysRememberedExpr in handling Identical (https://github.com/phpstan/phpstan-src/commit/a769a1c90c7d9b051e42225104dbc3c83768a553), [#&#8203;9499](https://github.com/phpstan/phpstan/issues/9499) - Fix processing traits with renamed methods (https://github.com/phpstan/phpstan-src/commit/c6035f3ca1511332c9fec762135a24f5963dee06), [#&#8203;7198](https://github.com/phpstan/phpstan/issues/7198), [#&#8203;6039](https://github.com/phpstan/phpstan/issues/6039), [#&#8203;4758](https://github.com/phpstan/phpstan/issues/4758) # Function signature fixes 🤖 - Allow `null` in `mysqli*real_connect` arguments ([#&#8203;2508](https://github.com/phpstan/phpstan-src/pull/2508)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Cheap checks first in IgnoredRegexValidator ([#&#8203;2505](https://github.com/phpstan/phpstan-src/pull/2505)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Do not use `instanceof ThisType` as it can be unreliable in case of intersection types (https://github.com/phpstan/phpstan-src/commit/79359450f36c073fa8444a7e87c0e29867f6b4c1) ### [`v1.10.22`](https://github.com/phpstan/phpstan/releases/tag/1.10.22) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.21...1.10.22) # Bleeding edge 🔪 - More precise `file()` flags args ([#&#8203;2476](https://github.com/phpstan/phpstan-src/pull/2476), [#&#8203;2482](https://github.com/phpstan/phpstan-src/pull/2482)), thanks [@&#8203;staabm](https://github.com/staabm)! - Non-static methods cannot be used as static callables in PHP 8+ ([#&#8203;2420](https://github.com/phpstan/phpstan-src/pull/2420)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `flock()` operation flags ([#&#8203;2477](https://github.com/phpstan/phpstan-src/pull/2477)), thanks [@&#8203;staabm](https://github.com/staabm)! - Rule for `call_user_func()` ([#&#8203;2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Add return type extension for `constant()` ([#&#8203;2474](https://github.com/phpstan/phpstan-src/pull/2474)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Dynamic `assert()` throw type extension ([#&#8203;2427](https://github.com/phpstan/phpstan-src/pull/2427)), thanks [@&#8203;patrickkusebauch](https://github.com/patrickkusebauch)! - Update nikic/PHP-Parser (https://github.com/phpstan/phpstan-src/commit/79b3034acf926b23ec3bcfed1ad36ea375f01981) - PHP 8.3: `json_validate()` stub (https://github.com/phpstan/phpstan-src/commit/828b269c0dccda404e33a5cca1ac4be1998e18ba), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement `call_user_func()` DynamicFunctionReturnTypeExtension ([#&#8203;2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Add support for math with constant numeric string ([#&#8203;2209](https://github.com/phpstan/phpstan-src/pull/2209)), [#&#8203;8803](https://github.com/phpstan/phpstan/issues/8803), [#&#8203;8827](https://github.com/phpstan/phpstan/issues/8827), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Use case insensitive matching to detect usages of private methods ([#&#8203;2484](https://github.com/phpstan/phpstan-src/pull/2484)), [#&#8203;8346](https://github.com/phpstan/phpstan/issues/8346), thanks [@&#8203;stof](https://github.com/stof)! - fix array_splice with non-array replacement ([#&#8203;2457](https://github.com/phpstan/phpstan-src/pull/2457)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Resolve key and value type of partially non-iterable types when entering foreach (https://github.com/phpstan/phpstan-src/commit/cb5a2b4575bee005c33fcbdc3748abc160cbda14), [#&#8203;9535](https://github.com/phpstan/phpstan/issues/9535), [#&#8203;4907](https://github.com/phpstan/phpstan/issues/4907), [#&#8203;8924](https://github.com/phpstan/phpstan/issues/8924), [#&#8203;5998](https://github.com/phpstan/phpstan/issues/5998) - Foreach can append to the array but it does not change the number of iterations (https://github.com/phpstan/phpstan-src/commit/27085c5516f6864d73e660d6e897a1466c4169a6), [#&#8203;4612](https://github.com/phpstan/phpstan/issues/4612) - MutatingScope - process left side of BooleanAnd and BooleanOr before getting type of the whole expression (https://github.com/phpstan/phpstan-src/commit/989dd6fab8b0bf66777e20c533c90c7841d05c3a), [#&#8203;5365](https://github.com/phpstan/phpstan/issues/5365), [#&#8203;6551](https://github.com/phpstan/phpstan/issues/6551), [#&#8203;7491](https://github.com/phpstan/phpstan/issues/7491), [#&#8203;4004](https://github.com/phpstan/phpstan/issues/4004), [#&#8203;2499](https://github.com/phpstan/phpstan/issues/2499) - MutatingScope - process ternary cond before getting type of the whole expression (https://github.com/phpstan/phpstan-src/commit/faba80560516dc2780ff014f36171e806a7b19c2) - Fix processing switch with complex case conditions (https://github.com/phpstan/phpstan-src/commit/f6b34f2ac86d2830f53ba51601067232ea1bf6d6), [#&#8203;5326](https://github.com/phpstan/phpstan/issues/5326) - Fix ClassConstFetch Identical specification with Yoda conditions ([#&#8203;2498](https://github.com/phpstan/phpstan-src/pull/2498)), [#&#8203;9542](https://github.com/phpstan/phpstan/issues/9542), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Function signature fixes 🤖 - Update functionMap for ext-mongodb 1.16 ([#&#8203;2473](https://github.com/phpstan/phpstan-src/pull/2473)), thanks [@&#8203;alcaeus](https://github.com/alcaeus)! - Add false to the `db2_num_rows()` return type ([#&#8203;2456](https://github.com/phpstan/phpstan-src/pull/2456)), thanks [@&#8203;morozov](https://github.com/morozov)! - More precise `ignore_user_abort()` return type ([#&#8203;2489](https://github.com/phpstan/phpstan-src/pull/2489)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Type projections, part 1: call-site variance in GenericObjectType ([#&#8203;2471](https://github.com/phpstan/phpstan-src/pull/2471)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Test PHP 8.3 ([#&#8203;2486](https://github.com/phpstan/phpstan-src/pull/2486)) - Cleanup NodeScopeResolver ([#&#8203;2499](https://github.com/phpstan/phpstan-src/pull/2499)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.21`](https://github.com/phpstan/phpstan/releases/tag/1.10.21) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.20...1.10.21) # Bugfixes 🐛 - Fix defining variables in match condition (https://github.com/phpstan/phpstan-src/commit/d6c2752b4edf145120d7b0ac7908828fde2289e8), [#&#8203;9474](https://github.com/phpstan/phpstan/issues/9474) - Fix UnusedClosureUsesRule for already traversed match (https://github.com/phpstan/phpstan-src/commit/a7194865487069a0c718227e5a39cd6eab32b8ea), https://github.com/phpstan/phpstan-phpunit/issues/190, [#&#8203;9478](https://github.com/phpstan/phpstan/issues/9478) - Update BetterReflection (https://github.com/phpstan/phpstan-src/commit/a540e44a3649f722464488db3b786c5c894c1775), [#&#8203;9477](https://github.com/phpstan/phpstan/issues/9477) - Fix newInstance on ReflectionAttribute adapter with enum argument (https://github.com/ondrejmirtes/BetterReflection/commit/277b96077b3c15c12605d876be1b87dd1a88b6f8) # Internals 🔍 - Cheap checks first in ObjectType ([#&#8203;2475](https://github.com/phpstan/phpstan-src/pull/2475)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! ### [`v1.10.20`](https://github.com/phpstan/phpstan/releases/tag/1.10.20) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.19...1.10.20) # Improvements 🔧 - PHPStan Pro: Change Cloudflare DNS for to family version ([#&#8203;2467](https://github.com/phpstan/phpstan-src/pull/2467)), thanks [@&#8203;spaze](https://github.com/spaze)! - Add `non-zero-int` type ([#&#8203;2449](https://github.com/phpstan/phpstan-src/pull/2449)), thanks [@&#8203;PrinsFrank](https://github.com/PrinsFrank)! - Implement `gettype()` return type extension ([#&#8203;2437](https://github.com/phpstan/phpstan-src/pull/2437)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Allow to remember constant and impure expressions in `match` condition (https://github.com/phpstan/phpstan-src/commit/0cdda0b210a623ee299323da80771c2c84c602f9), [#&#8203;4451](https://github.com/phpstan/phpstan/issues/4451), [#&#8203;6064](https://github.com/phpstan/phpstan/issues/6064), [#&#8203;9457](https://github.com/phpstan/phpstan/issues/9457) - Fix `gettype` in `match` condition (https://github.com/phpstan/phpstan-src/commit/e4ef00c0573daea5e83199d182e35ea988a7d95b, https://github.com/phpstan/phpstan-src/commit/caa0a5b5247b2ff58c56b543aa3cb286b00ffde7), [#&#8203;8614](https://github.com/phpstan/phpstan/issues/8614) - Fix `get_class` in `match` condition (https://github.com/phpstan/phpstan-src/commit/106526db8bd64880af81faa61d9f970e793e3c38), [#&#8203;1885](https://github.com/phpstan/phpstan/issues/1885), [#&#8203;8536](https://github.com/phpstan/phpstan/issues/8536), [#&#8203;8092](https://github.com/phpstan/phpstan/issues/8092) - Understand `get_class` compared with `static::class` (https://github.com/phpstan/phpstan-src/commit/590eb03e0ce2b5b02562ee9bb0af803fcbb1dc95), [#&#8203;1885](https://github.com/phpstan/phpstan/issues/1885) - Understand `gettype` when there's a union of strings on the other side (https://github.com/phpstan/phpstan-src/commit/36e412ffed0ab6f4220c58276b06041a7a487db3), [#&#8203;6294](https://github.com/phpstan/phpstan/issues/6294), [#&#8203;2580](https://github.com/phpstan/phpstan/issues/2580) - Treat ConstantArrayType as covariant in its keys and values ([#&#8203;2464](https://github.com/phpstan/phpstan-src/pull/2464)), [#&#8203;9161](https://github.com/phpstan/phpstan/issues/9161), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Treat ArrayType as covariant in its keys and values ([#&#8203;2465](https://github.com/phpstan/phpstan-src/pull/2465)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Make `NonEmptyArrayType::toArray()` return `$this` ([#&#8203;2349](https://github.com/phpstan/phpstan-src/pull/2349)), [#&#8203;9208](https://github.com/phpstan/phpstan/issues/9208), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Retain list type via `array_push()` and `array_unshift()` ([#&#8203;2451](https://github.com/phpstan/phpstan-src/pull/2451)), [#&#8203;8449](https://github.com/phpstan/phpstan/issues/8449), thanks [@&#8203;herndlm](https://github.com/herndlm)! - For `@var` above throw and return, change the type of expr only for the stmt callback (https://github.com/phpstan/phpstan-src/commit/b55109537dd62ac0e352b0a55df62cfc83f12f08), [#&#8203;9459](https://github.com/phpstan/phpstan/issues/9459) # Internals 🔍 - Remove redundant conditions from RemoveUnusedCodeByPhpVersionIdVisitor. ([#&#8203;2459](https://github.com/phpstan/phpstan-src/pull/2459)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Return early in CachingVistor to avoid always-false instanceof checks. ([#&#8203;2460](https://github.com/phpstan/phpstan-src/pull/2460)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Introduce CombinationsHelper (https://github.com/phpstan/phpstan-src/commit/175307e12de100632a05f6a122e0873a3c1fc6a1) - `Type::getFiniteTypes()` (https://github.com/phpstan/phpstan-src/commit/7912caf4b66bdff65d3d6795d4c584c17ece5e51, https://github.com/phpstan/phpstan-src/commit/fa9a951f808466be36792ba65f128f9838ab617e, https://github.com/phpstan/phpstan-src/commit/b5cf52b916ad4d155f1809356c96cbe924f51dbe) ### [`v1.10.19`](https://github.com/phpstan/phpstan/releases/tag/1.10.19) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.18...1.10.19) # Bleeding edge 🔪 - Analysis with zero files results in non-zero exit code (https://github.com/phpstan/phpstan-src/commit/46ff440648e62617df86aa74ba905ffa99897737), [#&#8203;9410](https://github.com/phpstan/phpstan/issues/9410) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Detect invalid key in multi dimensional array fetch ([#&#8203;2445](https://github.com/phpstan/phpstan-src/pull/2445)), [#&#8203;6315](https://github.com/phpstan/phpstan/issues/6315), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Support unions of scalars in `sprintf()` arguments (https://github.com/phpstan/phpstan-src/commit/1f955703eea90b7bdf8439ede81a5c6adda85af1) - Update nikic/php-parser (https://github.com/phpstan/phpstan-src/commit/51a284b8a8c04a06f430063f0267e168c048d88a) - Update BetterReflection (https://github.com/phpstan/phpstan-src/commit/ff8ad7e9b3933911d321846bc43f678a43b067d8) # Bugfixes 🐛 - UnusedPrivatePropertyRule - recognize static properties fetched on expr (https://github.com/phpstan/phpstan-src/commit/503978b05e412477d72bb5d846dade3c246f0f70), [#&#8203;9409](https://github.com/phpstan/phpstan/issues/9409), [#&#8203;8541](https://github.com/phpstan/phpstan/issues/8541) - Union of enum cases accepts the enum class type with negated cases ([#&#8203;2418](https://github.com/phpstan/phpstan-src/pull/2418)), [#&#8203;8846](https://github.com/phpstan/phpstan/issues/8846), thanks [@&#8203;takaram](https://github.com/takaram)! - Fix key type of superglobal variables ([#&#8203;2446](https://github.com/phpstan/phpstan-src/pull/2446)), [#&#8203;9306](https://github.com/phpstan/phpstan/issues/9306), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Do not treat definition of functions and class-likes as unreachable ([#&#8203;2263](https://github.com/phpstan/phpstan-src/pull/2263)), [#&#8203;4002](https://github.com/phpstan/phpstan/issues/4002), [#&#8203;8966](https://github.com/phpstan/phpstan/issues/8966), [#&#8203;8319](https://github.com/phpstan/phpstan/issues/8319), thanks [@&#8203;takaram](https://github.com/takaram)! # Function signature fixes 🤖 - Allow `Redis::connect()` to have 7 parameters ([#&#8203;2442](https://github.com/phpstan/phpstan-src/pull/2442)), [#&#8203;9413](https://github.com/phpstan/phpstan/issues/9413), thanks [@&#8203;thbley](https://github.com/thbley)! # Internals 🔍 - StringAlwaysAcceptingObjectWithToStringType is supertype of Stringable objects (https://github.com/phpstan/phpstan-src/commit/9de9efa67facca90b5c5c97851eaf8afff310b4e) ### [`v1.10.18`](https://github.com/phpstan/phpstan/releases/tag/1.10.18) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.17...1.10.18) Implicit throw point is enough to no longer mark multi-catch as dead (https://github.com/phpstan/phpstan-src/commit/c587dd1d870f7a67623e1a3bb7f2811fda688bab), [#&#8203;9406](https://github.com/phpstan/phpstan/issues/9406) ### [`v1.10.17`](https://github.com/phpstan/phpstan/releases/tag/1.10.17) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.16...1.10.17) # Improvements 🔧 - StubValidator - add missing rules about type aliases (https://github.com/phpstan/phpstan-src/commit/8bb45376ca37a9d67a9a0362809b663cd7567e11) # Bugfixes 🐛 - Fix more `in_array` issues ([#&#8203;2432](https://github.com/phpstan/phpstan-src/pull/2432)), [#&#8203;6959](https://github.com/phpstan/phpstan/issues/6959), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix overriding `__debugInfo` with covariant return type ([#&#8203;2435](https://github.com/phpstan/phpstan-src/pull/2435)), [#&#8203;9391](https://github.com/phpstan/phpstan/issues/9391), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `Map::remove()` `@throws` inference ([#&#8203;2434](https://github.com/phpstan/phpstan-src/pull/2434)), [#&#8203;9066](https://github.com/phpstan/phpstan/issues/9066), thanks [@&#8203;baci266](https://github.com/baci266)! - `array_is_list` narrows the type even when not on Bleeding Edge (https://github.com/phpstan/phpstan-src/commit/de2566adeafe5ca36a3517f0a4e3c147d63f037a), [#&#8203;9381](https://github.com/phpstan/phpstan/issues/9381) - AutoloadSourceLocator - do not execute autoloader if the class already exists but is evaled (https://github.com/phpstan/phpstan-src/commit/32b889dd29202eb545d8558b1c93a6b804828d8d), [#&#8203;7960](https://github.com/phpstan/phpstan/issues/7960) - EnumSanityRule - use scope inside enum (https://github.com/phpstan/phpstan-src/commit/04af510e5649a834f2e99750007048ba686ad995), [#&#8203;9402](https://github.com/phpstan/phpstan/issues/9402) - Fix native type of array after `array_push()` (https://github.com/phpstan/phpstan-src/commit/564f79f96c6104cda479a3d0319af356d1b166ad), [#&#8203;9403](https://github.com/phpstan/phpstan/issues/9403) - Refactor pieces looking for dead code for more precise detection of properties, methods, constants (https://github.com/phpstan/phpstan-src/commit/d09401df4514a16eb38334cf4187093a4e66eefb, https://github.com/phpstan/phpstan-src/commit/ffc0495d89763b65d93256928cb95bc4b07f6138), [#&#8203;8412](https://github.com/phpstan/phpstan/issues/8412), [#&#8203;8958](https://github.com/phpstan/phpstan/issues/8958), [#&#8203;8563](https://github.com/phpstan/phpstan/issues/8563), thanks [@&#8203;takaram](https://github.com/takaram)! - Fix param-type specification interfering with root-expression types ([#&#8203;2439](https://github.com/phpstan/phpstan-src/pull/2439)), [#&#8203;9404](https://github.com/phpstan/phpstan/issues/9404), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - More precise `getimagesize*` return type ([#&#8203;2438](https://github.com/phpstan/phpstan-src/pull/2438)), thanks [@&#8203;staabm](https://github.com/staabm)! - base64\_decode returns false only in strict mode ([#&#8203;2419](https://github.com/phpstan/phpstan-src/pull/2419)), thanks [@&#8203;kamil-tekiela](https://github.com/kamil-tekiela)! # Internals 🔍 - Minor refinements to MutatingScope `empty()` and typehint helper ([#&#8203;2430](https://github.com/phpstan/phpstan-src/pull/2430)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! ### [`v1.10.16`](https://github.com/phpstan/phpstan/releases/tag/1.10.16) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.15...1.10.16) # Bleeding edge 🔪 - Report dead types even in multi-exception catch ([#&#8203;2399](https://github.com/phpstan/phpstan-src/pull/2399)), thanks [@&#8203;JanTvrdik](https://github.com/JanTvrdik)! - `error_log` errors with `message_type=2` ([#&#8203;2428](https://github.com/phpstan/phpstan-src/pull/2428)), [#&#8203;9380](https://github.com/phpstan/phpstan/issues/9380), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - `CallableType` and `ClosureType::describe()` - use phpdoc-parser Printer for better precision (https://github.com/phpstan/phpstan-src/commit/30f60c18f5efa9e7d5a5495c90f901178cf17a57), [#&#8203;9268](https://github.com/phpstan/phpstan/issues/9268) - `OffsetAccessType::describe()` uses toPhpDocNode and phpdoc-parser printer (https://github.com/phpstan/phpstan-src/commit/347fdbf2caa4d889d9e59af12fc1049a2aa608bb) - Smarter `extract()` with constant arrays ([#&#8203;2417](https://github.com/phpstan/phpstan-src/pull/2417)), [#&#8203;9331](https://github.com/phpstan/phpstan/issues/9331), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - Detect more issues in enum declarations ([#&#8203;2371](https://github.com/phpstan/phpstan-src/pull/2371)), [#&#8203;9184](https://github.com/phpstan/phpstan/issues/9184), thanks [@&#8203;kubk](https://github.com/kubk)! - Correct magic signature methods when typehints are missing ([#&#8203;2409](https://github.com/phpstan/phpstan-src/pull/2409)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix `SplDoublyLinkedList::offsetGet` return type ([#&#8203;2373](https://github.com/phpstan/phpstan-src/pull/2373)), [#&#8203;9274](https://github.com/phpstan/phpstan/issues/9274), thanks [@&#8203;takaram](https://github.com/takaram)! - Delegate `get_called_class()` to `static::class` (https://github.com/phpstan/phpstan-src/commit/188acf440787c611fa86344b84fe1f41f027e4f6), [#&#8203;7574](https://github.com/phpstan/phpstan/issues/7574), [#&#8203;5252](https://github.com/phpstan/phpstan/issues/5252), [#&#8203;4061](https://github.com/phpstan/phpstan/issues/4061) - Fix enum type subtracting ([#&#8203;2415](https://github.com/phpstan/phpstan-src/pull/2415)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Fix loose comparison against enum ([#&#8203;2410](https://github.com/phpstan/phpstan-src/pull/2410)), thanks [@&#8203;schlndh](https://github.com/schlndh)! # Internals 🔍 - NodeScopeResolver: refactor matching throw points computation ([#&#8203;2399](https://github.com/phpstan/phpstan-src/pull/2399)), thanks [@&#8203;JanTvrdik](https://github.com/JanTvrdik)! - ConstantArrayType - `toPhpDocNode` without keys if they are not necessary (https://github.com/phpstan/phpstan-src/commit/413079d807433cffac4dc9c33535920ff5bfeb18) - Test `@var` in and out of function (https://github.com/phpstan/phpstan-src/commit/4e1934796a74ba49e2ef980894b66d3d5ba2b656), [#&#8203;9331](https://github.com/phpstan/phpstan/issues/9331) ### [`v1.10.15`](https://github.com/phpstan/phpstan/releases/tag/1.10.15) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.14...1.10.15) # Bleeding edge 🔪 - InvalidPhpDocTagValueRule: include PHPDoc line number in the error message (https://github.com/phpstan/phpstan-src/commit/a04e0be832900749b5b4ba22e2de21db8bfa09a0) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Update phpdoc-parser to 1.20.4 - [Changelog](https://github.com/phpstan/phpdoc-parser/compare/f545fc30978190a056832aa7ed995e36a66267f3...7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd) - Notable changes: - CallableTypeNode - support object shape in return type - CallableTypeNode - support `$this` in return type - CallableTypeNode - support ConstTypeNode in return type - Implement IniGetReturnTypeExtension ([#&#8203;2362](https://github.com/phpstan/phpstan-src/pull/2362)), [#&#8203;3063](https://github.com/phpstan/phpstan/issues/3063), thanks [@&#8203;staabm](https://github.com/staabm)! - PHPStan\Node\ClassMethod is covered by BC promise (https://github.com/phpstan/phpstan-src/commit/1036d199c8ef24c62ca5026c911c0af6ef6d9058), [#&#8203;9249](https://github.com/phpstan/phpstan/issues/9249) - Enforce magic `__serialize()` and `__unserialize()` return types ([#&#8203;2372](https://github.com/phpstan/phpstan-src/pull/2372)), thanks [@&#8203;staabm](https://github.com/staabm)! - Report `?->` call on always-null (https://github.com/phpstan/phpstan-src/commit/74d1c9a1ca1cd6199a8771444e9bc4d6b7737f46), [#&#8203;9284](https://github.com/phpstan/phpstan/issues/9284) # Bugfixes 🐛 - Fix object shapes with interfaces and final classes (https://github.com/phpstan/phpstan-src/commit/f199980c3c436636cae59502da178c4c804efb38) - Fix `ConstantFloatType::toPhpDocNode()` for whole numbers ending with 0 ([#&#8203;2355](https://github.com/phpstan/phpstan-src/pull/2355)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Add type for ini_get() 'default_socket_timeout' and 'precision' ([#&#8203;2365](https://github.com/phpstan/phpstan-src/pull/2365)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix Docker detection (https://github.com/phpstan/phpstan-src/commit/8d0c032d19cd6ca9bb8462f8cf74362b2b4a6ae9) - strval accepts Stringable (https://github.com/phpstan/phpstan-src/commit/3a4cd59e46e72fe26119ab356e62a288367643d4), [#&#8203;9283](https://github.com/phpstan/phpstan/issues/9283) - `CURLOPT_HTTPHEADER` should not accept a dictionary ([#&#8203;2369](https://github.com/phpstan/phpstan-src/pull/2369)), [#&#8203;9263](https://github.com/phpstan/phpstan/issues/9263), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - `intval()` and `floatval()` should handle non-scalar values ([#&#8203;2351](https://github.com/phpstan/phpstan-src/pull/2351)), thanks [@&#8203;dravnic](https://github.com/dravnic)! - More precise `strval()` family function signatures ([#&#8203;2354](https://github.com/phpstan/phpstan-src/pull/2354)), thanks [@&#8203;dravnic](https://github.com/dravnic)! # Internals 🔍 - Allow referencing StringAlwaysAcceptingObjectWithToStringType in functionMap (https://github.com/phpstan/phpstan-src/commit/670d04d817134929a48e9313525a328f648fa422) ### [`v1.10.14`](https://github.com/phpstan/phpstan/releases/tag/1.10.14) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.13...1.10.14) # Bleeding edge 🔪 - Check `filter_input*` type param type ([#&#8203;2271](https://github.com/phpstan/phpstan-src/pull/2271)), thanks [@&#8203;herndlm](https://github.com/herndlm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Update phpdoc-parser - [Changelog](https://github.com/phpstan/phpdoc-parser/compare/22dcdfd725ddf99583bfe398fc624ad6c5004a0f...f545fc30978190a056832aa7ed995e36a66267f3) - Add extension to add additional constructors through code ([#&#8203;2348](https://github.com/phpstan/phpstan-src/pull/2348)), thanks [@&#8203;raalderink](https://github.com/raalderink)! - https://github.com/phpstan/phpstan-symfony/issues/346 # Bugfixes 🐛 - Fix `BackedEnum::tryFrom` not being nullable ([#&#8203;2302](https://github.com/phpstan/phpstan-src/pull/2302)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - Specify `never` for `array_combine` with different number of elements ([#&#8203;2303](https://github.com/phpstan/phpstan-src/pull/2303)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - ConstantFloatType - fix `equals()` (https://github.com/phpstan/phpstan-src/commit/e01ce6865f9498340d60c696ee569080f2f62b09) - Fix INF logic (https://github.com/phpstan/phpstan-src/commit/fc673ee9966b7fce1a7ec8f1ca40952a3772a3b1) - Prevent false-positive in `get_parent_class()` on interfaces ([#&#8203;2336](https://github.com/phpstan/phpstan-src/pull/2336)), [#&#8203;4302](https://github.com/phpstan/phpstan/issues/4302), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Fix `Memcache/MemcachePool::get` method signature ([#&#8203;2344](https://github.com/phpstan/phpstan-src/pull/2344)), thanks [@&#8203;dravnic](https://github.com/dravnic)! # Internals 🔍 - `Type::toPhpDocNode()` (https://github.com/phpstan/phpstan-src/commit/8633125f66aadce22938adc3a32b8463596513d0) - Remove `symfony/polyfill-php72` (https://github.com/phpstan/phpstan-src/commit/8ff8fb0bfb1c9511600f5e14fcf6063e1654b2d5) ### [`v1.10.13`](https://github.com/phpstan/phpstan/releases/tag/1.10.13) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.12...1.10.13) - Fix internal error: FilterVarArrayDynamicReturnTypeExtension for `mixed` input ([#&#8203;2338](https://github.com/phpstan/phpstan-src/pull/2338)), [#&#8203;9178](https://github.com/phpstan/phpstan/issues/9178), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.10.12`](https://github.com/phpstan/phpstan/releases/tag/1.10.12) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.11...1.10.12) # Major new features 🚀 - Object shapes, [#&#8203;2923](https://github.com/phpstan/phpstan/issues/2923) - [Documentation](https://phpstan.org/writing-php-code/phpdoc-types#object-shapes) - [Twitter thread](https://twitter.com/OndrejMirtes/status/1643873013731844096) about implementing it - [phpdoc-parser implementation](https://github.com/phpstan/phpdoc-parser/commit/882eabc9b6a12e25c27091a261397f9c8792e722) # Bleeding edge 🔪 - Stricter function signature map (https://github.com/phpstan/phpstan-src/commit/06b746d8e72cc0843707896ec161559bb6a81137, [#&#8203;2163](https://github.com/phpstan/phpstan-src/pull/2163)), [#&#8203;7239](https://github.com/phpstan/phpstan/issues/7239), thanks [@&#8203;staabm](https://github.com/staabm)! - Specify `Imagick` parameter types ([#&#8203;2334](https://github.com/phpstan/phpstan-src/pull/2334)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Improve `filter_*` array handling, support `FILTER_REQUIRE_ARRAY` ([#&#8203;2318](https://github.com/phpstan/phpstan-src/pull/2318)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Asymmetric `@property` types ([#&#8203;2327](https://github.com/phpstan/phpstan-src/pull/2327), [#&#8203;2328](https://github.com/phpstan/phpstan-src/pull/2328), [#&#8203;2329](https://github.com/phpstan/phpstan-src/pull/2329)), [#&#8203;9062](https://github.com/phpstan/phpstan/issues/9062), thanks [@&#8203;jtojnar](https://github.com/jtojnar)! - Specify return type for `filter_input()` ([#&#8203;2010](https://github.com/phpstan/phpstan-src/pull/2010)), [#&#8203;6261](https://github.com/phpstan/phpstan/issues/6261), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve return type precision of `filter_input` with invalid first args ([#&#8203;2333](https://github.com/phpstan/phpstan-src/pull/2333)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Allow `@property` and `@method` to override above the same class (https://github.com/phpstan/phpstan-src/commit/3467a215cf4fdb0a7ba39edd47f986cb9910902f) - Add `FilterVarArrayDynamicReturnTypeExtension` ([#&#8203;2257](https://github.com/phpstan/phpstan-src/pull/2257)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - Fix usage of `TypeSpecifierContext::truthy()` ([#&#8203;2230](https://github.com/phpstan/phpstan-src/pull/2230)), [#&#8203;3013](https://github.com/phpstan/phpstan/issues/3013), [#&#8203;7686](https://github.com/phpstan/phpstan/issues/7686), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Parent template type should respect child class bound when unspecified (https://github.com/phpstan/phpstan-src/commit/1017dc7bc7c997e07c488088a199427790c5ef5a), https://github.com/phpstan/phpstan-doctrine/issues/333 - Fix bug with match expression and `treatPhpDocTypesAsCertain` ([#&#8203;2250](https://github.com/phpstan/phpstan-src/pull/2250)), [#&#8203;8937](https://github.com/phpstan/phpstan/issues/8937), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Generics: fix position variance of readonly-by-phpdoc properties ([#&#8203;2337](https://github.com/phpstan/phpstan-src/pull/2337)), [#&#8203;9153](https://github.com/phpstan/phpstan/issues/9153), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - PHPStan Pro - show errors from CollectedData (https://github.com/phpstan/phpstan-src/commit/b85a9613be49b917133a97ff20d0d94a0aa07876) - Fix methods in IntersectionTypePropertyReflection (https://github.com/phpstan/phpstan-src/commit/d1c4c6d014eea52895b4c0655777134e1cd3c7ce) # Function signature fixes 🤖 - Improve Imagick method types ([#&#8203;2325](https://github.com/phpstan/phpstan-src/pull/2325)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Internals 🔍 - Switch to `cweagans/composer-patches` ([#&#8203;2307](https://github.com/phpstan/phpstan-src/pull/2307)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - WritingToReadOnlyPropertiesRule - hook on better node (https://github.com/phpstan/phpstan-src/commit/bddf57352f07f3a5007afb26cc44445c6344d35b) - Validate usages of `assert*` functions in TypeInferenceTestCase ([#&#8203;2326](https://github.com/phpstan/phpstan-src/pull/2326)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.10.11`](https://github.com/phpstan/phpstan/releases/tag/1.10.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.10...1.10.11) # Bleeding edge 🔪 - Fix position variance of static method parameters ([#&#8203;2313](https://github.com/phpstan/phpstan-src/pull/2313)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Check variance of template types in properties ([#&#8203;2314](https://github.com/phpstan/phpstan-src/pull/2314)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - OverridingMethodRule - include template types in prototype declaring class description (https://github.com/phpstan/phpstan-src/commit/ca2c66cc4dff59ba44d52b82cb9e0aa3256240f3) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Helper PHPDoc type: `template-type` (calling `Type::getTemplateType()` method) (https://github.com/phpstan/phpstan-src/commit/b6d0c87db5c418d5ea4a026790f6e4c1df3da184), https://github.com/phpstan/phpstan/discussions/9053 - Some useful advanced PHPDoc types (https://github.com/phpstan/phpstan-src/commit/387ebd5059990086444e993cc0fb40e167cc71c6) - `enum-string` - `empty-scalar` - `non-empty-scalar` - `non-empty-literal-string` - `pure-callable` - `closed-resource` - `non-empty-mixed` - `callable-array` - RuleErrorBuilder - support multiple tips nicely (https://github.com/phpstan/phpstan-src/commit/e06c529ffc64f84c11ef0e6cd0a9725c6862666c) - StrictComparisonOfDifferentTypesRule - tip for always true comparison between enums (https://github.com/phpstan/phpstan-src/commit/a327965dc58ade31d5ab457435139a283a63f3aa, https://github.com/phpstan/phpstan-src/commit/9850ea7e9833e8929497c3df113dd92c056f54fa) - Handle invalid type aliases better (https://github.com/phpstan/phpstan-src/commit/fc5515a516c6573c01ca786decfb5a509771ab36), [#&#8203;9077](https://github.com/phpstan/phpstan/issues/9077), [#&#8203;8473](https://github.com/phpstan/phpstan/issues/8473) - Uses phpstan/phpdoc-parser 1.17 - https://github.com/phpstan/phpdoc-parser/commit/bfec8729f7e23c40670f98e27e694cfdb13fc12a - https://github.com/phpstan/phpdoc-parser/commit/d3753fcb3abc6f78f5de6f72153d4b9c99c72dee # Bugfixes 🐛 - Be smarter about new array keys after assignment (https://github.com/phpstan/phpstan-src/commit/6c32371f7c7b8aa330bf7c78b680bc4347f8ce37), [#&#8203;9131](https://github.com/phpstan/phpstan/issues/9131), [#&#8203;8900](https://github.com/phpstan/phpstan/issues/8900), [#&#8203;8222](https://github.com/phpstan/phpstan/issues/8222) - Fix `StaticType::isSuperTypeOf()` for subtypes of `ObjectType` (https://github.com/phpstan/phpstan-src/commit/b439fed7b19fc11287237c85bc50baf73fae0158), [#&#8203;9142](https://github.com/phpstan/phpstan/issues/9142) - `TypehintHelper::decideTypeFromReflection()` should accept correct ancestor's ClassReflection, not just class name (https://github.com/phpstan/phpstan-src/commit/297a9feca4c5df2e809bc7393959694566d23344) # Function signature fixes 🤖 - Add types for `IntlPartsIterator` ([#&#8203;2324](https://github.com/phpstan/phpstan-src/pull/2324)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.10.10`](https://github.com/phpstan/phpstan/releases/tag/1.10.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.9...1.10.10) # Improvements 🔧 - JsonErrorFormatter - include identifiers (https://github.com/phpstan/phpstan-src/commit/6910be2321136601b75112a8c1e3d107bf3a25c7) - AccessPropertiesRule - tip with [article link](https://phpstan.org/blog/solving-phpstan-access-to-undefined-property) (https://github.com/phpstan/phpstan-src/commit/e6e2d1a63417909c50900a10fbedf0a426f5ac21) - Note about `--xdebug` when Xdebug is enabled (https://github.com/phpstan/phpstan-src/commit/1d4ede19f6f08d6a07216cfe8536dc7dec2f4001) # Bugfixes 🐛 - IssetCheck - respect `treatPhpDocTypesAsCertain` for variables (https://github.com/phpstan/phpstan-src/commit/5b7a1153dd76b2f771b13dcd28ef4f7b832e2b84), [#&#8203;9126](https://github.com/phpstan/phpstan/issues/9126) - IssetCheck - respect `treatPhpDocTypesAsCertain` in more places (https://github.com/phpstan/phpstan-src/commit/49d2aa6fd0205da790f251d7ee42fb0fc0676888) - Do not check template type variance in constructor ([#&#8203;2311](https://github.com/phpstan/phpstan-src/pull/2311)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! # Function signature fixes 🤖 - Fix `Imagick::profileImage()` type ([#&#8203;2312](https://github.com/phpstan/phpstan-src/pull/2312)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.10.9`](https://github.com/phpstan/phpstan/releases/tag/1.10.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.8...1.10.9) # Improvements 🔧 - Test cases - make some methods static because of PHPUnit 10 dataProviders (https://github.com/phpstan/phpstan-src/commit/ea2670a086f0f699b92dd6b2535504771054498c), https://github.com/phpstan/phpstan/discussions/9070 - StrictComparisonOfDifferentTypesRule - tip about `treatPhpDocTypesAsCertain` (https://github.com/phpstan/phpstan-src/commit/40400aeb2830f1e4f29748f5a20989fa34d4d02f) - ConstantLooseComparisonRule - respect `treatPhpDocTypesAsCertain` (https://github.com/phpstan/phpstan-src/commit/72472dd441e445ff6bf4b01b53dfee3613cfea78) - ConstantLooseComparisonRule - tip about `treatPhpDocTypesAsCertain` (https://github.com/phpstan/phpstan-src/commit/d892c34e9b2865e6e1908b08b2a84823f2ec54cf) - PHPStan Pro - configurable DNS servers (https://github.com/phpstan/phpstan-src/commit/f3711a2598c6dd8c9e1ca2f1990736db4de61ee3), [#&#8203;9106](https://github.com/phpstan/phpstan/issues/9106) - Attempt unloading Xdebug before showing warnings ([#&#8203;2299](https://github.com/phpstan/phpstan-src/pull/2299)), thanks [@&#8203;AJenbo](https://github.com/AJenbo)! # Function signature fixes 🤖 - Fix `pg_pconnect` function signature ([#&#8203;2300](https://github.com/phpstan/phpstan-src/pull/2300)), thanks [@&#8203;dravnic](https://github.com/dravnic)! - Fix incorrect type for `NumberFormatter::parseCurrency` ([#&#8203;2309](https://github.com/phpstan/phpstan-src/pull/2309)), thanks [@&#8203;rovansteen](https://github.com/rovansteen)! ### [`v1.10.8`](https://github.com/phpstan/phpstan/releases/tag/1.10.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.7...1.10.8) # Improvements 🔧 - Detect large `.php` baseline file in analysed paths and warn about possible PHPStan slowdown (https://github.com/phpstan/phpstan-src/commit/d6d9ef72d73c0030e0a309aa5b9d56a3c8b0c4b1) # Bugfixes 🐛 - Don't report unknown class in inline `@var` after `class_exists()` ([#&#8203;2292](https://github.com/phpstan/phpstan-src/pull/2292)), [#&#8203;9055](https://github.com/phpstan/phpstan/issues/9055), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `Ds\Map::get()` `@throws` inference ([#&#8203;2297](https://github.com/phpstan/phpstan-src/pull/2297)), [#&#8203;9066](https://github.com/phpstan/phpstan/issues/9066), thanks [@&#8203;simPod](https://github.com/simPod)! - Support of unofficial specifiers in `sprintf`/`printf` ([#&#8203;2301](https://github.com/phpstan/phpstan-src/pull/2301)), [#&#8203;9072](https://github.com/phpstan/phpstan/issues/9072), [#&#8203;2342](https://github.com/phpstan/phpstan/issues/2342), thanks [@&#8203;kukulich](https://github.com/kukulich)! # Internals 🔍 - Rich PHPDocs for extension interfaces (https://github.com/phpstan/phpstan-src/commit/23d29aba97762c39f5d6df58461a2545bb270d9b, https://github.com/phpstan/phpstan-src/commit/f67a3729dc263c63cc302f431cdd7a232b543fba, https://github.com/phpstan/phpstan-src/commit/cbfb23d8420420324396bffd9e1c096553c933b3) - Browse at: https://apiref.phpstan.org/ ### [`v1.10.7`](https://github.com/phpstan/phpstan/releases/tag/1.10.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.6...1.10.7) # Improvements 🔧 - Backed enums - dynamic return type extension for `from()` and `tryFrom()` (https://github.com/phpstan/phpstan-src/commit/edcaaba2ad5bc1bbf4d770a5998fe6944eb3a234) # Function signature fixes 🤖 - Fix `XMLReader::XML` return type (https://github.com/phpstan/phpstan-src/commit/195cb7bf839c51113244995e4a17ff699c75c962) # Internals 🔍 - Compiled PHAR - commit and sign as [@&#8203;phpstan-bot](https://github.com/phpstan-bot) (https://github.com/phpstan/phpstan-src/commit/e73523da355f45487cd47ca87cfd334a7327bfd1) ### [`v1.10.6`](https://github.com/phpstan/phpstan/releases/tag/1.10.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.5...1.10.6) # Bleeding edge 🔪 - Report narrowing `PHPStan\Type\Type` interface via `@var` (https://github.com/phpstan/phpstan-src/commit/713b98fb107213c28e3d8c8b4b43c5f5fc47c144), https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389 - Check invalid PHPDocs in previously unchecked statement types (https://github.com/phpstan/phpstan-src/commit/9780d352f3264aac09ac7954f691de1877db8e01) - InvalidPHPStanDocTagRule in StubValidator (https://github.com/phpstan/phpstan-src/commit/9c2552b7e744926d1a74c1ba8fd32c64079eed61) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - InvalidPHPStanDocTagRule - add forgotten handling of ClassConst (https://github.com/phpstan/phpstan-src/commit/d943d58c219b457403dc536f855d9d6f32e2280f) # Bugfixes 🐛 - Fix false positive with `array_combine()` on PHP 8+ ([#&#8203;2276](https://github.com/phpstan/phpstan-src/pull/2276)), [#&#8203;9011](https://github.com/phpstan/phpstan/issues/9011), thanks [@&#8203;staabm](https://github.com/staabm)! - Ignore Nop nodes in NodeScopeResolver when creating UnreachableStatementNode ([#&#8203;2279](https://github.com/phpstan/phpstan-src/pull/2279)), [#&#8203;8966](https://github.com/phpstan/phpstan/issues/8966), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix wrong positives about templates in conditional types ([#&#8203;2241](https://github.com/phpstan/phpstan-src/pull/2241)), [#&#8203;8609](https://github.com/phpstan/phpstan/issues/8609), [#&#8203;7310](https://github.com/phpstan/phpstan/issues/7310), [#&#8203;8408](https://github.com/phpstan/phpstan/issues/8408), thanks [@&#8203;KmeCnin](https://github.com/KmeCnin)! ### [`v1.10.5`](https://github.com/phpstan/phpstan/releases/tag/1.10.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.4...1.10.5) # Improvements 🔧 - Check local type aliases above traits (https://github.com/phpstan/phpstan-src/commit/4654c1651f1ec9c1799774bffd2c641828d43d4a) # Bugfixes 🐛 - Fix type aliases in method-level template types (https://github.com/phpstan/phpstan-src/commit/c926144c2e1c1b25639857a3c1cb12bbe541162c), [#&#8203;9008](https://github.com/phpstan/phpstan/issues/9008) - Fix type aliases in traits (https://github.com/phpstan/phpstan-src/commit/60021c2857841155fcd54f3783d8ed86a647a684), [#&#8203;5091](https://github.com/phpstan/phpstan/issues/5091) - Fix interface accepting a Closure (https://github.com/phpstan/phpstan-src/commit/0dbe3ab24dd40d6e291413aa64db5eca9f0f6d68), [#&#8203;9006](https://github.com/phpstan/phpstan/issues/9006) - Process enum case expression (https://github.com/phpstan/phpstan-src/commit/f64b27cf833cbf84e21293f5891e69c970652698), [#&#8203;9005](https://github.com/phpstan/phpstan/issues/9005) - Fixed missing processing of UseUse and GroupUse (https://github.com/phpstan/phpstan-src/commit/b79751221e67794e62d7e7cfc89db5687c04c527) ### [`v1.10.4`](https://github.com/phpstan/phpstan/releases/tag/1.10.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.3...1.10.4) # Improvements 🔧 - Remove 3 leading spaces in PHAR ([#&#8203;2254](https://github.com/phpstan/phpstan-src/pull/2254)), [#&#8203;8952](https://github.com/phpstan/phpstan/issues/8952), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Add missing newline at the end of the file ([#&#8203;2254](https://github.com/phpstan/phpstan-src/pull/2254)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - RuleError interfaces are part of BC promise (https://github.com/phpstan/phpstan-src/commit/aed93193ae90d353661e10b0eabcf0528422231f) - Update nikic/php-parser (https://github.com/phpstan/phpstan-src/commit/dda95b4fa735585369cb74429ab5ea8d37f82179) - Update BetterReflection ([#&#8203;2274](https://github.com/phpstan/phpstan-src/pull/2274)), [#&#8203;8889](https://github.com/phpstan/phpstan/issues/8889) # Bugfixes 🐛 - Fix bug with `array_column` ([#&#8203;2244](https://github.com/phpstan/phpstan-src/pull/2244)), [#&#8203;8917](https://github.com/phpstan/phpstan/issues/8917), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve `filter_var()` handling of a couple of simple scalars and null ([#&#8203;2262](https://github.com/phpstan/phpstan-src/pull/2262)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `value-of` for multiple enums (https://github.com/phpstan/phpstan-src/commit/3adc91d78b8108afc883dc5097656b6de0f38769), [#&#8203;8983](https://github.com/phpstan/phpstan/issues/8983) - Fix `->value` on unions of enums (https://github.com/phpstan/phpstan-src/commit/05b85bad07a2c6628799fcb4a2939be7beab80cd), [#&#8203;9000](https://github.com/phpstan/phpstan/issues/9000) # Function signature fixes 🤖 - Fix return type of `Ds\Sequence::copy()` ([#&#8203;1954](https://github.com/phpstan/phpstan-src/pull/1954)), thanks [@&#8203;MidnightDesign](https://github.com/MidnightDesign)! - Fix `password_hash()` return type ([#&#8203;2260](https://github.com/phpstan/phpstan-src/pull/2260)), [#&#8203;5978](https://github.com/phpstan/phpstan/issues/5978), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.10.3`](https://github.com/phpstan/phpstan/releases/tag/1.10.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.2...1.10.3) # Improvements 🔧 - Add support for `@not-deprecated` annotation ([#&#8203;2255](https://github.com/phpstan/phpstan-src/pull/2255)), https://github.com/phpstan/phpstan/discussions/7422, thanks [@&#8203;stof](https://github.com/stof)! # Bugfixes 🐛 - Fix arithmetic operations with BenevolentUnionType (https://github.com/phpstan/phpstan-src/commit/f882eff78af3647b28a4663f467ae78346e89db3), [#&#8203;8938](https://github.com/phpstan/phpstan/issues/8938) - Fix native return type of `array_chunk()` (https://github.com/phpstan/phpstan-src/commit/e4a6d2026ef1218d2629e55991972058b80fef73), [#&#8203;8956](https://github.com/phpstan/phpstan/issues/8956) - Support for property fetch in initializers (https://github.com/phpstan/phpstan-src/commit/53c643de1366f185c9f21ff12908a7b1458b9ed0), [#&#8203;8957](https://github.com/phpstan/phpstan/issues/8957) - ObjectType - fix enum property with subtracted type (https://github.com/phpstan/phpstan-src/commit/eb00fd21ccc834c13624c32b6db0c1700ab32a8a), [#&#8203;8828](https://github.com/phpstan/phpstan/issues/8828), [#&#8203;8486](https://github.com/phpstan/phpstan/issues/8486) ### [`v1.10.2`](https://github.com/phpstan/phpstan/releases/tag/1.10.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.1...1.10.2) # Improvements 🔧 - Allow generating baseline in .php format (https://github.com/phpstan/phpstan-src/commit/8260032bc6b3641ec80a4b11526869b53d250ac6), [#&#8203;8870](https://github.com/phpstan/phpstan/issues/8870) - See documentation: https://phpstan.org/user-guide/baseline#php-baseline-format-instead-of-neon # Function signature fixes 🤖 - Instances of `object` returned by `db2_*()` functions are always instances of `stdClass` ([#&#8203;2249](https://github.com/phpstan/phpstan-src/pull/2249)), thanks [@&#8203;phansys](https://github.com/phansys)! ### [`v1.10.1`](https://github.com/phpstan/phpstan/releases/tag/1.10.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.10.0...1.10.1) # Bugfixes 🐛 - Fix match expression and `treatPhpDocTypesAsCertain: false` ([#&#8203;2248](https://github.com/phpstan/phpstan-src/pull/2248)), [#&#8203;8932](https://github.com/phpstan/phpstan/issues/8932), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix calling dynamic return type extensions on nullable types (https://github.com/phpstan/phpstan-src/commit/7331bc51411943dba14880434df6d7c85a744dcf) - Fix edge case with `in_array` and enums (https://github.com/phpstan/phpstan-src/commit/7d6f0f6a4c8eac67cfb2d810681043f9863f04a7) ### [`v1.10.0`](https://github.com/phpstan/phpstan/releases/tag/1.10.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.18...1.10.0) **Read the article about this release: [PHPStan 1.10 Comes With a Lie Detector](https://phpstan.org/blog/phpstan-1-10-comes-with-lie-detector)** # Major new features 🚀 - "Always true" conditions in the last `elseif` branch and last match expression arm are not reported by default ([#&#8203;2105](https://github.com/phpstan/phpstan-src/pull/2105)), [#&#8203;8042](https://github.com/phpstan/phpstan/issues/8042), [#&#8203;8485](https://github.com/phpstan/phpstan/issues/8485), [#&#8203;7721](https://github.com/phpstan/phpstan/issues/7721), [#&#8203;4242](https://github.com/phpstan/phpstan/issues/4242), [#&#8203;8240](https://github.com/phpstan/phpstan/issues/8240), thanks [@&#8203;staabm](https://github.com/staabm)! - Set [`reportAlwaysTrueInLastCondition`](https://phpstan.org/config-reference#reportalwaystrueinlastcondition) to `true` to have them reported again - Note: "Always true" conditions in PHPStan 1.x are reported with Bleeding Edge enabled, or with phpstan-strict-rules installed, or with [relevant options](https://github.com/phpstan/phpstan-strict-rules/blob/66b378f5b242130908b8a2222bf8110f14f4375a/rules.neon#L4-L7) enabled separately. In PHPStan 2.0 they're going to be always reported, except for the last `elseif` branch and last match expression arm. - Deprecate various `instanceof *Type` in favour of new methods on `Type` interface, (https://github.com/phpstan/phpstan-src/commit/436e6d3015cbeba4645d38bc7a6a865b9c6d7c74), learn more: [Why Is instanceof \*Type Wrong and Getting Deprecated?](https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated) - Deprecations in your custom rules and extensions will be reported in Bleeding Edge, or with `phpstan-deprecation-rules` installed - Explain why type isn't accepted by another type in less intuitive scenarios, [#&#8203;3281](https://github.com/phpstan/phpstan/issues/3281), [#&#8203;6787](https://github.com/phpstan/phpstan/issues/6787) - Some examples: https://phpstan.org/r/61cfbb65-1a04-471a-a5c5-d61f0540ae1d, https://phpstan.org/r/839f1fd2-d66a-4356-af21-3fe171d83fd1, https://phpstan.org/r/2bea7ece-6b26-4dc9-a1cf-d2f0e7fbb9d6, https://phpstan.org/r/fed1c275-46d0-434f-b9c4-3212f4df6d1c, https://phpstan.org/r/24a23b74-af27-4443-986c-04af61427d50 # Bleeding edge 🔪 - Validate inline PHPDoc `@var` tag type against native type (https://github.com/phpstan/phpstan-src/commit/a69e3bc2f1e87f6da1e65d7935f1cc36bd5c42fe) - Set [`reportWrongPhpDocTypeInVarTag`](https://phpstan.org/config-reference#reportwrongphpdoctypeinvartag) to `true` to have all types validated, not just native ones - Always report always true conditions, except for last elseif and match arm ([#&#8203;2105](https://github.com/phpstan/phpstan-src/pull/2105)), thanks [@&#8203;staabm](https://github.com/staabm)! - Disable "unreachable branches" rules: UnreachableIfBranchesRule, UnreachableTernaryElseBranchRule, unreachable arm error in MatchExpressionRule - Because "always true" is always reported, these are no longer needed - IncompatibleDefaultParameterTypeRule for closures (https://github.com/phpstan/phpstan-src/commit/0264f5bc48448c7e02a23b82eef4177d0617a82f) - New `RuleLevelHelper::accepts()` behaviour (https://github.com/phpstan/phpstan-src/commit/941fc815db49315b8783dc466cf593e0d8a85d23) - Check template type variance in `@param-out` (https://github.com/phpstan/phpstan-src/commit/7ceb19d3b42cf4632d10c2babb0fc5a21b6c8352), https://github.com/phpstan/phpstan/issues/8880#issuecomment-1426971473 *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Implement identical/equal comparisons on EnumCaseObjectType ([#&#8203;2105](https://github.com/phpstan/phpstan-src/pull/2105)), thanks [@&#8203;staabm](https://github.com/staabm)! - MatchExpressionRule - use ConstantConditionRuleHelper to remove some duplicate errors (https://github.com/phpstan/phpstan-src/commit/7380ed0e48fea16eab205996ab911f765548e0ff) - Improvements of `MutatingScope::getNativeType()` ([#&#8203;1943](https://github.com/phpstan/phpstan-src/pull/1943)), [#&#8203;4689](https://github.com/phpstan/phpstan/issues/4689), [#&#8203;7578](https://github.com/phpstan/phpstan/issues/7578), [#&#8203;6260](https://github.com/phpstan/phpstan/issues/6260) - Allow default values for allow-private-mutation properties ([#&#8203;2178](https://github.com/phpstan/phpstan-src/pull/2178)), [#&#8203;8701](https://github.com/phpstan/phpstan/issues/8701), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Support `treatPhpDocTypesAsCertain` in NumberComparisonOperatorsConstantConditionRule (https://github.com/phpstan/phpstan-src/commit/649eb70ba3c5a2321c5305522b46b49ba3dacc77), [#&#8203;6776](https://github.com/phpstan/phpstan/issues/6776), [#&#8203;7075](https://github.com/phpstan/phpstan/issues/7075) - JsonErrorFormatter - strip console-specific characters from tip (https://github.com/phpstan/phpstan-src/commit/6419da745ae460b481e8172e2b5191c898eab43d) - `InClassMethodNode` - add `getClassReflection()` (https://github.com/phpstan/phpstan-src/commit/c4ee0b8449df6bcd7e9c4500c7055657515253d8) - PhpFunctionFromParserNodeReflection and PhpMethodFromParserNodeReflection are part of BC promise (https://github.com/phpstan/phpstan-src/commit/810717968171bed5a7250ea09de03c5ef7f60ee9) - AttributesCheck - detect deprecated attributes (https://github.com/phpstan/phpstan-src/commit/e46b0b4aaf34a199f50b8dd589832b52e74baf85) - Introduce `Type::getTemplateType()` and deprecate `GenericTypeVariableResolver` (https://github.com/phpstan/phpstan-src/commit/b73a8aacc1636e1f512ad3850a7126c280b67036, https://github.com/phpstan/phpstan-src/commit/01b4d4e9b89a7f454c77a6f4d4d525ae8bf4ee53) - Implement PHP version dependent loose const comparison ([#&#8203;2220](https://github.com/phpstan/phpstan-src/pull/2220), [#&#8203;2225](https://github.com/phpstan/phpstan-src/pull/2225)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix LateResolvableTypeTrait (https://github.com/phpstan/phpstan-src/commit/bc2828669fbc93ca81a6b442c528fc56acbb79a1) - StrCaseFunctionsReturnTypeExtension - do not throw ShouldNotHappenException, it might happen if mbstring is not enabled and the polyfill is not implemented (https://github.com/phpstan/phpstan-src/commit/c015e47f40bdc72c19ce92457dd00d194f365da3), [#&#8203;8925](https://github.com/phpstan/phpstan/issues/8925) # Function signature fixes 🤖 - Fix `PDO::sqliteCreateFunction` ([#&#8203;2208](https://github.com/phpstan/phpstan-src/pull/2208)), [#&#8203;8802](https://github.com/phpstan/phpstan/issues/8802), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Use "numeric-string" type for some MySQLi functions ([#&#8203;2223](https://github.com/phpstan/phpstan-src/pull/2223), [#&#8203;2224](https://github.com/phpstan/phpstan-src/pull/2224)), thanks [@&#8203;phansys](https://github.com/phansys)! - Update param and return type for `db2_autocommit()` ([#&#8203;2239](https://github.com/phpstan/phpstan-src/pull/2239)), thanks [@&#8203;phansys](https://github.com/phansys)! # Internals 🔍 - Deprecate `TypeUtils::getDirectClassNames()` and `instanceof TypeWithClassName`, use `Type::getObjectClassNames()` instead ([#&#8203;1924](https://github.com/phpstan/phpstan-src/pull/1924)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Remove dead code in UnionType ([#&#8203;2194](https://github.com/phpstan/phpstan-src/pull/2194)), thanks [@&#8203;staabm](https://github.com/staabm)! - Use `isSuperTypeOf()` instead of `accepts()` in the right places (https://github.com/phpstan/phpstan-src/commit/ddb9dc5adc7a09dbe2f60d5cab60e5fd51a928fd) - Modernized `IncompatibleDefaultParameterTypeRule` (https://github.com/phpstan/phpstan-src/commit/a79ad038367ebd4c2722daaeaafd9aab24a421df) - InClassMethodNode always contains PhpMethodFromParserNodeReflection (https://github.com/phpstan/phpstan-src/commit/01a789713cd43ffd96c695dbcf85545459523c7e) - InFunctionNode always contains PhpFunctionFromParserNodeReflection (https://github.com/phpstan/phpstan-src/commit/e864b24a854ac053b10d9ec95d3c12802a4e326a) - Modernized InClassMethodNode rules (https://github.com/phpstan/phpstan-src/commit/c3da6a911a411652c27e905ee969980119a37d5d) - Modernized InFunctionNode rules (https://github.com/phpstan/phpstan-src/commit/b736ddcecdb6506e17ebf227654755a4ac5b82e5) - Introduce `Type::acceptsWithReason()` (https://github.com/phpstan/phpstan-src/commit/b763bd9631f7adfdf3feb8a111511b86a87389aa), [#&#8203;3281](https://github.com/phpstan/phpstan/issues/3281) - Fix invalid phpdocs missing null ([#&#8203;2213](https://github.com/phpstan/phpstan-src/pull/2213)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - NodeScopeResolver::earlyTerminatingMethodNames remove useless default ([#&#8203;2214](https://github.com/phpstan/phpstan-src/pull/2214)), [#&#8203;8830](https://github.com/phpstan/phpstan/issues/8830), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Skip `testEditorUrlWithRelativePath()` test on PhpStorm console ([#&#8203;2229](https://github.com/phpstan/phpstan-src/pull/2229)), thanks [@&#8203;staabm](https://github.com/staabm)! - VarianceCheck - accept only ParametersAcceptorWithPhpDocs (https://github.com/phpstan/phpstan-src/commit/7da13f7de02c06922a3550e7f037627f8bbc6a55) - Remove duplicate method definition from ConstantType interface (https://github.com/phpstan/phpstan-src/commit/61fa3a14e22355a013e9d240d55c0d9a5f6609a6) - `Type::isEnum()` (https://github.com/phpstan/phpstan-src/commit/93113cbca608a0c03073e322d58cd3d82597163f) - `Type::getObjectClassReflections()` (https://github.com/phpstan/phpstan-src/commit/4c7046ef681d05e81f5ad866230582a0009272b9) ### [`v1.9.18`](https://github.com/phpstan/phpstan/releases/tag/1.9.18) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.17...1.9.18) # Improvements 🔧 - ErrorsConsoleStyle - do not wrap URLs (https://github.com/phpstan/phpstan-src/commit/f843feed8b0211713ec60bda1b08f9407e0fa0b7) - List shapes ([#&#8203;2202](https://github.com/phpstan/phpstan-src/pull/2202)), [#&#8203;8789](https://github.com/phpstan/phpstan/issues/8789), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Bugfixes 🐛 - IterableType - fix getReferencedTemplateTypes (https://github.com/phpstan/phpstan-src/commit/07e32cdbe49f660891d558b243beed9121ef4679, https://github.com/phpstan/phpstan-src/commit/cf2107dd5cb03c38df9d3e16e96ec3e09ddfe2ec), [#&#8203;8880](https://github.com/phpstan/phpstan/issues/8880) - Revert "Fixed '$this instanceof X will always be false' in traits" (https://github.com/phpstan/phpstan-src/commit/1f608dc6a560f4a5accc854add8e005da0e7ceea), [#&#8203;8879](https://github.com/phpstan/phpstan/issues/8879), [#&#8203;8888](https://github.com/phpstan/phpstan/issues/8888) # Internals 🔍 - Remove unneded code in `ConstantArrayType::hasOffsetValueType()` ([#&#8203;2238](https://github.com/phpstan/phpstan-src/pull/2238)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.17`](https://github.com/phpstan/phpstan/releases/tag/1.9.17) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.16...1.9.17) # Bugfixes 🐛 - Fix one more false positive about unused private property (https://github.com/phpstan/phpstan-src/commit/6d61d3dd33342fe2b09a57ca17e9fc90b33f92d2), [#&#8203;8850](https://github.com/phpstan/phpstan/issues/8850) - Update phpdoc-parser to 1.16.1 - Fix `list{}` parsing (https://github.com/phpstan/phpdoc-parser/pull/177), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Fix intersection of two identical `ThisType` (https://github.com/phpstan/phpstan-src/commit/d3e3292d73ee32862b4b1321740c80d319a683ad), [#&#8203;8857](https://github.com/phpstan/phpstan/issues/8857) ### [`v1.9.16`](https://github.com/phpstan/phpstan/releases/tag/1.9.16) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.15...1.9.16) - Fix false positive about unused class elements when the class uses a trait (https://github.com/phpstan/phpstan-src/commit/fbdf0da9b7075ce4d4933d6289dcfd89266556f0) ### [`v1.9.15`](https://github.com/phpstan/phpstan/releases/tag/1.9.15) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.14...1.9.15) # Improvements 🔧 - `ignoreErrors` entries for same message and path are summed together (https://github.com/phpstan/phpstan-src/commit/fa70062df084110dfc3fc9ce9be867dc143eb482) - Make PHP 8 deprecation "required params following optional ones" ignorable ([#&#8203;2218](https://github.com/phpstan/phpstan-src/pull/2218)), thanks [@&#8203;Wirone](https://github.com/Wirone)! # Bugfixes 🐛 - Templates in DatePeriod can be covariant (https://github.com/phpstan/phpstan-src/commit/ce65e053730ac70160b4a041e72496baa20c3c31), [#&#8203;8772](https://github.com/phpstan/phpstan/issues/8772) - Prevent crash for Attribute class polyfill without constructor (https://github.com/phpstan/phpstan-src/commit/9334ff395d56fb36d9c32092c67d602a2ac4b2df), [#&#8203;8769](https://github.com/phpstan/phpstan/issues/8769) - Fix big constant arrays not recognized as oversized ([#&#8203;2199](https://github.com/phpstan/phpstan-src/pull/2199)), [#&#8203;8775](https://github.com/phpstan/phpstan/issues/8775), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `filter_var()` with float input and FILTER_VALIDATE_INT ([#&#8203;2206](https://github.com/phpstan/phpstan-src/pull/2206)), [#&#8203;8797](https://github.com/phpstan/phpstan/issues/8797), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fixed `method_exists()` on `class-string&literal-string` ([#&#8203;2193](https://github.com/phpstan/phpstan-src/pull/2193)), [#&#8203;8752](https://github.com/phpstan/phpstan/issues/8752), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix various `filter_var()` range edge cases ([#&#8203;2207](https://github.com/phpstan/phpstan-src/pull/2207)), [#&#8203;8776](https://github.com/phpstan/phpstan/issues/8776), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fixed `$this instanceof X will always be false` in traits ([#&#8203;2045](https://github.com/phpstan/phpstan-src/pull/2045)), [#&#8203;3632](https://github.com/phpstan/phpstan/issues/3632), thanks [@&#8203;staabm](https://github.com/staabm)! - Update PhpStorm stubs ([#&#8203;2226](https://github.com/phpstan/phpstan-src/pull/2226)), [#&#8203;8713](https://github.com/phpstan/phpstan/issues/8713) # Function signature fixes 🤖 - Adjust `forward_static_call_array` for named arguments on PHP 8 (https://github.com/phpstan/phpstan-src/commit/fb5c1119b779ab66ae841c9b110246a147c2ab69), https://github.com/phpstan/phpstan/discussions/8761 # Internals 🔍 - Extract `FilterFunctionReturnTypeHelper` ([#&#8203;2190](https://github.com/phpstan/phpstan-src/pull/2190)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Simplify default type handling in `FilterFunctionReturnTypeHelper` ([#&#8203;2198](https://github.com/phpstan/phpstan-src/pull/2198)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Remove `$otherTypes` in `FilterFunctionReturnTypeHelper` ([#&#8203;2205](https://github.com/phpstan/phpstan-src/pull/2205)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.14`](https://github.com/phpstan/phpstan/releases/tag/1.9.14) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.13...1.9.14) # Bugfixes 🐛 - Fix `filter_var()` narrowing with unknown options ([#&#8203;2146](https://github.com/phpstan/phpstan-src/pull/2146)), [#&#8203;8516](https://github.com/phpstan/phpstan/issues/8516), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix types after `ctype_digit()` with cast parameter ([#&#8203;2189](https://github.com/phpstan/phpstan-src/pull/2189)), [#&#8203;8736](https://github.com/phpstan/phpstan/issues/8736), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Adapt `Redis::connect()` signature to upstream changes ([#&#8203;2187](https://github.com/phpstan/phpstan-src/pull/2187), [#&#8203;2188](https://github.com/phpstan/phpstan-src/pull/2188)), [#&#8203;8733](https://github.com/phpstan/phpstan/issues/8733), thanks [@&#8203;greg0ire](https://github.com/greg0ire)! # Internals 🔍 - PHPStan's Homebrew formula gets updated automatically on release (https://github.com/phpstan/phpstan/commit/598f17ee70fd4c5199e2da912597ef67e4abbf32), [#&#8203;8738](https://github.com/phpstan/phpstan/issues/8738) ### [`v1.9.13`](https://github.com/phpstan/phpstan/releases/tag/1.9.13) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.12...1.9.13) # Bugfixes 🐛 - ctype_digit - support type narrowing with cast parameters ([#&#8203;2186](https://github.com/phpstan/phpstan-src/pull/2186)), [#&#8203;8714](https://github.com/phpstan/phpstan/issues/8714), thanks [@&#8203;staabm](https://github.com/staabm)! - PHP 8.2: Non-final classes without `#[AllowDynamicProperties]` might still have dynamic properties (https://github.com/phpstan/phpstan-src/commit/051b06ea5b36ce2f6131d07fbfcb4b065bd83ef5), [#&#8203;8727](https://github.com/phpstan/phpstan/issues/8727), [#&#8203;8474](https://github.com/phpstan/phpstan/issues/8474) ### [`v1.9.12`](https://github.com/phpstan/phpstan/releases/tag/1.9.12) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.11...1.9.12) # Improvements 🔧 - Enums do not allow dynamic properties (https://github.com/phpstan/phpstan-src/commit/0aa7f41fde2c6f3b825b3cc41e6ad4c2b16587a3) - Support integer ranges in `pow()` ([#&#8203;1904](https://github.com/phpstan/phpstan-src/pull/1904)), [#&#8203;5614](https://github.com/phpstan/phpstan/issues/5614), thanks [@&#8203;staabm](https://github.com/staabm)! - Revert for performance reasons: Improve expression type resolving of superglobals (https://github.com/phpstan/phpstan-src/commit/02e1a14b4ca631c80b3eec6696b7483a5534bff7), ([#&#8203;2012](https://github.com/phpstan/phpstan-src/pull/2012)) - Update PhpStorm stubs ([#&#8203;2185](https://github.com/phpstan/phpstan-src/pull/2185)) - Update `nikic/php-parser` (https://github.com/phpstan/phpstan-src/commit/e2956f04edb47a5662adf9c4ef50b5ef3132fbe6) - Improve `array_key_exists` type-specifying extension ([#&#8203;1941](https://github.com/phpstan/phpstan-src/pull/1941)), [#&#8203;2970](https://github.com/phpstan/phpstan/issues/2970), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Internals 🔍 - Fix bash escaping: Replacing "output" with ENV "INPUT_LOG" ([#&#8203;2180](https://github.com/phpstan/phpstan-src/pull/2180)), thanks [@&#8203;rez1dent3](https://github.com/rez1dent3)! ### [`v1.9.11`](https://github.com/phpstan/phpstan/releases/tag/1.9.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.10...1.9.11) # Bugfixes 🐛 - It is not FileExcluder job to exclude stub files (https://github.com/phpstan/phpstan-src/commit/7bdfdd4c40dc64128c9abf8119a5bd3c563963b7) - Bugfix for PHPStan 1.9.10 - Add missing `@phpstan-` prefixed tags ([#&#8203;2177](https://github.com/phpstan/phpstan-src/pull/2177)), [#&#8203;8697](https://github.com/phpstan/phpstan/issues/8697), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.9.10`](https://github.com/phpstan/phpstan/releases/tag/1.9.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.9...1.9.10) - Only analysis FileExcluder excludes stub files (https://github.com/phpstan/phpstan-src/commit/8ef5163f906fb7e263a0e4dab7d32ed796853572) - This will allow us to use [ReflectionProvider](https://phpstan.org/developing-extensions/reflection) in [StubFilesExtension](https://apiref.phpstan.org/1.10.x/PHPStan.PhpDoc.StubFilesExtension.html) - Thanks to this change, this issue will be fixed: https://github.com/phpstan/phpstan-doctrine/issues/413 ### [`v1.9.9`](https://github.com/phpstan/phpstan/releases/tag/1.9.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.8...1.9.9) # Improvements 🔧 - New method `Type::getEnumCases()` to use instead of `instanceof EnumCaseObjectType` (https://github.com/phpstan/phpstan-src/commit/a0242e0f7234b4e78a59ddc6ea79342cd1e03c0f) # Bugfixes 🐛 - Last `elseif` can be exhaustive and no `else` branch is needed (https://github.com/phpstan/phpstan-src/commit/94e6e466f44a0dbbcb6182b32628d97a80109305), [#&#8203;7547](https://github.com/phpstan/phpstan/issues/7547) - Fix resolving of `__CLASS__`, `__NAMESPACE__` in traits ([#&#8203;2043](https://github.com/phpstan/phpstan-src/pull/2043)), [#&#8203;3019](https://github.com/phpstan/phpstan/issues/3019), thanks [@&#8203;staabm](https://github.com/staabm)! - `class_implements` dynamic return type extension ([#&#8203;2023](https://github.com/phpstan/phpstan-src/pull/2023)), [#&#8203;4335](https://github.com/phpstan/phpstan/issues/4335), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Function signature fixes 🤖 - `ReflectionClass::newInstanceArgs()` type fix for named arguments ([#&#8203;2176](https://github.com/phpstan/phpstan-src/pull/2176)), [#&#8203;8679](https://github.com/phpstan/phpstan/issues/8679), thanks [@&#8203;s3b4stian](https://github.com/s3b4stian)! # Internals 🔍 - Exit early in `TrinaryLogic::lazyAnd()` and `lazyOr()` if current instance allows it ([#&#8203;2173](https://github.com/phpstan/phpstan-src/pull/2173)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Remove unused iterable check in `MissingTypehintCheck` ([#&#8203;2174](https://github.com/phpstan/phpstan-src/pull/2174)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.8`](https://github.com/phpstan/phpstan/releases/tag/1.9.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.7...1.9.8) # Improvements 🔧 - Improve constant string support in DateTime return type extensions ([#&#8203;2152](https://github.com/phpstan/phpstan-src/pull/2152)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve expression type resolving of superglobals ([#&#8203;2012](https://github.com/phpstan/phpstan-src/pull/2012)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve integer range multiplication and division ([#&#8203;1961](https://github.com/phpstan/phpstan-src/pull/1961)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Bugfixes 🐛 - ObjectType static cache should be reset after container creation (https://github.com/phpstan/phpstan-src/commit/b13ce59ac33952c086b0effa986691a8fcd6166e), https://github.com/phpstan/phpstan/discussions/8502 - Supports functions whose side effects are flipped by parameters ([#&#8203;2037](https://github.com/phpstan/phpstan-src/pull/2037)), [#&#8203;8440](https://github.com/phpstan/phpstan/issues/8440), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - `array_shift` et al. have side effects (https://github.com/phpstan/phpstan-src/commit/6276ce1c3e86e18d43989310dbd277e8ea9845f6), [#&#8203;8084](https://github.com/phpstan/phpstan/issues/8084) - Fix comparison with `get_class()` in traits always evaluate to true ([#&#8203;2044](https://github.com/phpstan/phpstan-src/pull/2044)), [#&#8203;3633](https://github.com/phpstan/phpstan/issues/3633), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.9.7`](https://github.com/phpstan/phpstan/releases/tag/1.9.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.6...1.9.7) # Bleeding edge 🔪 - Empty `skipCheckGenericClasses` (https://github.com/phpstan/phpstan-src/commit/28c2c79b16cac6ba6b01f1b4d211541dd49d8a77) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - `UnionType::pickTypes` overriden in `BenevolentUnionType` for a more benevolent behaviour (https://github.com/phpstan/phpstan-src/commit/480626ecb52d2e98cc28cee8a18dfb86112b7f8f) # Bugfixes 🐛 - Fixed incorrect while loop logic (https://github.com/phpstan/phpstan-src/commit/091fcafb07ac0b3eb261285c049d9c0f214a535c), [#&#8203;8643](https://github.com/phpstan/phpstan/issues/8643) - Fixed scenario with zero analysed files (https://github.com/phpstan/phpstan-src/commit/6debffdb5892f7fb311a60634ec9cda79b6e3154) # Function signature fixes 🤖 - `min()` and `max()` do not return `false` on PHP 8 ([#&#8203;2161](https://github.com/phpstan/phpstan-src/pull/2161)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix a few MongoDB definitions ([#&#8203;2140](https://github.com/phpstan/phpstan-src/pull/2140)), thanks [@&#8203;UCIS](https://github.com/UCIS)! # Internals 🔍 - Added missing namespaces in tests ([#&#8203;2156](https://github.com/phpstan/phpstan-src/pull/2156)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.9.6`](https://github.com/phpstan/phpstan/releases/tag/1.9.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.5...1.9.6) # Improvements 🔧 - Show combined memory usage in parallel mode ([#&#8203;2027](https://github.com/phpstan/phpstan-src/pull/2027)), [#&#8203;4683](https://github.com/phpstan/phpstan/issues/4683), thanks [@&#8203;janedbal](https://github.com/janedbal)! # Bugfixes 🐛 - One-part encapsed string is correctly converted to string (https://github.com/phpstan/phpstan-src/commit/dc77608ee9ab22e352cd3df60ce2bc2d8d135abc), [#&#8203;8635](https://github.com/phpstan/phpstan/issues/8635) - Conditional expressions - do not take conclusions about identical variable in assignment (https://github.com/phpstan/phpstan-src/commit/cde53d19e9b4edf81f4c469b7f2a2c3634004d86), [#&#8203;8625](https://github.com/phpstan/phpstan/issues/8625), [#&#8203;8621](https://github.com/phpstan/phpstan/issues/8621) ### [`v1.9.5`](https://github.com/phpstan/phpstan/releases/tag/1.9.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.4...1.9.5) # Improvements 🔧 - Improve constant string union handling for concat and encapsed string ([#&#8203;2057](https://github.com/phpstan/phpstan-src/pull/2057)), thanks [@&#8203;schlndh](https://github.com/schlndh)! - PhpVersion: supportsDisjunctiveNormalForm ([#&#8203;2130](https://github.com/phpstan/phpstan-src/pull/2130)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Constant scalar types might accept general type from the same family ([#&#8203;2131](https://github.com/phpstan/phpstan-src/pull/2131)) - this moves some errors from earlier levels to level 7 - Implement OversizedArrayBuilder to improve huge constant array performance ([#&#8203;2116](https://github.com/phpstan/phpstan-src/pull/2116)), [#&#8203;8215](https://github.com/phpstan/phpstan/issues/8215), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve performance again by dumbing down nested arrays ([#&#8203;2077](https://github.com/phpstan/phpstan-src/pull/2077)) - Result cache should not be invalidated by changes to editorUrl, editorUrlTitle and errorFormat parameters ([#&#8203;2136](https://github.com/phpstan/phpstan-src/pull/2136)), thanks [@&#8203;bendavies](https://github.com/bendavies)! - Faster `MutatingScope::shouldInvalidateExpression()` ([#&#8203;2139](https://github.com/phpstan/phpstan-src/pull/2139)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `ReturnStatementsNode::hasNativeReturnTypehint()` ([#&#8203;2141](https://github.com/phpstan/phpstan-src/pull/2141)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - TypeNodeResolver - `lowercase-string` and `non-empty-lowercase-string` are known (https://github.com/phpstan/phpstan-src/commit/884ceb015c68e8c40a066732b4bc873bed568d38) # Bugfixes 🐛 - OversizedArrayType contains at least 1 element ([#&#8203;2126](https://github.com/phpstan/phpstan-src/pull/2126)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `pathinfo($s, PATHINFO_ALL)` return type ([#&#8203;2014](https://github.com/phpstan/phpstan-src/pull/2014)), thanks [@&#8203;staabm](https://github.com/staabm)! - Bump fidry/cpu-core-counter version ([#&#8203;2133](https://github.com/phpstan/phpstan-src/pull/2133)), thanks [@&#8203;czukowski](https://github.com/czukowski)! - Fix `MixedType::hasOffsetValueType()` for subtracted types ([#&#8203;2135](https://github.com/phpstan/phpstan-src/pull/2135)), [#&#8203;6705](https://github.com/phpstan/phpstan/issues/6705), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix dumbed down arrays ([#&#8203;2137](https://github.com/phpstan/phpstan-src/pull/2137)), [#&#8203;8004](https://github.com/phpstan/phpstan/issues/8004) - Return type of `parent::__set_state()` method is only object ([#&#8203;2138](https://github.com/phpstan/phpstan-src/pull/2138)), thanks [@&#8203;blankse](https://github.com/blankse)! - Fix fatal error when autoloader opens directories ([#&#8203;2154](https://github.com/phpstan/phpstan-src/pull/2154)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix returntype for DateInterval::createFromDateString ([#&#8203;2038](https://github.com/phpstan/phpstan-src/pull/2038)), thanks [@&#8203;verfriemelt-dot-org](https://github.com/verfriemelt-dot-org)! - Fix hasSideEffects for AnnotationMethodReflection ([#&#8203;2155](https://github.com/phpstan/phpstan-src/pull/2155)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix constant-string handling in union-types ([#&#8203;2134](https://github.com/phpstan/phpstan-src/pull/2134)), [#&#8203;8568](https://github.com/phpstan/phpstan/issues/8568), [#&#8203;8562](https://github.com/phpstan/phpstan/issues/8562), thanks [@&#8203;staabm](https://github.com/staabm)! - IntersectionType - check if it's an oversized array and return benevolent union in getOffsetValueType (https://github.com/phpstan/phpstan-src/commit/80b5cdd3ecf173f0aaa7354d28537167905aec7c) # Internals 🔍 - Use isArray, isConstantArray instead of instanceof in TypeCombinartor::union ([#&#8203;2118](https://github.com/phpstan/phpstan-src/pull/2118)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix typo ([#&#8203;2127](https://github.com/phpstan/phpstan-src/pull/2127)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - AnalyserIntegrationTest - run with bleedingEdge (https://github.com/phpstan/phpstan-src/commit/db2de6f17469e9bc0d078e09c895d64a39fe14ca) - Refactor options handling in `FilterVarDynamicReturnTypeExtension` ([#&#8203;2120](https://github.com/phpstan/phpstan-src/pull/2120)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::isScalar()` ([#&#8203;2149](https://github.com/phpstan/phpstan-src/pull/2149)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Removed unused fileName in FetchedNode ([#&#8203;2150](https://github.com/phpstan/phpstan-src/pull/2150)), thanks [@&#8203;staabm](https://github.com/staabm)! - Removed unused NodeList class ([#&#8203;2151](https://github.com/phpstan/phpstan-src/pull/2151)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add namespace to bug-8573.php / fix `GenericsIntegrationTest` ([#&#8203;2147](https://github.com/phpstan/phpstan-src/pull/2147)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.4`](https://github.com/phpstan/phpstan/releases/tag/1.9.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.3...1.9.4) # Improvements 🔧 - Various performance optimizations from [@&#8203;staabm](https://github.com/staabm) ([#&#8203;2098](https://github.com/phpstan/phpstan-src/pull/2098), [#&#8203;2099](https://github.com/phpstan/phpstan-src/pull/2099), [#&#8203;2100](https://github.com/phpstan/phpstan-src/pull/2100), [#&#8203;2101](https://github.com/phpstan/phpstan-src/pull/2101), [#&#8203;2103](https://github.com/phpstan/phpstan-src/pull/2103), [#&#8203;2104](https://github.com/phpstan/phpstan-src/pull/2104)) - Resolve parameter types only when `checkArgumentTypes=true` ([#&#8203;2106](https://github.com/phpstan/phpstan-src/pull/2106)), thanks [@&#8203;staabm](https://github.com/staabm)! - Keep NeverType isExplicit flag in `TypeCombinator::intersect()` ([#&#8203;2112](https://github.com/phpstan/phpstan-src/pull/2112)), thanks [@&#8203;staabm](https://github.com/staabm)! - Keep NeverType isExplicit flag in `InitializerExprTypeResolver` ([#&#8203;2114](https://github.com/phpstan/phpstan-src/pull/2114)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `TypeCombinator::removeFalsey()` ([#&#8203;2003](https://github.com/phpstan/phpstan-src/pull/2003)), thanks [@&#8203;axlon](https://github.com/axlon)! - Option `usePathConstantsAsConstantString` ([#&#8203;2050](https://github.com/phpstan/phpstan-src/pull/2050)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! # Bugfixes 🐛 - Fix native type on `unset` ([#&#8203;2107](https://github.com/phpstan/phpstan-src/pull/2107)), [#&#8203;7805](https://github.com/phpstan/phpstan/issues/7805), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix return type of `array_search()` with constant array type haystack ([#&#8203;1806](https://github.com/phpstan/phpstan-src/pull/1806)), [#&#8203;3789](https://github.com/phpstan/phpstan/issues/3789), thanks [@&#8203;takaram](https://github.com/takaram)! - `parse_str()` might return nested arrays by-ref ([#&#8203;1994](https://github.com/phpstan/phpstan-src/pull/1994)), [#&#8203;8356](https://github.com/phpstan/phpstan/issues/8356), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix regression in `for` loop (https://github.com/phpstan/phpstan-src/commit/a8975b1800d6c5cb88a6af02e132b4e44e093fc3), [#&#8203;8520](https://github.com/phpstan/phpstan/issues/8520) - Fix readonly properties bugs and infinite recursion (https://github.com/phpstan/phpstan-src/commit/a7fed03bbf1bef545c8afcbf6c906ac93b34c876), [#&#8203;8543](https://github.com/phpstan/phpstan/issues/8543) - Fix internal error for dynamic properties defined on interface on PHP 8.2 (https://github.com/phpstan/phpstan-src/commit/4025209062e31619077197006ce44b5d60a9f2c1), [#&#8203;8537](https://github.com/phpstan/phpstan/issues/8537) # Internals 🔍 - Implement `getConstantStrings()` on Type ([#&#8203;1979](https://github.com/phpstan/phpstan-src/pull/1979)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix node PHPDoc type hints ([#&#8203;2053](https://github.com/phpstan/phpstan-src/pull/2053)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Refactor FilterVarDynamicReturnTypeExtension to pass around Types instead of Args and the Scope ([#&#8203;2109](https://github.com/phpstan/phpstan-src/pull/2109)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.3`](https://github.com/phpstan/phpstan/releases/tag/1.9.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.2...1.9.3) # Bleeding edge 🔪 - Fix invariance composition ([#&#8203;2054](https://github.com/phpstan/phpstan-src/pull/2054)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - TypeInferenceTestCase - do not allow files with no asserts ([#&#8203;1992](https://github.com/phpstan/phpstan-src/pull/1992)), [#&#8203;8346](https://github.com/phpstan/phpstan/issues/8346), [#&#8203;8094](https://github.com/phpstan/phpstan/issues/8094), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `DateTimeZone::__construct` throw type extension ([#&#8203;2034](https://github.com/phpstan/phpstan-src/pull/2034)) - TableErrorFormatter: allow editor url title configuration ([#&#8203;2035](https://github.com/phpstan/phpstan-src/pull/2035)), [#&#8203;7796](https://github.com/phpstan/phpstan/issues/7796), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Various generics variance fixes ([#&#8203;2051](https://github.com/phpstan/phpstan-src/pull/2051), [#&#8203;2064](https://github.com/phpstan/phpstan-src/pull/2064)), [#&#8203;3960](https://github.com/phpstan/phpstan/issues/3960), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Add `deprecationRulesInstalled` configuration ([#&#8203;2062](https://github.com/phpstan/phpstan-src/pull/2062)), thanks [@&#8203;villfa](https://github.com/villfa)! - To be used in phpstan-deprecation-rules and phpstan-phpunit extensions soon! - ArrayFilterRule should care about `treatPhpDocTypesAsCertain` ([#&#8203;2065](https://github.com/phpstan/phpstan-src/pull/2065)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Discover phpunit-bridge automatically (https://github.com/phpstan/phpstan-src/commit/c760b1f7a45c512cd34c91d8e078046dfdc453ba) - Performance optimizations: - Cache descriptions in ObjectType and UnionType (https://github.com/phpstan/phpstan-src/commit/da8413c493cbb9d800228f996836207e9598920c), [#&#8203;8499](https://github.com/phpstan/phpstan/issues/8499), [#&#8203;8497](https://github.com/phpstan/phpstan/issues/8497) - Remove unnecessary file IO ([#&#8203;2069](https://github.com/phpstan/phpstan-src/pull/2069), [#&#8203;2094](https://github.com/phpstan/phpstan-src/pull/2094)), thanks [@&#8203;staabm](https://github.com/staabm)! - Reduce calls to `Scope::getType()`. Cheap checks first. ([#&#8203;2071](https://github.com/phpstan/phpstan-src/pull/2071)), thanks [@&#8203;staabm](https://github.com/staabm)! - Cache resolved phpdoc in ClassReflection ([#&#8203;2072](https://github.com/phpstan/phpstan-src/pull/2072)), thanks [@&#8203;staabm](https://github.com/staabm)! - Don't re-calculate node-key over and over again ([#&#8203;2073](https://github.com/phpstan/phpstan-src/pull/2073)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve the CPU core count detection ([#&#8203;2047](https://github.com/phpstan/phpstan-src/pull/2047)), thanks [@&#8203;theofidry](https://github.com/theofidry)! - Optimize path related utils on windows ([#&#8203;2068](https://github.com/phpstan/phpstan-src/pull/2068)), thanks [@&#8203;staabm](https://github.com/staabm)! - Don't re-calculate node-key over and over again - part 2 ([#&#8203;2074](https://github.com/phpstan/phpstan-src/pull/2074)), [#&#8203;8503](https://github.com/phpstan/phpstan/issues/8503), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster ConstantStringType->toArrayKey() ([#&#8203;2081](https://github.com/phpstan/phpstan-src/pull/2081)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster ConstantFloatType->isSuperTypeOf(ConstantFloatType) ([#&#8203;2080](https://github.com/phpstan/phpstan-src/pull/2080)), thanks [@&#8203;staabm](https://github.com/staabm)! - TypeSpecifier micro-optimization (https://github.com/phpstan/phpstan-src/commit/30e6d19496adb16b6bfd9be1cd1bf767f6ce8713) - Faster TrinaryLogic->lazyExtremeIdentity() ([#&#8203;2083](https://github.com/phpstan/phpstan-src/pull/2083)), thanks [@&#8203;staabm](https://github.com/staabm)! - Faster ConstantArrayType->isSuperTypeOf() ([#&#8203;2086](https://github.com/phpstan/phpstan-src/pull/2086)), thanks [@&#8203;staabm](https://github.com/staabm)! - Loops analysed in linear time instead of exponential time ([#&#8203;2088](https://github.com/phpstan/phpstan-src/pull/2088), [#&#8203;2091](https://github.com/phpstan/phpstan-src/pull/2091)), [#&#8203;8503](https://github.com/phpstan/phpstan/issues/8503), [#&#8203;6265](https://github.com/phpstan/phpstan/issues/6265) - Remove unnecessary method call to already known value ([#&#8203;2092](https://github.com/phpstan/phpstan-src/pull/2092)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Improve conditionalExpressionTypes ([#&#8203;1950](https://github.com/phpstan/phpstan-src/pull/1950)), [#&#8203;3677](https://github.com/phpstan/phpstan/issues/3677), [#&#8203;5623](https://github.com/phpstan/phpstan/issues/5623), [#&#8203;5401](https://github.com/phpstan/phpstan/issues/5401), [#&#8203;7292](https://github.com/phpstan/phpstan/issues/7292), [#&#8203;8212](https://github.com/phpstan/phpstan/issues/8212), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix conditional variable types in global scope ([#&#8203;1995](https://github.com/phpstan/phpstan-src/pull/1995)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Do not invalidate related expressions in ensureNonNullability ([#&#8203;2004](https://github.com/phpstan/phpstan-src/pull/2004)), [#&#8203;8361](https://github.com/phpstan/phpstan/issues/8361), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Improve create conditional expressions to handle all expressions ([#&#8203;2007](https://github.com/phpstan/phpstan-src/pull/2007)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Improve conditional type resolving performance ([#&#8203;2030](https://github.com/phpstan/phpstan-src/pull/2030)), [#&#8203;8397](https://github.com/phpstan/phpstan/issues/8397), [#&#8203;5805](https://github.com/phpstan/phpstan/issues/5805), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix false positive of access to static private property of parent class ([#&#8203;1989](https://github.com/phpstan/phpstan-src/pull/1989)), [#&#8203;8333](https://github.com/phpstan/phpstan/issues/8333), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix intersecting array shapes with different optional keys ([#&#8203;2002](https://github.com/phpstan/phpstan-src/pull/2002)), [#&#8203;8373](https://github.com/phpstan/phpstan/issues/8373), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support PHPDoc asserts on variadic parameters ([#&#8203;2009](https://github.com/phpstan/phpstan-src/pull/2009)), [#&#8203;8389](https://github.com/phpstan/phpstan/issues/8389), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix `@param-out` on methods ([#&#8203;2028](https://github.com/phpstan/phpstan-src/pull/2028)), [#&#8203;8421](https://github.com/phpstan/phpstan/issues/8421), thanks [@&#8203;staabm](https://github.com/staabm)! - Do not set native type to `mixed` on annotation assignment ([#&#8203;2017](https://github.com/phpstan/phpstan-src/pull/2017)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Consistently pass `$nativeExpressionTypes` in MutatingScope ([#&#8203;2021](https://github.com/phpstan/phpstan-src/pull/2021)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix infinite loop when fully qualified callback is supplied ([#&#8203;2005](https://github.com/phpstan/phpstan-src/pull/2005)), [#&#8203;8376](https://github.com/phpstan/phpstan/issues/8376), thanks [@&#8203;cs278](https://github.com/cs278)! - Non-static method DOMDocument::loadHTML() can be called statically ([#&#8203;2042](https://github.com/phpstan/phpstan-src/pull/2042)), [#&#8203;2759](https://github.com/phpstan/phpstan/issues/2759), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix FuzzyRelativePathHelper for directories ending in `.php` (https://github.com/phpstan/phpstan-src/commit/bff85e27cd486b7ea5c065575a71de66b83b1cf2), [#&#8203;8480](https://github.com/phpstan/phpstan/issues/8480) # Function signature fixes 🤖 - ImagickPixel::getColor() normalized param accepts int instead of bool ([#&#8203;2020](https://github.com/phpstan/phpstan-src/pull/2020)), thanks [@&#8203;blankse](https://github.com/blankse)! - Declare more PDOStatement method types ([#&#8203;2096](https://github.com/phpstan/phpstan-src/pull/2096)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Fix non-working type assertions in `NodeScopeResolverTest` cases ([#&#8203;1992](https://github.com/phpstan/phpstan-src/pull/1992)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use ExpressionTypeHolders for conditional expression type ([#&#8203;1998](https://github.com/phpstan/phpstan-src/pull/1998)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Simplify array collections in `UnionTypeHelper` ([#&#8203;1988](https://github.com/phpstan/phpstan-src/pull/1988)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Avoid specifying scalar types and delete string casts ([#&#8203;1999](https://github.com/phpstan/phpstan-src/pull/1999)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Add filename and line of the error of assertVariableCertainty ([#&#8203;2008](https://github.com/phpstan/phpstan-src/pull/2008)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - README: how to composer install ([#&#8203;2025](https://github.com/phpstan/phpstan-src/pull/2025)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Group `$expressionTypes` and `$nativeExpressionTypes` in Scope creation methods ([#&#8203;2022](https://github.com/phpstan/phpstan-src/pull/2022)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use ExpressionTypeHolder when comparing conditionals ([#&#8203;2048](https://github.com/phpstan/phpstan-src/pull/2048)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - UnionType - carry information that it's normalized (https://github.com/phpstan/phpstan-src/commit/96e4443d94501012042cf6bd9f8d6b34af7fcfb6) - VerbosityLevel offers `getLevelValue()` (https://github.com/phpstan/phpstan-src/commit/4f7e20b6ffae103ac3de52e5da1ef77dbc0ba485) - Get rid of `TypeTraverser` in `ArrayChunkFunctionReturnTypeExtension` ([#&#8203;2082](https://github.com/phpstan/phpstan-src/pull/2082)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Get rid of `TypeTraverser` in `ArraySliceFunctionReturnTypeExtension` ([#&#8203;2085](https://github.com/phpstan/phpstan-src/pull/2085)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Get rid of `TypeTraverser` in `ArrayReverseFunctionReturnTypeExtension` ([#&#8203;2084](https://github.com/phpstan/phpstan-src/pull/2084)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Get rid of `TypeTraverser` in `StrSplitFunctionReturnTypeExtension` ([#&#8203;2087](https://github.com/phpstan/phpstan-src/pull/2087)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.2`](https://github.com/phpstan/phpstan/releases/tag/1.9.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.1...1.9.2) # Bugfixes 🐛 - Fix array and iterable type action methods on `NeverType` ([#&#8203;1968](https://github.com/phpstan/phpstan-src/pull/1968)), [#&#8203;8277](https://github.com/phpstan/phpstan/issues/8277), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Support 'HasMethodType' on StaticCall ([#&#8203;1969](https://github.com/phpstan/phpstan-src/pull/1969)), [#&#8203;1267](https://github.com/phpstan/phpstan/issues/1267), thanks [@&#8203;staabm](https://github.com/staabm)! - Addition operation on MixedType without ArrayType cannot result in ArrayType ([#&#8203;1949](https://github.com/phpstan/phpstan-src/pull/1949)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove DateInterval stub ([#&#8203;1974](https://github.com/phpstan/phpstan-src/pull/1974)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix invalidate static expressions in closures ([#&#8203;1983](https://github.com/phpstan/phpstan-src/pull/1983)), [#&#8203;8292](https://github.com/phpstan/phpstan/issues/8292), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix false positive of access to private property of parent class ([#&#8203;1953](https://github.com/phpstan/phpstan-src/pull/1953)), [#&#8203;2435](https://github.com/phpstan/phpstan/issues/2435), thanks [@&#8203;tyabu12](https://github.com/tyabu12)! - Fix unset on nested array ([#&#8203;1987](https://github.com/phpstan/phpstan-src/pull/1987)), [#&#8203;8113](https://github.com/phpstan/phpstan/issues/8113), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - Update DateTimeZone::listAbbreviations signature ([#&#8203;1962](https://github.com/phpstan/phpstan-src/pull/1962)), thanks [@&#8203;franmomu](https://github.com/franmomu)! - Making `json_encode()` always produce a `non-empty-string`, when successful ([#&#8203;1980](https://github.com/phpstan/phpstan-src/pull/1980)), thanks [@&#8203;Slamdunk](https://github.com/Slamdunk)! - `sodium_crypto_generichash*` always produce a `non-empty-string` ([#&#8203;1981](https://github.com/phpstan/phpstan-src/pull/1981)), thanks [@&#8203;Slamdunk](https://github.com/Slamdunk)! - `sodium_crypto_sign*` always produce `non-empty-string` ([#&#8203;1985](https://github.com/phpstan/phpstan-src/pull/1985)), thanks [@&#8203;Slamdunk](https://github.com/Slamdunk)! # Internals 🔍 - Implement isClassStringType() on Type ([#&#8203;1970](https://github.com/phpstan/phpstan-src/pull/1970)), [#&#8203;6147](https://github.com/phpstan/phpstan/issues/6147), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement isInteger() on Type ([#&#8203;1971](https://github.com/phpstan/phpstan-src/pull/1971)), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement isBoolean() on Type ([#&#8203;1973](https://github.com/phpstan/phpstan-src/pull/1973)), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement isFloat() on Type ([#&#8203;1977](https://github.com/phpstan/phpstan-src/pull/1977)), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement isNull() on Type ([#&#8203;1978](https://github.com/phpstan/phpstan-src/pull/1978)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `Type::isVoid()` ([#&#8203;1982](https://github.com/phpstan/phpstan-src/pull/1982)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.9.1`](https://github.com/phpstan/phpstan/releases/tag/1.9.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.9.0...1.9.1) # Improvements 🔧 - `AccessoryArrayListType` is part of BC promise ([#&#8203;1967](https://github.com/phpstan/phpstan-src/pull/1967)), thanks [@&#8203;enumag](https://github.com/enumag)! - Specify types from true/false asserts ([#&#8203;1957](https://github.com/phpstan/phpstan-src/pull/1957)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support conditional types in phpdoc asserts ([#&#8203;1964](https://github.com/phpstan/phpstan-src/pull/1964)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Let casting `object` to `string` result in an error ([#&#8203;1948](https://github.com/phpstan/phpstan-src/pull/1948)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Add more support for `checkBenevolentUnionTypes` config ([#&#8203;1940](https://github.com/phpstan/phpstan-src/pull/1940)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Error on unknown parameter name in parameter conditional type ([#&#8203;1966](https://github.com/phpstan/phpstan-src/pull/1966)), [#&#8203;8284](https://github.com/phpstan/phpstan/issues/8284), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Bugfixes 🐛 - List type cast to array is still a list ([#&#8203;1958](https://github.com/phpstan/phpstan-src/pull/1958), [#&#8203;1959](https://github.com/phpstan/phpstan-src/pull/1959)), [#&#8203;8280](https://github.com/phpstan/phpstan/issues/8280), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix `mt_rand` return type ([#&#8203;1956](https://github.com/phpstan/phpstan-src/pull/1956)), [#&#8203;8272](https://github.com/phpstan/phpstan/issues/8272), thanks [@&#8203;enumag](https://github.com/enumag)! - `strtr` returns `non-empty-string` ([#&#8203;1963](https://github.com/phpstan/phpstan-src/pull/1963)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.9.0`](https://github.com/phpstan/phpstan/releases/tag/1.9.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.11...1.9.0) [**Check out the article about this release!**](https://phpstan.org/blog/phpstan-1-9-0-with-phpdoc-asserts-list-type.html) # Major new features 🚀 - **PHPDoc-based type narrowing** with `@phpstan-assert`, `@phpstan-assert-if-true`, `@phpstan-assert-if-false` ([#&#8203;1317](https://github.com/phpstan/phpstan-src/pull/1317)), [#&#8203;7110](https://github.com/phpstan/phpstan/issues/7110), [#&#8203;8186](https://github.com/phpstan/phpstan/issues/8186), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - [Documentation](https://phpstan.org/writing-php-code/narrowing-types#custom-type-checking-functions-and-methods) - `@phpstan-self-out`/`@phpstan-this-out` support ([#&#8203;1799](https://github.com/phpstan/phpstan-src/pull/1799)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Can be used to change the type of the current object after calling a method on it. This is useful for generic mutable objects. - [Documentation](https://phpstan.org/writing-php-code/phpdocs-basics#change-type-of-current-object-after-calling-a-method) - `@param-out` support ([#&#8203;1804](https://github.com/phpstan/phpstan-src/pull/1804)), [#&#8203;7231](https://github.com/phpstan/phpstan/issues/7231), [#&#8203;6871](https://github.com/phpstan/phpstan/issues/6871), [#&#8203;6186](https://github.com/phpstan/phpstan/issues/6186), [#&#8203;4372](https://github.com/phpstan/phpstan/issues/4372), [#&#8203;5785](https://github.com/phpstan/phpstan/issues/5785), thanks [@&#8203;staabm](https://github.com/staabm)! - Can be used to specify type of function argument passed by reference - [Documentation](https://phpstan.org/writing-php-code/phpdocs-basics#setting-parameter-type-passed-by-reference) - Add extensible `ClassReflection::getAllowedSubTypes()` ([#&#8203;1477](https://github.com/phpstan/phpstan-src/pull/1477)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - [Documentation](https://phpstan.org/developing-extensions/allowed-subtypes) - Add config parameter `checkBenevolentUnionTypes` to strictly check BenevolentUnionType ([#&#8203;1930](https://github.com/phpstan/phpstan-src/pull/1930)), [#&#8203;8223](https://github.com/phpstan/phpstan/issues/8223), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - [Documentation](https://phpstan.org/config-reference#checkbenevolentuniontypes) # Bleeding edge 🔪 - **Array `list` type** ([#&#8203;1751](https://github.com/phpstan/phpstan-src/pull/1751)), [#&#8203;3311](https://github.com/phpstan/phpstan/issues/3311), [#&#8203;8185](https://github.com/phpstan/phpstan/issues/8185), [#&#8203;6243](https://github.com/phpstan/phpstan/issues/6243), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Lists are arrays with sequential integer keys starting at 0 - Improve error wording of the NonexistentOffset, BooleanAndConstantConditionRule, and BooleanOrConstantConditionRule ([#&#8203;1882](https://github.com/phpstan/phpstan-src/pull/1882)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - MissingMagicSerializationMethodsRule ([#&#8203;1711](https://github.com/phpstan/phpstan-src/pull/1711)), [#&#8203;7482](https://github.com/phpstan/phpstan/issues/7482), thanks [@&#8203;staabm](https://github.com/staabm)! - Unescape strings in phpdoc-parser (https://github.com/phpstan/phpstan-src/commit/97786ed8376b478ec541ea9df1c450c1fbfe7461) - Stub files validation - detect duplicate classes and functions (https://github.com/phpstan/phpstan-src/commit/ddf8d5c3859c2c75c20f525a0e2ca8b99032373a, https://github.com/phpstan/phpstan-src/commit/17e4b74335e5235d7cd6708eb687a774a0eeead4) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Add `non-negative-int` and `non-positive-int` ([#&#8203;1803](https://github.com/phpstan/phpstan-src/pull/1803)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Optimize `NonexistentOffsetInArrayDimFetchCheck` ([#&#8203;1801](https://github.com/phpstan/phpstan-src/pull/1801)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Modify the built-in `@method` extension to look at `@throws` in \__call ([#&#8203;1842](https://github.com/phpstan/phpstan-src/pull/1842)), [#&#8203;8163](https://github.com/phpstan/phpstan/issues/8163), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Improve impossible type checker for void-returning functions ([#&#8203;1857](https://github.com/phpstan/phpstan-src/pull/1857)), [#&#8203;8169](https://github.com/phpstan/phpstan/issues/8169), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Allow using `$this`/`static` in conditional return types ([#&#8203;1863](https://github.com/phpstan/phpstan-src/pull/1863)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Emit warnings when Xdebug is not used according to CLI flags ([#&#8203;1878](https://github.com/phpstan/phpstan-src/pull/1878)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve array_fill return type extension ([#&#8203;1879](https://github.com/phpstan/phpstan-src/pull/1879)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Add support for `mb_convert_case()` and `mb_convert_kana()` ([#&#8203;1866](https://github.com/phpstan/phpstan-src/pull/1866)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Accept and describe `callable-object` and `callable-string` ([#&#8203;1906](https://github.com/phpstan/phpstan-src/pull/1906)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Add colon as prefix of line number in table report, when running in VSCode terminal ([#&#8203;1901](https://github.com/phpstan/phpstan-src/pull/1901)), [#&#8203;8086](https://github.com/phpstan/phpstan/issues/8086), thanks [@&#8203;LeoVie](https://github.com/LeoVie)! - Cover ExtendedMethodReflection by BC promise (but not implementing it, only calling the methods) ([#&#8203;1913](https://github.com/phpstan/phpstan-src/pull/1913)), thanks [@&#8203;staabm](https://github.com/staabm)! - Locate identifiers by type for OptimizedSingleFileSourceLocator ([#&#8203;1114](https://github.com/phpstan/phpstan-src/pull/1114)), thanks [@&#8203;tomasfejfar](https://github.com/tomasfejfar)! - Implement `FunctionReflection`/`ExtendedMethodReflection::returnsByReference()` ([#&#8203;1899](https://github.com/phpstan/phpstan-src/pull/1899)), [#&#8203;6005](https://github.com/phpstan/phpstan/issues/6005), thanks [@&#8203;staabm](https://github.com/staabm)! - Add noreturn as PseudoTypeClass ([#&#8203;1937](https://github.com/phpstan/phpstan-src/pull/1937)), [#&#8203;8242](https://github.com/phpstan/phpstan/issues/8242), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Introduce new simple ScopeFactory (https://github.com/phpstan/phpstan-src/commit/1cc337acc877bc02f1a6686fbfe38994a987fbc5) - `MutatingScope::enterNamespace()` is part of BC promise (https://github.com/phpstan/phpstan-src/commit/92732ca8de9d479762337bbc25c629f20d096e0c) # Bugfixes 🐛 - Preserve non-empty-array type when generalizing arrays ([#&#8203;1752](https://github.com/phpstan/phpstan-src/pull/1752)), [#&#8203;7996](https://github.com/phpstan/phpstan/issues/7996), thanks [@&#8203;herndlm](https://github.com/herndlm)! - There's no valid use-case to implement `Scope` or `FunctionReflection` in userland class (https://github.com/phpstan/phpstan-src/commit/2796f8dd8fd5156abd8f19f4ecab2be14248782c) - `no-named-arguments` implies variadic argument is a `list` ([#&#8203;1796](https://github.com/phpstan/phpstan-src/pull/1796)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix list checking on level 7 vs. level 8 (https://github.com/phpstan/phpstan-src/commit/926058491578747d2f99ec6b02ad28c988f3c28d), [#&#8203;8071](https://github.com/phpstan/phpstan/issues/8071) - MixedType: support subtracted in array-type methods ([#&#8203;1852](https://github.com/phpstan/phpstan-src/pull/1852)), [#&#8203;3370](https://github.com/phpstan/phpstan/issues/3370), thanks [@&#8203;staabm](https://github.com/staabm)! - Allow compare SimpleXMLElement to number ([#&#8203;1755](https://github.com/phpstan/phpstan-src/pull/1755)), [#&#8203;1795](https://github.com/phpstan/phpstan/issues/1795), thanks [@&#8203;muno92](https://github.com/muno92)! - Fix min max call on array of union types ([#&#8203;1795](https://github.com/phpstan/phpstan-src/pull/1795)), [#&#8203;8088](https://github.com/phpstan/phpstan/issues/8088), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Support `Countable` in `count()` ([#&#8203;1876](https://github.com/phpstan/phpstan-src/pull/1876)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `RuleLevelHelper::accepts()` for constant arrays ([#&#8203;1911](https://github.com/phpstan/phpstan-src/pull/1911)), [#&#8203;8209](https://github.com/phpstan/phpstan/issues/8209), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix closure return type based on by-ref use ([#&#8203;1914](https://github.com/phpstan/phpstan-src/pull/1914)), [#&#8203;6806](https://github.com/phpstan/phpstan/issues/6806), [#&#8203;4739](https://github.com/phpstan/phpstan/issues/4739), [#&#8203;5753](https://github.com/phpstan/phpstan/issues/5753), [#&#8203;6559](https://github.com/phpstan/phpstan/issues/6559), [#&#8203;6902](https://github.com/phpstan/phpstan/issues/6902), [#&#8203;7220](https://github.com/phpstan/phpstan/issues/7220), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Consider `get_object_var()` as private property read ([#&#8203;1902](https://github.com/phpstan/phpstan-src/pull/1902)), [#&#8203;3654](https://github.com/phpstan/phpstan/issues/3654), thanks [@&#8203;vovochka404](https://github.com/vovochka404)! - Temporary solution to handle "maybe" certainty types assign in nativeExpressionTypes ([#&#8203;1932](https://github.com/phpstan/phpstan-src/pull/1932)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Refactor arrow function scope logic to make it consistent with anonymous functions ([#&#8203;1935](https://github.com/phpstan/phpstan-src/pull/1935)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix static bleedingEdge toggles in tests ([#&#8203;1928](https://github.com/phpstan/phpstan-src/pull/1928)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve unset on ConstantArrayType ([#&#8203;1927](https://github.com/phpstan/phpstan-src/pull/1927)), [#&#8203;8225](https://github.com/phpstan/phpstan/issues/8225), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix stale result cache for `@param-out` (https://github.com/phpstan/phpstan-src/commit/cf40007c004d7d24e286b8663a3d0e0ed8f3fbb7) - Fix stale result cache for arrow functions (https://github.com/phpstan/phpstan-src/commit/29690576ea459e24b3eab1d2987628c7d166ce09) - Fix closure return type for different same-code array_map arguments in same scope ([#&#8203;1915](https://github.com/phpstan/phpstan-src/pull/1915)), [#&#8203;8179](https://github.com/phpstan/phpstan/issues/8179), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - `$this` in nativeExpressionTypes ([#&#8203;1936](https://github.com/phpstan/phpstan-src/pull/1936)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Handle ClassConstFetch in Scope ([#&#8203;1944](https://github.com/phpstan/phpstan-src/pull/1944)), [#&#8203;7913](https://github.com/phpstan/phpstan/issues/7913), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Retain non-variable expression types in closure ([#&#8203;1929](https://github.com/phpstan/phpstan-src/pull/1929)), [#&#8203;8205](https://github.com/phpstan/phpstan/issues/8205), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix stale result cache for asserts (https://github.com/phpstan/phpstan-src/commit/471265fc62f30504f4a0aecf79585bef42e69213) - Fix stale result cache for `@phpstan-self-out` ([#&#8203;1949](https://github.com/phpstan/phpstan-src/pull/1949)), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Fix class_implements return type ([#&#8203;1797](https://github.com/phpstan/phpstan-src/pull/1797)), thanks [@&#8203;enumag](https://github.com/enumag)! - `mb_check_encoding()` accepts `array<string>` in PHP 7.2+ ([#&#8203;1867](https://github.com/phpstan/phpstan-src/pull/1867)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! # Internals 🔍 - Introduce ArrayType traits ([#&#8203;1715](https://github.com/phpstan/phpstan-src/pull/1715)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Introduce `Type::getConstantArrays` as successor for `TypeUtils::getOldConstantArrays` ([#&#8203;1684](https://github.com/phpstan/phpstan-src/pull/1684)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Deprecate `TypeUtils::getArrays()` and `TypeUtils::getAnyArrays()` ([#&#8203;1687](https://github.com/phpstan/phpstan-src/pull/1687)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::getLastIterableValueType()` ([#&#8203;1811](https://github.com/phpstan/phpstan-src/pull/1811)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::getFirstIterableValueType()` ([#&#8203;1811](https://github.com/phpstan/phpstan-src/pull/1811)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::getFirstIterableKeyType()` and `Type::getLastIterableKeyType()` ([#&#8203;1812](https://github.com/phpstan/phpstan-src/pull/1812)), [#&#8203;8152](https://github.com/phpstan/phpstan/issues/8152), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Preparation for native types ([#&#8203;1823](https://github.com/phpstan/phpstan-src/pull/1823)), [#&#8203;5333](https://github.com/phpstan/phpstan/issues/5333), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Move iterable methods from array to iterable traits ([#&#8203;1821](https://github.com/phpstan/phpstan-src/pull/1821)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Do not use other traits in `JustNullableTypeTrait` ([#&#8203;1821](https://github.com/phpstan/phpstan-src/pull/1821)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::isConstantArray()` ([#&#8203;1822](https://github.com/phpstan/phpstan-src/pull/1822)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Replace single `getConstantArrays()` usage with `isConstantArray()` ([#&#8203;1827](https://github.com/phpstan/phpstan-src/pull/1827)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::getArraySize()` ([#&#8203;1828](https://github.com/phpstan/phpstan-src/pull/1828)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::flipArray()` ([#&#8203;1832](https://github.com/phpstan/phpstan-src/pull/1832)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::getKeysArray()` and `Type::getValuesArray()` ([#&#8203;1851](https://github.com/phpstan/phpstan-src/pull/1851)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Implement `FunctionReflection::getDocComment()` ([#&#8203;1834](https://github.com/phpstan/phpstan-src/pull/1834)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add `Type::popArray()` and `Type::shiftArray()` ([#&#8203;1847](https://github.com/phpstan/phpstan-src/pull/1847)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::shuffleArray()` ([#&#8203;1853](https://github.com/phpstan/phpstan-src/pull/1853)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Deprecate `ConstantArrayType::generalizeToArray()` ([#&#8203;1856](https://github.com/phpstan/phpstan-src/pull/1856)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Explicitly specify native type for `array_pop`/`array_shift` arg ([#&#8203;1864](https://github.com/phpstan/phpstan-src/pull/1864)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Replace `ArrayType::castToArrayKey()` with `Type::toArrayKey()` ([#&#8203;1841](https://github.com/phpstan/phpstan-src/pull/1841)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - remove IsFloatFunctionTypeSpecifyingExtension ([#&#8203;1880](https://github.com/phpstan/phpstan-src/pull/1880)), thanks [@&#8203;staabm](https://github.com/staabm)! - remove IsNumericFunctionTypeSpecifyingExtension ([#&#8203;1880](https://github.com/phpstan/phpstan-src/pull/1880)), thanks [@&#8203;staabm](https://github.com/staabm)! - Remove is_bool, is_countable and is_null type specifying extensions ([#&#8203;1881](https://github.com/phpstan/phpstan-src/pull/1881)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Add `Type::fillKeysArray()` ([#&#8203;1869](https://github.com/phpstan/phpstan-src/pull/1869)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Consistently return `ErrorType` for invalid keys ([#&#8203;1869](https://github.com/phpstan/phpstan-src/pull/1869)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Replace `is_(int,object,resource,scalar)` extensions with stubs ([#&#8203;1884](https://github.com/phpstan/phpstan-src/pull/1884)), thanks [@&#8203;BackEndTea](https://github.com/BackEndTea)! - Refactor `pow()` return type extension to re-use `BinaryOp\Pow` type inference ([#&#8203;1900](https://github.com/phpstan/phpstan-src/pull/1900)), thanks [@&#8203;staabm](https://github.com/staabm)! - Get rid of of `Type::getArrays()` usage in `InvalidKeyInArrayDimFetchRule` ([#&#8203;1872](https://github.com/phpstan/phpstan-src/pull/1872)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add `Type::searchArray()` ([#&#8203;1874](https://github.com/phpstan/phpstan-src/pull/1874)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - MutatingScope: change `variableTypes` to save by `exprString` ([#&#8203;1909](https://github.com/phpstan/phpstan-src/pull/1909)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - MutatingScope: merge `variableTypes` and `moreSpecificTypes` ([#&#8203;1919](https://github.com/phpstan/phpstan-src/pull/1919)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Upgrade deprecated `::set-*` in GitHub Actions ([#&#8203;1917](https://github.com/phpstan/phpstan-src/pull/1917)), thanks [@&#8203;rez1dent3](https://github.com/rez1dent3)! - Improve non-array specification for recently cleaned-up array functions ([#&#8203;1907](https://github.com/phpstan/phpstan-src/pull/1907)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Retain sort order in intersection type ([#&#8203;1906](https://github.com/phpstan/phpstan-src/pull/1906)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Add `Type::intersectKeyArray()` ([#&#8203;1916](https://github.com/phpstan/phpstan-src/pull/1916)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Changelog generator - allow excluding branch (https://github.com/phpstan/phpstan-src/commit/aaf4b7df4493d44e7ca21e2b52daa2ec2c7c5033) - MutatingScope refactoring and regression test ([#&#8203;1934](https://github.com/phpstan/phpstan-src/pull/1934)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Refactor to save nativeTypeExpressions by ExpressionTypeHolder ([#&#8203;1936](https://github.com/phpstan/phpstan-src/pull/1936)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Merge constantTypes with expressionTypes ([#&#8203;1938](https://github.com/phpstan/phpstan-src/pull/1938)), thanks [@&#8203;rajyan](https://github.com/rajyan)! ### [`v1.8.11`](https://github.com/phpstan/phpstan/releases/tag/1.8.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.10...1.8.11) # Improvements 🔧 - MatchExpressionArmBody virtual node ([#&#8203;1726](https://github.com/phpstan/phpstan-src/pull/1726)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Detect duplicate included files in ContainerFactory (https://github.com/phpstan/phpstan-src/commit/f15cd6deea2dda4b41272aa50fb3b61304ad3515, https://github.com/phpstan/phpstan-src/commit/4cdb8060b73fc09e25cf230041532f068974234d) - ClassPropertyNode - carry PHPDoc type (https://github.com/phpstan/phpstan-src/commit/dcd8bac24fdbe0723b9307f3f3b2e8e38cc7eae1) # Bugfixes 🐛 - Fix several stale result cache issues: - Fix stale `@mixin` result cache issue (https://github.com/phpstan/phpstan-src/commit/7228d4d5c6ba0289bd67a0b0bd113a6aafed5faa), [#&#8203;7831](https://github.com/phpstan/phpstan/issues/7831) - Include `@template` tags in the result cache (https://github.com/phpstan/phpstan-src/commit/4c0cb98c84f7c4dfe62e21f6b163529a150861fe) - Reanalyse all files with errors when new symbol appears (https://github.com/phpstan/phpstan-src/commit/bc9301d983c03cc5716ee2e00c32713c80e4b53e) - DependencyResolver - add method/property declaring classes to dependencies (https://github.com/phpstan/phpstan-src/commit/e1c13669492079f065fd8138680fc91c96c3729a) - DependencyResolver - declaring classes for static fetches (https://github.com/phpstan/phpstan-src/commit/be6e7ced22b578d67e58f63b9649ad2ef2c35911) - DependencyResolver - `@method`, `@property`, `@extends`, `@implements` tags (https://github.com/phpstan/phpstan-src/commit/ec5b6331e910e18bec1abfa4a1db8961509c7591) - Fix result cache getting stale because of trait `@use` (https://github.com/phpstan/phpstan-src/commit/08703d1dacf47cc26a33542d0589bf7912c2aeb4) - Fix stale result cache for property types (https://github.com/phpstan/phpstan-src/commit/9e4e93b48cc32298c0a1661f14891307a22def7b) - Fix wrong type inference about array ([#&#8203;1808](https://github.com/phpstan/phpstan-src/pull/1808)), [#&#8203;8087](https://github.com/phpstan/phpstan/issues/8087), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Invalidate DI container based on included files hashes (https://github.com/phpstan/phpstan-src/commit/615c6a1d6216a0d4b357c67657ba340c88a98a3b) - Virtual expr nodes - do not reuse wrong attributes, a printed expr might be cached there (https://github.com/phpstan/phpstan-src/commit/83691977757661e4160c89a533cdaf589434d782) - Fix reordering unspecified named arguments ([#&#8203;1903](https://github.com/phpstan/phpstan-src/pull/1903)), [#&#8203;8204](https://github.com/phpstan/phpstan/issues/8204), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! ### [`v1.8.10`](https://github.com/phpstan/phpstan/releases/tag/1.8.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.9...1.8.10) # Improvements 🔧 - RuleTestCase: enable gathering analyser errors without causing test failures ([#&#8203;1728](https://github.com/phpstan/phpstan-src/pull/1728)), thanks [@&#8203;schlndh](https://github.com/schlndh)! # Bugfixes 🐛 - Update BetterReflection to 6.3.0, fixes internal error (https://github.com/phpstan/phpstan-src/commit/9febf1db4b4e3a4f3462fdd6ffa67b22a420f05a), [#&#8203;8139](https://github.com/phpstan/phpstan/issues/8139) - Call nodeCallback with original argument with a name after reordering (https://github.com/phpstan/phpstan-src/commit/ecc3076769a7943e33801d024eeab0b08187c204) # Function signature fixes 🤖 - Fix a couple `CURLOPT_*` parameter types ([#&#8203;1836](https://github.com/phpstan/phpstan-src/pull/1836)), [#&#8203;8152](https://github.com/phpstan/phpstan/issues/8152), [#&#8203;8157](https://github.com/phpstan/phpstan/issues/8157), thanks [@&#8203;jlherren](https://github.com/jlherren)! ### [`v1.8.9`](https://github.com/phpstan/phpstan/releases/tag/1.8.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.8...1.8.9) # Improvements 🔧 - Slightly optimize `TypeCombinator::reduceArrays()` even more ([#&#8203;1814](https://github.com/phpstan/phpstan-src/pull/1814)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Micro optimizations in TypeCombinator ([#&#8203;1816](https://github.com/phpstan/phpstan-src/pull/1816)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Improve `array_search()` type specifier performance ([#&#8203;1818](https://github.com/phpstan/phpstan-src/pull/1818)), [#&#8203;8147](https://github.com/phpstan/phpstan/issues/8147), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Rule registry now gets rules instances in lazy manner (https://github.com/phpstan/phpstan-src/commit/b1b0dc921894da1f24721702262e64399a39c626) - Show progress bar sooner (https://github.com/phpstan/phpstan-src/commit/8e55decc78ab9da6ffe4cc62045c752794ed2d7a) # Bugfixes 🐛 - Make `key_exists` be treated like `array_key_exists` ([#&#8203;1800](https://github.com/phpstan/phpstan-src/pull/1800)), [#&#8203;8091](https://github.com/phpstan/phpstan/issues/8091), thanks [@&#8203;takaram](https://github.com/takaram)! - Fix resolving class types in inherited docblock ([#&#8203;1815](https://github.com/phpstan/phpstan-src/pull/1815)), [#&#8203;7839](https://github.com/phpstan/phpstan/issues/7839), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix passing named arguments to by-ref parameter ([#&#8203;1807](https://github.com/phpstan/phpstan-src/pull/1807)), [#&#8203;8142](https://github.com/phpstan/phpstan/issues/8142), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - IncompatiblePropertyPhpDocTypeRule - fix inconsistency for stubbed PHPDocs (https://github.com/phpstan/phpstan-src/commit/32b3c67729267a1f7a4dcae590e7ce9013eabfee) - non-empty-string can still contain falsy strings as individual characters (https://github.com/phpstan/phpstan-src/commit/76bd347d2281f311ed5aa4a5c8a6632f2f136eff), [#&#8203;8158](https://github.com/phpstan/phpstan/issues/8158) # Function signature fixes 🤖 - Fix `SoapFault` constructor datatype ([#&#8203;1798](https://github.com/phpstan/phpstan-src/pull/1798)), thanks [@&#8203;ahmedash95](https://github.com/ahmedash95)! - fix `IntlDateFormatter::create` return signature ([#&#8203;1776](https://github.com/phpstan/phpstan-src/pull/1776)), thanks [@&#8203;Kleinast](https://github.com/Kleinast)! - Allow string args in signature of `RedisCluster::del` ([#&#8203;1829](https://github.com/phpstan/phpstan-src/pull/1829)), thanks [@&#8203;ostrolucky](https://github.com/ostrolucky)! - Refined `fpm_get_status` function signature ([#&#8203;1771](https://github.com/phpstan/phpstan-src/pull/1771)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Refined `connection_status` function signature ([#&#8203;1774](https://github.com/phpstan/phpstan-src/pull/1774)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - `headers_list()` returns a list of headers as strings. ([#&#8203;1770](https://github.com/phpstan/phpstan-src/pull/1770)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! ### [`v1.8.8`](https://github.com/phpstan/phpstan/releases/tag/1.8.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.7...1.8.8) # Improvements 🔧 - Cover `ExprPrinter` by BC promise ([#&#8203;1794](https://github.com/phpstan/phpstan-src/pull/1794)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve `isset` specification in falsy scope ([#&#8203;1781](https://github.com/phpstan/phpstan-src/pull/1781)), thanks [@&#8203;herndlm](https://github.com/herndlm)!s - Update `phpstan/phpdoc-parser` to 1.9.0 (https://github.com/phpstan/phpstan-src/commit/fd94186ee2a8065c94edb4603dd954584e9e8f45) # Bugfixes 🐛 - Do not drop original specified expression in TypeSpecifier ([#&#8203;1793](https://github.com/phpstan/phpstan-src/pull/1793)), [#&#8203;8076](https://github.com/phpstan/phpstan/issues/8076), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Preserve accessory types in `MutatingScope::generalizeType` ([#&#8203;1732](https://github.com/phpstan/phpstan-src/pull/1732)), [#&#8203;8015](https://github.com/phpstan/phpstan/issues/8015), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Specify types on `get_parent_class()` ([#&#8203;1383](https://github.com/phpstan/phpstan-src/pull/1383)), [#&#8203;5552](https://github.com/phpstan/phpstan/issues/5552), thanks [@&#8203;staabm](https://github.com/staabm)! - Do not load `Composer\InstalledVersions` to parse PHPStan version (https://github.com/phpstan/phpstan-src/commit/acbb55baeeb2f02b0ea2e61b4321e4f5dd5f65b2), [#&#8203;8117](https://github.com/phpstan/phpstan/issues/8117) # Function signature fixes 🤖 - Fix `zadd` argument order ([#&#8203;1779](https://github.com/phpstan/phpstan-src/pull/1779)), thanks [@&#8203;araab](https://github.com/araab)! - Fix `zscan` return types ([#&#8203;1780](https://github.com/phpstan/phpstan-src/pull/1780)), thanks [@&#8203;araab](https://github.com/araab)! - `XMLWriter::startElementNS()` `$namespace` arg is nullable ([#&#8203;1772](https://github.com/phpstan/phpstan-src/pull/1772)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.8.7`](https://github.com/phpstan/phpstan/releases/tag/1.8.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.6...1.8.7) # Improvements 🔧 - Update Roave/BetterReflection to v6 (https://github.com/Roave/BetterReflection/releases/tag/6.0.0) - PHP 8.2: Support for readonly classes, [RFC](https://wiki.php.net/rfc/readonly_classes) (https://github.com/phpstan/phpstan-src/commit/c52eb5792c6e9b7c2d060cafa256b19997552a15) - PHP 8.2: Support for DNF types, ([RFC](https://wiki.php.net/rfc/dnf_types)) - Improve `TypeCombinator::reduceArrays()` performance with retained type completeness ([#&#8203;1741](https://github.com/phpstan/phpstan-src/pull/1741)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve unsetting constant offsets on array ([#&#8203;1760](https://github.com/phpstan/phpstan-src/pull/1760)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - `@readonly` property allows private mutation ([#&#8203;1610](https://github.com/phpstan/phpstan-src/pull/1610)), [#&#8203;7778](https://github.com/phpstan/phpstan/issues/7778), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Readonly properties cannot be static (https://github.com/phpstan/phpstan-src/commit/3e383fc9620a46173651402049a8e8c4904591b6) - Do not call CollectedDataNode rules if internal errors are present (https://github.com/phpstan/phpstan-src/commit/877835002a2daa758a82a8e0d5502881e7e25aa3) - Universal object crate classes now respect `@property` annotations ([#&#8203;1786](https://github.com/phpstan/phpstan-src/pull/1786)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Add `tip` message to JSON error formatter ([#&#8203;1727](https://github.com/phpstan/phpstan-src/pull/1727)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix supertype checks between int range and constant int union ([#&#8203;1742](https://github.com/phpstan/phpstan-src/pull/1742)), [#&#8203;3383](https://github.com/phpstan/phpstan/issues/3383), [#&#8203;6356](https://github.com/phpstan/phpstan/issues/6356), [#&#8203;7594](https://github.com/phpstan/phpstan/issues/7594), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix resolving docblocks in global namespace (using `namespace {}`) ([#&#8203;1758](https://github.com/phpstan/phpstan-src/pull/1758)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix `ignoreErrors` ([#&#8203;1769](https://github.com/phpstan/phpstan-src/pull/1769)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - `ignoreErrors`: fix `reportUnmatched` without `path`/`paths` ([#&#8203;1773](https://github.com/phpstan/phpstan-src/pull/1773)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - Fix potential assert failures - use `getRawArgs()` instead (https://github.com/phpstan/phpstan-src/commit/6cd3d5d61db965f2d4d59e2e860201b9afb1d8fc), [#&#8203;8078](https://github.com/phpstan/phpstan/issues/8078) - Fix ArrowFunctionArgVisitor (https://github.com/phpstan/phpstan-src/commit/3758d9d5d5a8c792149238de289ab0e05f11de0e), [#&#8203;8072](https://github.com/phpstan/phpstan/issues/8072) - Fix ClosureArgVisitor (https://github.com/phpstan/phpstan-src/commit/e753dfd4a4d7f67192cd83e7117f39ebdd6e3ceb) - Fix circular parent class reference thanks to BetterReflection v6 (https://github.com/phpstan/phpstan-src/commit/8f6392f4521d1d4109e2a79598e820b7ce367a67), [#&#8203;7787](https://github.com/phpstan/phpstan/issues/7787) - Fix infinite loop of global constants referencing each other (https://github.com/phpstan/phpstan-src/commit/33771e5d8ee8b6dbae4f42ce3f8b424a81f68dc9), [#&#8203;8054](https://github.com/phpstan/phpstan/issues/8054) - Fix `CURLOPT_POSTFIELDS` param type ([#&#8203;1782](https://github.com/phpstan/phpstan-src/pull/1782)), thanks [@&#8203;ahmedash95](https://github.com/ahmedash95)! - Remove `IssetCheck`/`MutatingScope::issetCheck` deviations and remove too early exits ([#&#8203;1784](https://github.com/phpstan/phpstan-src/pull/1784)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix issue around generics and MethodsClassReflectionExtension/PropertiesClassReflectionExtension (https://github.com/phpstan/phpstan-src/commit/c052aace4efa157d9594f13fb748965cbfc43be2), [#&#8203;8008](https://github.com/phpstan/phpstan/issues/8008) - Make array access on possible `false` tolerant with `isset` ([#&#8203;1791](https://github.com/phpstan/phpstan-src/pull/1791)), [#&#8203;8068](https://github.com/phpstan/phpstan/issues/8068), thanks [@&#8203;ahmedash95](https://github.com/ahmedash95)! # Function signature fixes 🤖 - Fix `time_nanosleep` return type signature ([#&#8203;1787](https://github.com/phpstan/phpstan-src/pull/1787)), [#&#8203;8097](https://github.com/phpstan/phpstan/issues/8097), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - Compile PHAR on PHP 8.1 ([#&#8203;1481](https://github.com/phpstan/phpstan-src/pull/1481)) - phpstan-src: Require PHP 8.1, use readonly properties ([#&#8203;1767](https://github.com/phpstan/phpstan-src/pull/1767)) - phpstan-src: Use intersection type (https://github.com/phpstan/phpstan-src/commit/376449e2d4744ec8ee3810321b33a963e89e8280) ### [`v1.8.6`](https://github.com/phpstan/phpstan/releases/tag/1.8.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.5...1.8.6) # Improvements 🔧 - ignoreErrors: multiple messages and explicit `reportUnmatched` ([#&#8203;1686](https://github.com/phpstan/phpstan-src/pull/1686)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - Read more: https://phpstan.org/user-guide/ignoring-errors#reporting-unused-ignores - Improve JUnit error formatter ([#&#8203;1722](https://github.com/phpstan/phpstan-src/pull/1722)), [#&#8203;6772](https://github.com/phpstan/phpstan/issues/6772), thanks [@&#8203;mcaskill](https://github.com/mcaskill)! - Implement template type inference from conditional return type ([#&#8203;1465](https://github.com/phpstan/phpstan-src/pull/1465)), [#&#8203;7141](https://github.com/phpstan/phpstan/issues/7141), [#&#8203;7562](https://github.com/phpstan/phpstan/issues/7562), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Optimize `ConstantArrayType::isKeysSupersetOf()` ([#&#8203;1729](https://github.com/phpstan/phpstan-src/pull/1729)), [#&#8203;8017](https://github.com/phpstan/phpstan/issues/8017), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Enums cannot implement Serializable ([#&#8203;1713](https://github.com/phpstan/phpstan-src/pull/1713)), thanks [@&#8203;staabm](https://github.com/staabm)! - ConditionalTagsExtension: Multiple conditions support ([#&#8203;1697](https://github.com/phpstan/phpstan-src/pull/1697)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - More precise `$argc`, `$argv` global variables types ([#&#8203;1718](https://github.com/phpstan/phpstan-src/pull/1718)), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve folding of constant arrays ([#&#8203;1739](https://github.com/phpstan/phpstan-src/pull/1739)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Introduce `oversized-array` type to enfore max number of `HasOffsetValueType` accessory types ([#&#8203;1666](https://github.com/phpstan/phpstan-src/pull/1666)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - ClassReflection - do not execute properties extensions on PHP 8.2 if the class does not allow dynamic properties (https://github.com/phpstan/phpstan-src/commit/a628fb34293c84c807a1a561883811067e49ebcb) - Improve `UnionTypeHelper::sortTypes()` stability ([#&#8203;1746](https://github.com/phpstan/phpstan-src/pull/1746)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Bleeding edge 🔪 - Change `curl_setopt` function signature based on 2nd arg ([#&#8203;1719](https://github.com/phpstan/phpstan-src/pull/1719)), thanks [@&#8203;staabm](https://github.com/staabm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix checking empty constant arrays in array_pop and array_shift extensions ([#&#8203;1712](https://github.com/phpstan/phpstan-src/pull/1712)), [#&#8203;7968](https://github.com/phpstan/phpstan/issues/7968), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix array_filter result for non-trivial callbacks ([#&#8203;1725](https://github.com/phpstan/phpstan-src/pull/1725)), [#&#8203;7993](https://github.com/phpstan/phpstan/issues/7993), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve type inference for coalesce ([#&#8203;1716](https://github.com/phpstan/phpstan-src/pull/1716)), [#&#8203;7973](https://github.com/phpstan/phpstan/issues/7973), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix assigning generic object without a constructor (like SplObjectStorage) to a nullable property ([#&#8203;1730](https://github.com/phpstan/phpstan-src/pull/1730)), [#&#8203;4526](https://github.com/phpstan/phpstan/issues/4526), [#&#8203;4680](https://github.com/phpstan/phpstan/issues/4680), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Accept `::class` as literal string ([#&#8203;1692](https://github.com/phpstan/phpstan-src/pull/1692)), [#&#8203;7823](https://github.com/phpstan/phpstan/issues/7823), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix array_unshift for union of constant arrays ([#&#8203;1738](https://github.com/phpstan/phpstan-src/pull/1738)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve intersection of generic class string ([#&#8203;1724](https://github.com/phpstan/phpstan-src/pull/1724)), [#&#8203;7987](https://github.com/phpstan/phpstan/issues/7987), [#&#8203;7200](https://github.com/phpstan/phpstan/issues/7200), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Downgrade arrays less (https://github.com/phpstan/phpstan-src/commit/5f1a4a5b9c65b588fc4de91804e1ad941a680bd5), [#&#8203;7963](https://github.com/phpstan/phpstan/issues/7963) - Do not call `BuilderHelpers::normalizeValue()`, it's not needed (https://github.com/phpstan/phpstan-src/commit/ec286787e76b8cebe322d56dde5bdda65f3ebb74), [#&#8203;8029](https://github.com/phpstan/phpstan/issues/8029) - Support autoloaders that rely on the include path and don't check file existence before trying to include a file ([#&#8203;1503](https://github.com/phpstan/phpstan-src/pull/1503)), [#&#8203;7526](https://github.com/phpstan/phpstan/issues/7526), thanks [@&#8203;pprkut](https://github.com/pprkut)! # Function signature fixes 🤖 - `gnupg::geterror` can return false ([#&#8203;1735](https://github.com/phpstan/phpstan-src/pull/1735)), thanks [@&#8203;Firehed](https://github.com/Firehed)! - Improve `pathinfo()` return type ([#&#8203;1734](https://github.com/phpstan/phpstan-src/pull/1734)), [#&#8203;8033](https://github.com/phpstan/phpstan/issues/8033), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - These `stream_*` functions all return a list of strings. ([#&#8203;1745](https://github.com/phpstan/phpstan-src/pull/1745)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! ### [`v1.8.5`](https://github.com/phpstan/phpstan/releases/tag/1.8.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.4...1.8.5) # Improvements 🔧 - PHP 8.2: Support `true` pseudotypes in native unions ([#&#8203;1539](https://github.com/phpstan/phpstan-src/pull/1539)), thanks [@&#8203;staabm](https://github.com/staabm)! - Add dump-parameters command ([#&#8203;1702](https://github.com/phpstan/phpstan-src/pull/1702)), [#&#8203;7942](https://github.com/phpstan/phpstan/issues/7942), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Update phpstan/phpdoc-parser to 1.8.0 (https://github.com/phpstan/phpstan-src/commit/16a80d95554cac8c79fe7d6449e7567f32de9c8a) - DefaultExceptionTypeResolver is covered by BC promise (https://github.com/phpstan/phpstan-src/commit/8a3562e81348ecc92cf9883f8077ef7363796ce8) - Optimization for various array slowdowns (https://github.com/phpstan/phpstan-src/commit/38953dd44d979be2ed4e26c1e87228d060b6f03f, https://github.com/phpstan/phpstan-src/commit/7e2941ec6ca76ef5f22253ee83ea404173556d33, https://github.com/phpstan/phpstan-src/commit/52b7bec2792fb40fe30e74674239701b2d6f39e7) - Reverted some ineffective optimizations (https://github.com/phpstan/phpstan-src/commit/8250448ceac7586cf556b6e9c7858b50f6aa50e7, https://github.com/phpstan/phpstan-src/commit/05dbd5e48c65306c5007af5de2d26f469dba1c3b, https://github.com/phpstan/phpstan-src/commit/ab7760e044bf6fd5b5252b9ce29c4e1d87216f01), [#&#8203;7933](https://github.com/phpstan/phpstan/issues/7933) # Bugfixes 🐛 - Fix `ConstantArrayType::isKeysSupersetOf` for tagged unions ([#&#8203;1693](https://github.com/phpstan/phpstan-src/pull/1693)), [#&#8203;7898](https://github.com/phpstan/phpstan/issues/7898), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix checking empty constant arrays in array function return type extensions ([#&#8203;1696](https://github.com/phpstan/phpstan-src/pull/1696)), [#&#8203;7928](https://github.com/phpstan/phpstan/issues/7928), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve `::class` type for final classes ([#&#8203;1699](https://github.com/phpstan/phpstan-src/pull/1699)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix supertype checks between static and final class ([#&#8203;1703](https://github.com/phpstan/phpstan-src/pull/1703)), [#&#8203;7717](https://github.com/phpstan/phpstan/issues/7717), [#&#8203;6104](https://github.com/phpstan/phpstan/issues/6104), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Simplify TemplateTypeTrait ([#&#8203;1705](https://github.com/phpstan/phpstan-src/pull/1705)), [#&#8203;7103](https://github.com/phpstan/phpstan/issues/7103), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix numeric string ctype_digit always true type specifier result ([#&#8203;1706](https://github.com/phpstan/phpstan-src/pull/1706)), [#&#8203;7914](https://github.com/phpstan/phpstan/issues/7914), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - HasOffsetValueType - fix traverse (https://github.com/phpstan/phpstan-src/commit/5b448a7dce06ca3ade42d32e4c8c50a05c7fcc36) - Fix specifying types for left side of null coalesce ([#&#8203;1707](https://github.com/phpstan/phpstan-src/pull/1707)), [#&#8203;5304](https://github.com/phpstan/phpstan/issues/5304), [#&#8203;7244](https://github.com/phpstan/phpstan/issues/7244), [#&#8203;7501](https://github.com/phpstan/phpstan/issues/7501), [#&#8203;7639](https://github.com/phpstan/phpstan/issues/7639), [#&#8203;7949](https://github.com/phpstan/phpstan/issues/7949), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix scope namespace when entering trait (https://github.com/phpstan/phpstan-src/commit/74309300ba5972461a7cd9ffb33edd6ca005d81e), [#&#8203;7952](https://github.com/phpstan/phpstan/issues/7952) ### [`v1.8.4`](https://github.com/phpstan/phpstan/releases/tag/1.8.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.3...1.8.4) **[PHPStan 1.8.3](https://github.com/phpstan/phpstan/releases/tag/1.8.3) but faster!** # Improvements 🔧 - Optimization: Degrade constant arrays if there's too many values recursively (https://github.com/phpstan/phpstan-src/commit/0cc87f37855611868d784deb3d5ec26c5058fda4, https://github.com/phpstan/phpstan-src/commit/ec9240294a85e84fc212f551c92698e6005cf3c1, https://github.com/phpstan/phpstan-src/commit/13d659522cf2b24c12e14183e8932e8f7270bcd3), [#&#8203;7918](https://github.com/phpstan/phpstan/issues/7918), [#&#8203;7903](https://github.com/phpstan/phpstan/issues/7903), [#&#8203;7901](https://github.com/phpstan/phpstan/issues/7901), [#&#8203;7581](https://github.com/phpstan/phpstan/issues/7581) - Improve dead code detection after nested function calls with conditional never return type ([#&#8203;1378](https://github.com/phpstan/phpstan-src/pull/1378)), [#&#8203;7188](https://github.com/phpstan/phpstan/issues/7188), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - EnumCaseObjectType constructor made part of BC promise (https://github.com/phpstan/phpstan-src/commit/1a8f07040d37a68e612a771e67322e8f624ae6aa), [#&#8203;7917](https://github.com/phpstan/phpstan/issues/7917) # Bugfixes 🐛 - Fix `::class` on string expression ([#&#8203;1425](https://github.com/phpstan/phpstan-src/pull/1425)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Anonymous classes are final (https://github.com/phpstan/phpstan-src/commit/a418c461fab8f118f99b2f6e1e72fd07a4800e1d), [#&#8203;7904](https://github.com/phpstan/phpstan/issues/7904) - Result cache needs to be cleared after `reportUnmatchedIgnoredErrors` is changed (https://github.com/phpstan/phpstan-src/commit/84852ab8d9d4cbe3939d6f55e48e20f0481c3166) - Fix `array_filter()` that does not return all items (https://github.com/phpstan/phpstan-src/commit/2e89a22dc28a044b65dc8f2bf7c76fd0b65f66ee), [#&#8203;7909](https://github.com/phpstan/phpstan/issues/7909) ### [`v1.8.3`](https://github.com/phpstan/phpstan/releases/tag/1.8.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.2...1.8.3) **This release fixes 76 issues!** :tada: # Improvements 🔧 - Added `non-falsy-string` (`truthy-string`) type ([#&#8203;1542](https://github.com/phpstan/phpstan-src/pull/1542), [#&#8203;1660](https://github.com/phpstan/phpstan-src/pull/1660), [#&#8203;1661](https://github.com/phpstan/phpstan-src/pull/1661), [#&#8203;1662](https://github.com/phpstan/phpstan-src/pull/1662)), [#&#8203;5317](https://github.com/phpstan/phpstan/issues/5317), [#&#8203;5370](https://github.com/phpstan/phpstan/issues/5370), [#&#8203;7199](https://github.com/phpstan/phpstan/issues/7199), thanks [@&#8203;staabm](https://github.com/staabm)! - New configuration option: `checkImplicitMixed` ([#&#8203;1645](https://github.com/phpstan/phpstan-src/pull/1645)), thanks [@&#8203;MartinMystikJonas](https://github.com/MartinMystikJonas)! - Support constant string-unions in `substr()` ([#&#8203;1532](https://github.com/phpstan/phpstan-src/pull/1532)), [#&#8203;7663](https://github.com/phpstan/phpstan/issues/7663), thanks [@&#8203;staabm](https://github.com/staabm)! - Tagged unions preparation ([#&#8203;1548](https://github.com/phpstan/phpstan-src/pull/1548)), [#&#8203;5232](https://github.com/phpstan/phpstan/issues/5232), [#&#8203;7511](https://github.com/phpstan/phpstan/issues/7511), [#&#8203;7224](https://github.com/phpstan/phpstan/issues/7224), [#&#8203;6997](https://github.com/phpstan/phpstan/issues/6997), [#&#8203;6556](https://github.com/phpstan/phpstan/issues/6556), [#&#8203;6181](https://github.com/phpstan/phpstan/issues/6181), [#&#8203;5743](https://github.com/phpstan/phpstan/issues/5743), [#&#8203;4708](https://github.com/phpstan/phpstan/issues/4708), [#&#8203;3821](https://github.com/phpstan/phpstan/issues/3821), [#&#8203;2911](https://github.com/phpstan/phpstan/issues/2911), [#&#8203;7156](https://github.com/phpstan/phpstan/issues/7156), [#&#8203;6728](https://github.com/phpstan/phpstan/issues/6728), [#&#8203;6364](https://github.com/phpstan/phpstan/issues/6364), [#&#8203;5758](https://github.com/phpstan/phpstan/issues/5758) - Tagged unions ([#&#8203;1547](https://github.com/phpstan/phpstan-src/pull/1547)), [#&#8203;6469](https://github.com/phpstan/phpstan/issues/6469), [#&#8203;3801](https://github.com/phpstan/phpstan/issues/3801), [#&#8203;6599](https://github.com/phpstan/phpstan/issues/6599) - Added error message to impossible instanceof rule to warn when comparing a trait ([#&#8203;1570](https://github.com/phpstan/phpstan-src/pull/1570)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Implement `ltrim()` return type extension to support `class-string` ([#&#8203;1597](https://github.com/phpstan/phpstan-src/pull/1597)), [#&#8203;7483](https://github.com/phpstan/phpstan/issues/7483), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve type inference from conditional return type ([#&#8203;1604](https://github.com/phpstan/phpstan-src/pull/1604)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Optimization: ArrayType::setOffsetValueType() - generalize key + item type if it goes over a threshold (https://github.com/phpstan/phpstan-src/commit/24aee609ebf91b0100e2f60b78cde5a785936b81, https://github.com/phpstan/phpstan-src/commit/10ba3c681647b281f774f48fb1843d4b5c75b7da) - Optimization: ConstantArrayTypeBuilder - generalize key types and value types in degraded general array (https://github.com/phpstan/phpstan-src/commit/dbdcb817fced0f375a420fc3bff44c2d331c856d) - Make `@psalm-readonly-allow-private-mutation` as alias of `@readonly` ([#&#8203;1609](https://github.com/phpstan/phpstan-src/pull/1609)), [#&#8203;7774](https://github.com/phpstan/phpstan/issues/7774), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Implement `gettype()` inference in TypeSpecifier ([#&#8203;1611](https://github.com/phpstan/phpstan-src/pull/1611)), [#&#8203;6901](https://github.com/phpstan/phpstan/issues/6901), thanks [@&#8203;staabm](https://github.com/staabm)! - Use argument types as parameter types for inline closures ([#&#8203;7798](https://github.com/phpstan/phpstan/issues/7798)) ([#&#8203;1628](https://github.com/phpstan/phpstan-src/pull/1628)), [#&#8203;7798](https://github.com/phpstan/phpstan/issues/7798), thanks [@&#8203;leongersen](https://github.com/leongersen)! - Optimization: inline calls in TrinaryLogic to reduce method call overhead ([#&#8203;1563](https://github.com/phpstan/phpstan-src/pull/1563)), thanks [@&#8203;staabm](https://github.com/staabm)! - Handle the expression `expr & number` for positive numbers ([#&#8203;1629](https://github.com/phpstan/phpstan-src/pull/1629)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Add type specifying extension for `ctype_digit` ([#&#8203;1635](https://github.com/phpstan/phpstan-src/pull/1635)), thanks [@&#8203;fluffycondor](https://github.com/fluffycondor)! - `array_flip()` for constant arrays (https://github.com/phpstan/phpstan-src/commit/a6cec395f64806bd12522926970843423f3f7290) - `array_filter()` for constant arrays (https://github.com/phpstan/phpstan-src/commit/771b860d0c7ca73bfb255df4c14cffa97caada93) - `array_intersect_key()` for constant arrays (https://github.com/phpstan/phpstan-src/commit/a96cdf2bf5cf2b145a5c0fbbe007776e8d7bd7b8) - Enfore optional parameters in callable types ([#&#8203;1354](https://github.com/phpstan/phpstan-src/pull/1354)), [#&#8203;7320](https://github.com/phpstan/phpstan/issues/7320), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Optimization: match/enum performance (https://github.com/phpstan/phpstan-src/commit/092ef3be68a8e478dec09bbeb779fff46b09c023) - Optimization: TrinaryLogic - lazy evaluation methods (https://github.com/phpstan/phpstan-src/commit/f8f6e2a8df9499e5f9603935a2557964c285fae4) # Bugfixes 🐛 - Support `ConstantArrayType` callables with union values ([#&#8203;1529](https://github.com/phpstan/phpstan-src/pull/1529)), [#&#8203;2343](https://github.com/phpstan/phpstan/issues/2343), thanks [@&#8203;herndlm](https://github.com/herndlm)! - PHPDoc readonly rules do not report for native readonly props ([#&#8203;1521](https://github.com/phpstan/phpstan-src/pull/1521)), [#&#8203;7648](https://github.com/phpstan/phpstan/issues/7648), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix error for custom autoloaders calling `eval()` (https://github.com/phpstan/phpstan-src/commit/058d739904a9f0641e5643fd8b089d2203f9c1d3), [#&#8203;7647](https://github.com/phpstan/phpstan/issues/7647) - Remove undefined constants from scope ([#&#8203;1534](https://github.com/phpstan/phpstan-src/pull/1534)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fixed double reporting of promoted properties ([#&#8203;1533](https://github.com/phpstan/phpstan-src/pull/1533)), [#&#8203;7662](https://github.com/phpstan/phpstan/issues/7662), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Fixed extracting PHP 8 stubs (https://github.com/phpstan/php-8-stubs/commit/363a282adde9457b2158580df4da8d83c7d95527), [#&#8203;7676](https://github.com/phpstan/phpstan/issues/7676) - Remove old `pg_*` functions with multiple variants from signature map on PHP 8.1 (https://github.com/phpstan/phpstan-src/commit/8128a63348918ee3d94eb8ba513252c1188b5cc3), [#&#8203;7138](https://github.com/phpstan/phpstan/issues/7138) - Fix ObjectType resolving inside bound Closure ([#&#8203;1543](https://github.com/phpstan/phpstan-src/pull/1543)), [#&#8203;7675](https://github.com/phpstan/phpstan/issues/7675), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `in_array` non-empty-array type specification ([#&#8203;1545](https://github.com/phpstan/phpstan-src/pull/1545)), [#&#8203;7684](https://github.com/phpstan/phpstan/issues/7684), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix incorrect mixed template type for impossible union template type intersection ([#&#8203;1546](https://github.com/phpstan/phpstan-src/pull/1546)), [#&#8203;7688](https://github.com/phpstan/phpstan/issues/7688), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve `ConstantArrayType::unsetOffset` ([#&#8203;1537](https://github.com/phpstan/phpstan-src/pull/1537)), [#&#8203;5223](https://github.com/phpstan/phpstan/issues/5223), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix incorrect incomplete match error for `treatPhpDocTypesAsCertain: false` ([#&#8203;1560](https://github.com/phpstan/phpstan-src/pull/1560)), [#&#8203;7622](https://github.com/phpstan/phpstan/issues/7622), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix variable certainty after exhaustive switch ([#&#8203;1561](https://github.com/phpstan/phpstan-src/pull/1561)), [#&#8203;1016](https://github.com/phpstan/phpstan/issues/1016), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix resolving variants for union type methods ([#&#8203;1574](https://github.com/phpstan/phpstan-src/pull/1574)), [#&#8203;7593](https://github.com/phpstan/phpstan/issues/7593), [#&#8203;6946](https://github.com/phpstan/phpstan/issues/6946), [#&#8203;5754](https://github.com/phpstan/phpstan/issues/5754), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix assigning arbitrary expressions in foreach key ([#&#8203;1582](https://github.com/phpstan/phpstan-src/pull/1582)), [#&#8203;7737](https://github.com/phpstan/phpstan/issues/7737), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Assume offset value set was successful for further analysis (https://github.com/phpstan/phpstan-src/commit/1537424191a4cf27577dd3cfc07d162b09c20a12), [#&#8203;7469](https://github.com/phpstan/phpstan/issues/7469), [#&#8203;3391](https://github.com/phpstan/phpstan/issues/3391), [#&#8203;7417](https://github.com/phpstan/phpstan/issues/7417) - Support removing `class-string`s from `GenericClassStringType` ([#&#8203;1590](https://github.com/phpstan/phpstan-src/pull/1590)), [#&#8203;7698](https://github.com/phpstan/phpstan/issues/7698), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `Array_` expr type resolving with unpacked array items ([#&#8203;1586](https://github.com/phpstan/phpstan-src/pull/1586)), [#&#8203;7724](https://github.com/phpstan/phpstan/issues/7724), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `Array_` expr type resolving with unpacked constant array items ([#&#8203;1619](https://github.com/phpstan/phpstan-src/pull/1619)), [#&#8203;7776](https://github.com/phpstan/phpstan/issues/7776), thanks [@&#8203;herndlm](https://github.com/herndlm)! - ArrayDimFetch: assign vs. narrowing a type (https://github.com/phpstan/phpstan-src/commit/229df9ba73177149f3db8d476ca2c41b065c8092) - Discover BetterReflection sources using PSR-4 (https://github.com/phpstan/phpstan-src/commit/8ab002a13a6a94cfab24284b48e7ad4c5bd60973) - Fix internal error with `json_decode()` without arguments (https://github.com/phpstan/phpstan-src/commit/bf6d4c003a589f2dd75dacab8306c336bb9ff81c), [#&#8203;7762](https://github.com/phpstan/phpstan/issues/7762) - array_key_exists - fix for AST-based offset (https://github.com/phpstan/phpstan-src/commit/8613169c105fd38d4cdbdc56e3655be822ef4ed2), [#&#8203;7763](https://github.com/phpstan/phpstan/issues/7763) - Escape control characters in `ConstantStringType::describe()` ([#&#8203;1612](https://github.com/phpstan/phpstan-src/pull/1612)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix offset access + key-of template type combination ([#&#8203;1623](https://github.com/phpstan/phpstan-src/pull/1623)), [#&#8203;7788](https://github.com/phpstan/phpstan/issues/7788), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix array_search extension incorrectly returning null ([#&#8203;1633](https://github.com/phpstan/phpstan-src/pull/1633)), [#&#8203;7809](https://github.com/phpstan/phpstan/issues/7809), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Specify existent offset with key variable when entering foreach (https://github.com/phpstan/phpstan-src/commit/14592ddf2b9dd454430c61c525b35894ae446856) - Generalize file and dir magic constants (https://github.com/phpstan/phpstan-src/commit/f09b288ac022c9ba5cb490f6877c37fac2b2c7c9) - Unsetting an offset should remove `non-empty-array` (https://github.com/phpstan/phpstan-src/commit/32353a92691b88c4f662d170a165efa7910e330c) - Narrow `$data[$key]` after specifying `$key` (https://github.com/phpstan/phpstan-src/commit/46a8f32f5474b6f6127fb17a1638e7e11897be52), [#&#8203;6008](https://github.com/phpstan/phpstan/issues/6008) - Fix PreInc/PreDec of NeverType ([#&#8203;1641](https://github.com/phpstan/phpstan-src/pull/1641)), [#&#8203;7044](https://github.com/phpstan/phpstan/issues/7044), [#&#8203;3277](https://github.com/phpstan/phpstan/issues/3277), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Consider `MixedType` explicitness in `MethodParameterComparisonHelper::isTypeCompatible` ([#&#8203;1491](https://github.com/phpstan/phpstan-src/pull/1491)), [#&#8203;7415](https://github.com/phpstan/phpstan/issues/7415), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Do not consider mixed explicitness for parameter contravariance ([#&#8203;1648](https://github.com/phpstan/phpstan-src/pull/1648)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - serialize/unserialize is not allowed in enum ([#&#8203;1643](https://github.com/phpstan/phpstan-src/pull/1643)), [#&#8203;7837](https://github.com/phpstan/phpstan/issues/7837), thanks [@&#8203;staabm](https://github.com/staabm)! - Fixed generalizing arrays in scope, simplified offset unset in `ConstantArrayType` (https://github.com/phpstan/phpstan-src/commit/617311022636af148ce910635adf85624fe59f8f), [#&#8203;6013](https://github.com/phpstan/phpstan/issues/6013), [#&#8203;2851](https://github.com/phpstan/phpstan/issues/2851), [#&#8203;6008](https://github.com/phpstan/phpstan/issues/6008) - Fix NeverType for more operators ([#&#8203;1649](https://github.com/phpstan/phpstan-src/pull/1649)), thanks [@&#8203;staabm](https://github.com/staabm)! - support length parameter in `sscanf()` ([#&#8203;1593](https://github.com/phpstan/phpstan-src/pull/1593)), thanks [@&#8203;staabm](https://github.com/staabm)! - sscanf: allow nulls in returned array ([#&#8203;1577](https://github.com/phpstan/phpstan-src/pull/1577)), [#&#8203;7735](https://github.com/phpstan/phpstan/issues/7735), thanks [@&#8203;staabm](https://github.com/staabm)! - Fixed comparison of empty array with a scalar type ([#&#8203;1650](https://github.com/phpstan/phpstan-src/pull/1650)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `sscanf()` inference with regex format patterns ([#&#8203;1576](https://github.com/phpstan/phpstan-src/pull/1576)), [#&#8203;7563](https://github.com/phpstan/phpstan/issues/7563), [#&#8203;7764](https://github.com/phpstan/phpstan/issues/7764), thanks [@&#8203;staabm](https://github.com/staabm)! - Resources may be opened or closed ([#&#8203;1617](https://github.com/phpstan/phpstan-src/pull/1617)), [#&#8203;5845](https://github.com/phpstan/phpstan/issues/5845), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix ConstantArrayType intersecting with HasOffsetValueType (https://github.com/phpstan/phpstan-src/commit/9c49d4c913f3df7579269f457bfdea282c9c2036) - Take subtracted type into account in `MixedType` ([#&#8203;1656](https://github.com/phpstan/phpstan-src/pull/1656)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix resolving mixed + array ([#&#8203;1579](https://github.com/phpstan/phpstan-src/pull/1579)), [#&#8203;7492](https://github.com/phpstan/phpstan/issues/7492), [#&#8203;6783](https://github.com/phpstan/phpstan/issues/6783), [#&#8203;3872](https://github.com/phpstan/phpstan/issues/3872), thanks [@&#8203;staabm](https://github.com/staabm)! - Fixed non-falsy-string inference with '0' ([#&#8203;1658](https://github.com/phpstan/phpstan-src/pull/1658)), [#&#8203;7877](https://github.com/phpstan/phpstan/issues/7877), [#&#8203;7881](https://github.com/phpstan/phpstan/issues/7881), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix numeric-string negated intersection ([#&#8203;1639](https://github.com/phpstan/phpstan-src/pull/1639)), [#&#8203;7814](https://github.com/phpstan/phpstan/issues/7814), thanks [@&#8203;fluffycondor](https://github.com/fluffycondor)! - Make `PHPStan\dumpType` pure ([#&#8203;1665](https://github.com/phpstan/phpstan-src/pull/1665)), [#&#8203;7803](https://github.com/phpstan/phpstan/issues/7803), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix wrong message - Instanceof between Xxx and string ([#&#8203;1669](https://github.com/phpstan/phpstan-src/pull/1669)), [#&#8203;5728](https://github.com/phpstan/phpstan/issues/5728), thanks [@&#8203;lulco](https://github.com/lulco)! - Fix unset bug (https://github.com/phpstan/phpstan-src/commit/024738fcc7fe98eec72a274ee742a51442a681a3), [#&#8203;6170](https://github.com/phpstan/phpstan/issues/6170) - Make ArrayKeyExistsFunctionTypeSpecifyingExtension understand an empty array (https://github.com/phpstan/phpstan-src/commit/c057aa9d1feff5ce61f96f397ef92e7389a17477) # Function signature fixes 🤖 - `Imagick::queryFontMetrics` more specific return type ([#&#8203;1530](https://github.com/phpstan/phpstan-src/pull/1530)), thanks [@&#8203;MartkCz](https://github.com/MartkCz)! - `Imagick::roundCornersImage` correct naming and optional params ([#&#8203;1531](https://github.com/phpstan/phpstan-src/pull/1531)), thanks [@&#8203;MartkCz](https://github.com/MartkCz)! - `str_split` returns an empty array since PHP 8.2 ([#&#8203;1544](https://github.com/phpstan/phpstan-src/pull/1544)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `XmlReader::next|read()` has side-effects ([#&#8203;1551](https://github.com/phpstan/phpstan-src/pull/1551)), [#&#8203;5920](https://github.com/phpstan/phpstan/issues/5920), thanks [@&#8203;staabm](https://github.com/staabm)! - Reflection: `getName()` returns a `non-empty-string` ([#&#8203;1599](https://github.com/phpstan/phpstan-src/pull/1599)), [#&#8203;7056](https://github.com/phpstan/phpstan/issues/7056), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `ord()` signature ([#&#8203;1620](https://github.com/phpstan/phpstan-src/pull/1620)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - More specific type for `port` component of '`parse_url()` ([#&#8203;1622](https://github.com/phpstan/phpstan-src/pull/1622)), thanks [@&#8203;thg2k](https://github.com/thg2k)! - Allow null as second parameter for json_decode ([#&#8203;1672](https://github.com/phpstan/phpstan-src/pull/1672)), thanks [@&#8203;webmaster777](https://github.com/webmaster777)! - Encoding functions returns non-empty-string ([#&#8203;1664](https://github.com/phpstan/phpstan-src/pull/1664)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - HasOffsetType - create only for ConstantIntegerType|ConstantStringType (https://github.com/phpstan/phpstan-src/commit/0a2fc63e1fc7414bf96df2e0879f689e3c4bdd00) - Simplify `non-empty-array` removal in `array_push`/`array_unshift` ([#&#8203;1552](https://github.com/phpstan/phpstan-src/pull/1552)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `VirtualNode::getType()` returning an incorrect value for ClassConstantsNode and MethodReturnStatementsNode ([#&#8203;1568](https://github.com/phpstan/phpstan-src/pull/1568)), thanks [@&#8203;Muqsit](https://github.com/Muqsit)! - Add return type stub for `SimpleXMLElement::asXML` ([#&#8203;1606](https://github.com/phpstan/phpstan-src/pull/1606)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Simplify TypeSpecifier ([#&#8203;1613](https://github.com/phpstan/phpstan-src/pull/1613)), thanks [@&#8203;staabm](https://github.com/staabm)! - Avoid unnecessary intersection in `MutatingScope::filterBySpecifiedTypes` ([#&#8203;1536](https://github.com/phpstan/phpstan-src/pull/1536)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Make `IntegerRangeType` constructor private ([#&#8203;1624](https://github.com/phpstan/phpstan-src/pull/1624)), [#&#8203;7803](https://github.com/phpstan/phpstan/issues/7803), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Remove `jean85/pretty-package-versions` dependency ([#&#8203;1607](https://github.com/phpstan/phpstan-src/pull/1607)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Require `brianium/paratest` ^6.5 to fix PHP 8.2 deprecation notices ([#&#8203;1631](https://github.com/phpstan/phpstan-src/pull/1631)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Replace pickArrays method in array_search extension with getAnyArrays helper ([#&#8203;1632](https://github.com/phpstan/phpstan-src/pull/1632)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Intersect HasOffsetValue type only with possible arrays ([#&#8203;1634](https://github.com/phpstan/phpstan-src/pull/1634)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Avoid benevolent union behaviour for more type methods ([#&#8203;1644](https://github.com/phpstan/phpstan-src/pull/1644)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use isArray instead of array supertype checks ([#&#8203;1634](https://github.com/phpstan/phpstan-src/pull/1634)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use isString instead of string supertype checks ([#&#8203;1634](https://github.com/phpstan/phpstan-src/pull/1634)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Make MutatingScope::invalidateMethodsOnExpression() private (https://github.com/phpstan/phpstan-src/commit/f3fe24577f0cff89dafaa3a68b9b37dcdf851cb1) - Deprecate `TypeUtils::containsCallable()` ([#&#8203;1667](https://github.com/phpstan/phpstan-src/pull/1667)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_pop and array_shift extensions ([#&#8203;1668](https://github.com/phpstan/phpstan-src/pull/1668)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_fill_keys extension ([#&#8203;1676](https://github.com/phpstan/phpstan-src/pull/1676)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_reduce extension ([#&#8203;1677](https://github.com/phpstan/phpstan-src/pull/1677)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array pointer functions extension ([#&#8203;1678](https://github.com/phpstan/phpstan-src/pull/1678)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_map extension ([#&#8203;1680](https://github.com/phpstan/phpstan-src/pull/1680)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in RegularExpressionPatternRule ([#&#8203;1679](https://github.com/phpstan/phpstan-src/pull/1679)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_key_first and array_key_last extensions ([#&#8203;1681](https://github.com/phpstan/phpstan-src/pull/1681)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_intersect_key extension ([#&#8203;1682](https://github.com/phpstan/phpstan-src/pull/1682)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Use TypeUtils::getOldConstantArrays in array_column extension ([#&#8203;1683](https://github.com/phpstan/phpstan-src/pull/1683)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.8.2`](https://github.com/phpstan/phpstan/releases/tag/1.8.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.1...1.8.2) # Improvements 🔧 - **Basic support for PHP 8.2** - `#[\AllowDynamicProperties]` attribute support ([RFC](https://wiki.php.net/rfc/deprecate_dynamic_properties)) - `#[\SensitiveParameter]` attribute support ([RFC](https://wiki.php.net/rfc/redact_parameters_in_back_traces)) - Updated function signatures - Fixed deprecations in PHPStan - `--debug`: print previous exceptions (https://github.com/phpstan/phpstan-src/commit/a342b2bea01895e921c5f669a9a53bd0b1402ed3), [#&#8203;7590](https://github.com/phpstan/phpstan/issues/7590) - Changed the MutatingScope class to not include impossible arms in it's resulting union type. ([#&#8203;1515](https://github.com/phpstan/phpstan-src/pull/1515)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! # Bugfixes 🐛 - Properly cache late resolvable types results ([#&#8203;1518](https://github.com/phpstan/phpstan-src/pull/1518)), [#&#8203;7637](https://github.com/phpstan/phpstan/issues/7637), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix supertype checks between late resolvable types ([#&#8203;1523](https://github.com/phpstan/phpstan-src/pull/1523)), [#&#8203;7652](https://github.com/phpstan/phpstan/issues/7652), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - Update `AppendIterator` stub ([#&#8203;1517](https://github.com/phpstan/phpstan-src/pull/1517)), thanks [@&#8203;drupol](https://github.com/drupol)! - Update `CachingIterator::getCache` stub ([#&#8203;1519](https://github.com/phpstan/phpstan-src/pull/1519)), thanks [@&#8203;drupol](https://github.com/drupol)! ### [`v1.8.1`](https://github.com/phpstan/phpstan/releases/tag/1.8.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.8.0...1.8.1) # Improvements 🔧 - ReadWritePropertiesExtensions are part of ClassPropertiesNode (https://github.com/phpstan/phpstan-src/commit/49c27d8849b1d153a67f28e612e490a71b4fd477), https://github.com/phpstan/phpstan-src/pull/1480#issuecomment-1169960148 - Add ClosureTypeFactory ([#&#8203;1484](https://github.com/phpstan/phpstan-src/pull/1483)), https://github.com/phpstan/phpstan/discussions/7546, thanks [@&#8203;canvural](https://github.com/canvural)! - Handle native function `@throws` tag in stub file ([#&#8203;1487](https://github.com/phpstan/phpstan-src/pull/1487)), [#&#8203;7552](https://github.com/phpstan/phpstan/issues/7552), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Add `#[AllowDynamicProperties]` PHP 8.2 attribute stub ([#&#8203;1478](https://github.com/phpstan/phpstan-src/pull/1478)), thanks [@&#8203;andypost](https://github.com/andypost)! - Add rule that disallows final private methods on PHP 8.0+ ([#&#8203;1490](https://github.com/phpstan/phpstan-src/pull/1490)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Inherit `@immutable` phpdoc ([#&#8203;1489](https://github.com/phpstan/phpstan-src/pull/1489)), [#&#8203;7506](https://github.com/phpstan/phpstan/issues/7506), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Mark `ClassReflection::evictPrivateSymbols()` as internal (https://github.com/phpstan/phpstan-src/commit/9138ab2a1b63d9ee31764cc812cca404f265ecb7) # Bugfixes 🐛 - Fix type specification of various string functions with constant strings in a falsey context ([#&#8203;1488](https://github.com/phpstan/phpstan-src/pull/1488)), [#&#8203;7555](https://github.com/phpstan/phpstan/issues/7555), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `ConstantArrayType` creation for `preg_split` with `PREG_SPLIT_OFFSET_CAPTURE` ([#&#8203;1486](https://github.com/phpstan/phpstan-src/pull/1486)), [#&#8203;7554](https://github.com/phpstan/phpstan/issues/7554), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Reindex constant arrays via `shuffle` ([#&#8203;1438](https://github.com/phpstan/phpstan-src/pull/1438)), [#&#8203;6138](https://github.com/phpstan/phpstan/issues/6138), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix union and intersection between StaticType and ThisType (https://github.com/phpstan/phpstan-src/commit/e20e9345f57a7cd760967f459aa1eedfe2eabff8), [#&#8203;6291](https://github.com/phpstan/phpstan/issues/6291), [#&#8203;7211](https://github.com/phpstan/phpstan/issues/7211), [#&#8203;7550](https://github.com/phpstan/phpstan/issues/7550) - Enhance `FILTER_VALIDATE_INT` option in `filter_var` ([#&#8203;1499](https://github.com/phpstan/phpstan-src/pull/1499)), [#&#8203;7608](https://github.com/phpstan/phpstan/issues/7608), thanks [@&#8203;takeokunn](https://github.com/takeokunn)! - Fix handling of `str_split` / `mb_str_split` string arg compound types ([#&#8203;1496](https://github.com/phpstan/phpstan-src/pull/1496)), [#&#8203;7580](https://github.com/phpstan/phpstan/issues/7580), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix Identical type specification of constant types ([#&#8203;1493](https://github.com/phpstan/phpstan-src/pull/1493)), [#&#8203;7257](https://github.com/phpstan/phpstan/issues/7257), [#&#8203;6781](https://github.com/phpstan/phpstan/issues/6781), [#&#8203;6647](https://github.com/phpstan/phpstan/issues/6647), [#&#8203;5896](https://github.com/phpstan/phpstan/issues/5896), [#&#8203;5474](https://github.com/phpstan/phpstan/issues/5474), [#&#8203;6000](https://github.com/phpstan/phpstan/issues/6000), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Better `StaticType::traverse()` (https://github.com/phpstan/phpstan-src/commit/0e257067ff92fbcb37b034cccdbea864a233c198) - `GenericClassStringType::isSuperTypeOf()` - do not convert maybe into no (https://github.com/phpstan/phpstan-src/commit/6fba5429b9784801a89cdc6cfa3d6f8cfd1d82e8), [#&#8203;6697](https://github.com/phpstan/phpstan/issues/6697) - Fix subtractable `StaticType` (https://github.com/phpstan/phpstan-src/commit/0906336d29e807baba1a9eeca7b1545240c4ce5c), [#&#8203;6443](https://github.com/phpstan/phpstan/issues/6443) # Function signature fixes 🤖 - Fix return type of `octdec()` ([#&#8203;1500](https://github.com/phpstan/phpstan-src/pull/1500)), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! ### [`v1.8.0`](https://github.com/phpstan/phpstan/releases/tag/1.8.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.15...1.8.0) # Major new features 🚀 - Collectors - allows writing custom rules that target the whole project - Read more: https://phpstan.org/developing-extensions/collectors - New `rememberPossiblyImpureFunctionValues` config parameter (defaults to `true`) (https://github.com/phpstan/phpstan-src/commit/50ed38f04de93b4d0ea9573d0a4789853a4b9f32), [#&#8203;7529](https://github.com/phpstan/phpstan/issues/7529) \* Read more: https://phpstan.org/config-reference#rememberpossiblyimpurefunctionvalues # Bleeding edge 🔪 - Check that each trait is used and analysed at least once - level 4 (https://github.com/phpstan/phpstan-src/commit/c4d05276fb8605d6ac20acbe1cc5df31cd6c10b0) - Check that PHPStan class in class constant fetch is covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/9e007251ce61788f6a0319a53f1de6cf801ed233) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Type a ranged value for `filter_var(FILTER_VALIDATE_INT)` ([#&#8203;1443](https://github.com/phpstan/phpstan-src/pull/1443)), [#&#8203;7494](https://github.com/phpstan/phpstan/issues/7494), thanks [@&#8203;zonuexe](https://github.com/zonuexe)! - Allow BooleanAnd and BooleanOr as standalone expressions with right sides always false (https://github.com/phpstan/phpstan-src/commit/f9374e74beec7082228454693dcdc14000070266), [#&#8203;2741](https://github.com/phpstan/phpstan/issues/2741) - Added `@api` annotation to `NodeScopeResolver::processStmtNodes()` ([#&#8203;1464](https://github.com/phpstan/phpstan-src/pull/1464)), thanks [@&#8203;vojtech-dobes](https://github.com/vojtech-dobes)! - Add `ClassReflection->is()` shortcut ([#&#8203;1468](https://github.com/phpstan/phpstan-src/pull/1468)), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Force update of the PHPStan Pro PHAR in case of crash (https://github.com/phpstan/phpstan-src/commit/b95606ec291a7cf926ca757e544bfa089da950aa) - Intersect optimization for large unions ([#&#8203;1471](https://github.com/phpstan/phpstan-src/pull/1471)), thanks [@&#8203;neclimdul](https://github.com/neclimdul)! - Update phpdoc-parser (https://github.com/phpstan/phpstan-src/commit/7aa19e02c60c75961333d99cfb5c4704796d6e55) - Simplify parsing of type alias import (https://github.com/phpstan/phpdoc-parser/pull/137), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - Support `@template-contravariant` tags (https://github.com/phpstan/phpdoc-parser/pull/140), thanks [@&#8203;autaut03](https://github.com/autaut03)! # Bugfixes 🐛 - Prevent crashing for negative bit shifts ([#&#8203;1447](https://github.com/phpstan/phpstan-src/pull/1447)), [#&#8203;7490](https://github.com/phpstan/phpstan/issues/7490), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix infinite recursion for template intersection type accepts() ([#&#8203;1450](https://github.com/phpstan/phpstan-src/pull/1450)), [#&#8203;7500](https://github.com/phpstan/phpstan/issues/7500), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Run with parallel runner only when `proc_open` is not disabled ([#&#8203;1451](https://github.com/phpstan/phpstan-src/pull/1451)), [#&#8203;7488](https://github.com/phpstan/phpstan/issues/7488), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Suppress `is_file` warnings in `bin/phpstan` ([#&#8203;1466](https://github.com/phpstan/phpstan-src/pull/1466)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix specifying types for chained assignments ([#&#8203;1473](https://github.com/phpstan/phpstan-src/pull/1473)), [#&#8203;7142](https://github.com/phpstan/phpstan/issues/7142), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Consider autoloaders passed in `-a` (https://github.com/phpstan/phpstan-src/commit/78016fe92840c02a5981f4ab2ea28fc2d3e49f27) # Function signature fixes 🤖 - `Closure::bind()` with `$newScope = null` ([#&#8203;1446](https://github.com/phpstan/phpstan-src/pull/1446)), [#&#8203;7489](https://github.com/phpstan/phpstan/issues/7489), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - `Closure::bindTo()` with `$newScope = null` ([#&#8203;1448](https://github.com/phpstan/phpstan-src/pull/1448)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix return type for `imagesx` and `imagesy` functions ([#&#8203;1452](https://github.com/phpstan/phpstan-src/pull/1452)), thanks [@&#8203;norkunas](https://github.com/norkunas)! - Add `NoRewindIterator` stub ([#&#8203;1453](https://github.com/phpstan/phpstan-src/pull/1453)), thanks [@&#8203;drupol](https://github.com/drupol)! - Add `LimitIterator` stub ([#&#8203;1455](https://github.com/phpstan/phpstan-src/pull/1455)), thanks [@&#8203;drupol](https://github.com/drupol)! - Add `InfiniteIterator` stub ([#&#8203;1454](https://github.com/phpstan/phpstan-src/pull/1454)), thanks [@&#8203;drupol](https://github.com/drupol)! - Add `CachingIterator` stub ([#&#8203;1456](https://github.com/phpstan/phpstan-src/pull/1456)), thanks [@&#8203;drupol](https://github.com/drupol)! - Add `RegexIterator` stub ([#&#8203;1462](https://github.com/phpstan/phpstan-src/pull/1462)), thanks [@&#8203;drupol](https://github.com/drupol)! - Add `EmptyIterator` stub ([#&#8203;1472](https://github.com/phpstan/phpstan-src/pull/1472)), thanks [@&#8203;drupol](https://github.com/drupol)! - Narrow return type of `array_keys` slightly ([#&#8203;1474](https://github.com/phpstan/phpstan-src/pull/1474)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! ### [`v1.7.15`](https://github.com/phpstan/phpstan/releases/tag/1.7.15) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.14...1.7.15) # Improvements 🔧 - Support for relative paths in `editorUrl` for Docker environment ([#&#8203;1414](https://github.com/phpstan/phpstan-src/pull/1414)), [#&#8203;7043](https://github.com/phpstan/phpstan/issues/7043), thanks [@&#8203;Wirone](https://github.com/Wirone)! - Support positional arguments in `sprintf()` constant format inference ([#&#8203;1437](https://github.com/phpstan/phpstan-src/pull/1437), [#&#8203;1440](https://github.com/phpstan/phpstan-src/pull/1440), [#&#8203;1441](https://github.com/phpstan/phpstan-src/pull/1441)), thanks [@&#8203;staabm](https://github.com/staabm)! - Dynamic return type extension for `sscanf()` and `fscanf()` ([#&#8203;1434](https://github.com/phpstan/phpstan-src/pull/1434)), thanks [@&#8203;staabm](https://github.com/staabm)! - Virtual nodes (InClassMethodNode, InFunctionNode, InClosureNode) - pass and provide getters for specific reflection so that `Scope::getFunction()` does not need to be used (https://github.com/phpstan/phpstan-src/commit/f18bd86495fc6811ee04c305ff4b379b10cd07bb) # Bleeding edge 🔪 - Check code in custom PHPStan extensions for runtime reflection concepts like `is_a()` or `class_parents()` (https://github.com/phpstan/phpstan-src/commit/c4a662ac6c3ec63f063238880b243b5399c34fcc) - Check code in custom PHPStan extensions for runtime reflection concepts like `new ReflectionMethod()` (https://github.com/phpstan/phpstan-src/commit/536306611cbb5877b6565755cd07b87f9ccfdf08) - ApiInstanceofRule - Report `instanceof` of classes not covered by backward compatibility promise (https://github.com/phpstan/phpstan-src/commit/ff4d02d62a7a2e2c4d928d48d31d49246dba7139) - Report `instanceof` of classes covered by backward compatibility promise but where the assumption might change (https://github.com/phpstan/phpstan-src/commit/996bc69fa977aa64f601bd82b8a0ae39be0cbeef) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix return type for arrow function generators ([#&#8203;1422](https://github.com/phpstan/phpstan-src/pull/1422)), [#&#8203;7031](https://github.com/phpstan/phpstan/issues/7031), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Improve intersecting constant array with general array ([#&#8203;1429](https://github.com/phpstan/phpstan-src/pull/1429)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Allow `numeric-string` being returned for `non-empty-string` ([#&#8203;1428](https://github.com/phpstan/phpstan-src/pull/1428)), [#&#8203;7265](https://github.com/phpstan/phpstan/issues/7265), thanks [@&#8203;staabm](https://github.com/staabm)! - Specify array type via `in_array` ([#&#8203;1430](https://github.com/phpstan/phpstan-src/pull/1430)), [#&#8203;7153](https://github.com/phpstan/phpstan/issues/7153), [#&#8203;7275](https://github.com/phpstan/phpstan/issues/7275), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Specify `non-empty-array after` after `in_array()` ([#&#8203;1108](https://github.com/phpstan/phpstan-src/pull/1108)), [#&#8203;6167](https://github.com/phpstan/phpstan/issues/6167), thanks [@&#8203;staabm](https://github.com/staabm)! - Array after `array_push` / `array_unshift` call can still be empty ([#&#8203;1431](https://github.com/phpstan/phpstan-src/pull/1431)), [#&#8203;7424](https://github.com/phpstan/phpstan/issues/7424), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `TemplateTypeArgumentStrategy::accepts()` (https://github.com/phpstan/phpstan-src/commit/85ab8cfe237b9a90d12f211dd1938a99cc299bba), [#&#8203;7460](https://github.com/phpstan/phpstan/issues/7460) - Improve parenthesization for union types ([#&#8203;1433](https://github.com/phpstan/phpstan-src/pull/1433)), [#&#8203;7484](https://github.com/phpstan/phpstan/issues/7484), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Result cache is invalidated for files where PHP 8 attributes changed ([#&#8203;1427](https://github.com/phpstan/phpstan-src/pull/1427)), [#&#8203;6797](https://github.com/phpstan/phpstan/issues/6797), [#&#8203;7413](https://github.com/phpstan/phpstan/issues/7413), thanks [@&#8203;olsavmic](https://github.com/olsavmic)! - Fix `TypeCombinator::union()` for intersection of array and template type ([#&#8203;1444](https://github.com/phpstan/phpstan-src/pull/1444)), [#&#8203;4117](https://github.com/phpstan/phpstan/issues/4117), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - Be more specific about the XHProf sampling type (`xhprof_sample_disable()`) ([#&#8203;1436](https://github.com/phpstan/phpstan-src/pull/1436)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! ### [`v1.7.14`](https://github.com/phpstan/phpstan/releases/tag/1.7.14) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.13...1.7.14) # Improvements 🔧 - Update phpdoc-parser - Micro-optimize lexer (https://github.com/phpstan/phpdoc-parser/pull/135), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Update BetterReflection to 5.6.0 ([#&#8203;1421](https://github.com/phpstan/phpstan-src/pull/1421)), [#&#8203;7429](https://github.com/phpstan/phpstan/issues/7429), [#&#8203;7428](https://github.com/phpstan/phpstan/issues/7428) - Add dynamic return type extension for `date_create` ([#&#8203;1413](https://github.com/phpstan/phpstan-src/pull/1413)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - more precise `sprintf()` return type on constant formats ([#&#8203;1410](https://github.com/phpstan/phpstan-src/pull/1410)), [#&#8203;7387](https://github.com/phpstan/phpstan/issues/7387), thanks [@&#8203;staabm](https://github.com/staabm)! - Update PhpStorm stubs ([#&#8203;1419](https://github.com/phpstan/phpstan-src/pull/1419)) - Assert functions do not throw anything (https://github.com/phpstan/phpstan-src/commit/9878eef9a7b04b8a7fa14b004ebfbb1e3d5cb0a8) - Deprecate `MutatingScope::enterCatch()` (https://github.com/phpstan/phpstan-src/commit/4a7d7da6f57be75e3f0dbc4b048663dbd5a58e1d) # Bugfixes 🐛 - Support `literal-string` as array key ([#&#8203;1420](https://github.com/phpstan/phpstan-src/pull/1420)), [#&#8203;7353](https://github.com/phpstan/phpstan/issues/7353), [#&#8203;6163](https://github.com/phpstan/phpstan/issues/6163), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - Update string compare return values ([#&#8203;1412](https://github.com/phpstan/phpstan-src/pull/1412)), thanks [@&#8203;bytestream](https://github.com/bytestream)! ### [`v1.7.13`](https://github.com/phpstan/phpstan/releases/tag/1.7.13) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.12...1.7.13) # Improvements 🔧 - Optimization of printing expressions using ExprPrinter (https://github.com/phpstan/phpstan-src/commit/e12524e21537b970c91e363c616503e6d7d41f38, https://github.com/phpstan/phpstan-src/commit/fba292944a67cb91158042a0f952e5e15bcf30c7) - Do not require an existing filename when reading PHPDocs from an evaled class ([#&#8203;1409](https://github.com/phpstan/phpstan-src/pull/1409)), [#&#8203;7441](https://github.com/phpstan/phpstan/issues/7441) - StatementExitPoint and ThrowPoint covered by BC promise (https://github.com/phpstan/phpstan-src/commit/e8b8ffdd7d164a7ddcafcf6cb570f56b71bb2263) - Update phpdoc-parser [#&#8203;7426](https://github.com/phpstan/phpstan/issues/7426) - Optimize `Lexer::tokenize()` (https://github.com/phpstan/phpdoc-parser/pull/133), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Optimize generated regex (https://github.com/phpstan/phpdoc-parser/pull/134), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Bleeding edge 🔪 - Use explicit mixed for global array variables ([#&#8203;1411](https://github.com/phpstan/phpstan-src/pull/1411)), thanks [@&#8203;herndlm](https://github.com/herndlm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix incorrect UnhandledMatchError for match expressions using spaceship operator ([#&#8203;1408](https://github.com/phpstan/phpstan-src/pull/1408)), [#&#8203;4451](https://github.com/phpstan/phpstan/issues/4451), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix resolving class const fetch for constant strings ([#&#8203;1416](https://github.com/phpstan/phpstan-src/pull/1416)), [#&#8203;7391](https://github.com/phpstan/phpstan/issues/7391), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix resolving user-defined constants in sub-namespaces ([#&#8203;1415](https://github.com/phpstan/phpstan-src/pull/1415)), [#&#8203;7352](https://github.com/phpstan/phpstan/issues/7352), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - `TypeUtils::getDirectClassNames()` - return unique list of class names (https://github.com/phpstan/phpstan-src/commit/b85fce0707f65a633163d2bf5215e57c927011b9) - Fix "missing return" for void/never conditional return types ([#&#8203;1418](https://github.com/phpstan/phpstan-src/pull/1418)), [#&#8203;7384](https://github.com/phpstan/phpstan/issues/7384), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! ### [`v1.7.12`](https://github.com/phpstan/phpstan/releases/tag/1.7.12) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.11...1.7.12) # Improvements 🔧 - Update phpstan/phpdoc-parser to 1.6.0 (https://github.com/phpstan/phpstan-src/commit/ef8c7c37f2ab3def07860a4cdc20c7ed56758a8c) - Allow omitting `@param` type (https://github.com/phpstan/phpdoc-parser/pull/127), https://github.com/phpstan/phpdoc-parser/issues/77, thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support all atomic types as nullable types (https://github.com/phpstan/phpdoc-parser/pull/129), https://github.com/phpstan/phpdoc-parser/issues/124, thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support constant string and integer as template bound ([#&#8203;1402](https://github.com/phpstan/phpstan-src/pull/1402)), [#&#8203;7381](https://github.com/phpstan/phpstan/issues/7381), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Introduce `ExtendedMethodReflection` interface ([#&#8203;1403](https://github.com/phpstan/phpstan-src/pull/1403)) - The purpose of this interface is to be able to answer more questions about methods without breaking backward compatibility with existing MethodsClassReflectionExtension. - Developers are meant to only use the MethodReflection interface and its methods in their code. - Methods on ExtendedMethodReflection are subject to change. # Bleeding edge 🔪 - PHPDoc parser: Require whitespace before description with limited start tokens (https://github.com/phpstan/phpdoc-parser/pull/128), https://github.com/phpstan/phpdoc-parser/issues/125, thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix node scope resolving of array/list expression assignments ([#&#8203;1405](https://github.com/phpstan/phpstan-src/pull/1405)), [#&#8203;7119](https://github.com/phpstan/phpstan/issues/7119), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Do not consider arrays with an unknown class string to be a callback ([#&#8203;1404](https://github.com/phpstan/phpstan-src/pull/1404)), [#&#8203;7389](https://github.com/phpstan/phpstan/issues/7389), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add array_udiff to arrayFunctions.stub ([#&#8203;1407](https://github.com/phpstan/phpstan-src/pull/1407)), [#&#8203;6105](https://github.com/phpstan/phpstan/issues/6105), thanks [@&#8203;akalineskou](https://github.com/akalineskou)! ### [`v1.7.11`](https://github.com/phpstan/phpstan/releases/tag/1.7.11) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.10...1.7.11) # Bleeding edge 🔪 - Add `@readonly` rule that disallows default values ([#&#8203;1391](https://github.com/phpstan/phpstan-src/pull/1391)), thanks [@&#8203;herndlm](https://github.com/herndlm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - `BetterReflectionProvider::getClass()` - handle `InvalidIdentifierName` too (https://github.com/phpstan/phpstan-src/commit/64b0907db03da40ecb3d98bde905bbc3214bb08d), [#&#8203;7404](https://github.com/phpstan/phpstan/issues/7404) - BetterReflection: `ReflectionClass` adapter - implement `newInstance*` methods (https://github.com/ondrejmirtes/BetterReflection/commit/90dd5834447f8a184ff312855bdae2b793c34748), https://github.com/phpstan/phpstan/discussions/7403 ### [`v1.7.10`](https://github.com/phpstan/phpstan/releases/tag/1.7.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.9...1.7.10) # Improvements 🔧 - Adapt to different `vendor-dir` setting in `composer.json`, and also `COMPOSER` environment variable ([#&#8203;1384](https://github.com/phpstan/phpstan-src/pull/1384)), thanks [@&#8203;canvural](https://github.com/canvural)! # Bugfixes 🐛 - Fix BC break in `PHPStan\Node\ClassMethod` (https://github.com/phpstan/phpstan-src/commit/9b4a5913aa47d94acb47e3c06fce83db8ea5fd8b), https://github.com/phpstan/phpstan-src/commit/d0a9d084ea66be4afdf965dd51e1b6d91d36c6b7#r75178623 - Fix `TypeUtils::getDirectClassNames` for nested type ([#&#8203;1380](https://github.com/phpstan/phpstan-src/pull/1380)), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Consistent gathering of all stub files for their analysis ([#&#8203;1355](https://github.com/phpstan/phpstan-src/pull/1355)), thanks [@&#8203;canvural](https://github.com/canvural)! - Dont report unsafe static if constructor is in both parent and interface ([#&#8203;1395](https://github.com/phpstan/phpstan-src/pull/1395)), [#&#8203;6007](https://github.com/phpstan/phpstan/issues/6007), thanks [@&#8203;canvural](https://github.com/canvural)! # Internals 🔍 - Added ` <file>bin</file> `into `phpcs.xml`, and applied it ([#&#8203;1393](https://github.com/phpstan/phpstan-src/pull/1393), [#&#8203;1394](https://github.com/phpstan/phpstan-src/pull/1394)), thanks [@&#8203;sasezaki](https://github.com/sasezaki)! ### [`v1.7.9`](https://github.com/phpstan/phpstan/releases/tag/1.7.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.8...1.7.9) # Improvements 🔧 - Read PHPDocs from trait stubs ([#&#8203;1390](https://github.com/phpstan/phpstan-src/pull/1390)), [#&#8203;5233](https://github.com/phpstan/phpstan/issues/5233), thanks [@&#8203;canvural](https://github.com/canvural)! - Infer `non-empty-string` on str-casing functions comparison with constant string ([#&#8203;1382](https://github.com/phpstan/phpstan-src/pull/1382)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make trait properties and methods first class node citizens ([#&#8203;1370](https://github.com/phpstan/phpstan-src/pull/1370)), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Support intersection types in `MutatingScope::getTypeToInstantiateForNew()` ([#&#8203;1388](https://github.com/phpstan/phpstan-src/pull/1388)), [#&#8203;7374](https://github.com/phpstan/phpstan/issues/7374), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! ### [`v1.7.8`](https://github.com/phpstan/phpstan/releases/tag/1.7.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.7...1.7.8) # Improvements 🔧 - Update `nikic/php-parser` to 4.14.0 (https://github.com/phpstan/phpstan-src/commit/fbaab8f9a65fb0655b0322c792d914feb399e27e) # Bugfixes 🐛 - Improve unresolved template type checks for complex conditional types ([#&#8203;1377](https://github.com/phpstan/phpstan-src/pull/1377)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - FileCacheStorage - suppress potential file load issue (https://github.com/phpstan/phpstan-src/commit/b73a3962176ddcb6c3ddcd1e6f688900ebe9df1f) - Do not overwrite promoted property PHPDoc with constructor PHPDoc ([#&#8203;1376](https://github.com/phpstan/phpstan-src/pull/1376)), [#&#8203;7361](https://github.com/phpstan/phpstan/issues/7361), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix/native type specification ([#&#8203;1372](https://github.com/phpstan/phpstan-src/pull/1372)), thanks [@&#8203;rajyan](https://github.com/rajyan)! # Function signature fixes 🤖 - Fix signatures of `PDO::pgsqlCopy{From,To}{Array,File}` ([#&#8203;1375](https://github.com/phpstan/phpstan-src/pull/1375)), thanks [@&#8203;takaram](https://github.com/takaram)! ### [`v1.7.7`](https://github.com/phpstan/phpstan/releases/tag/1.7.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.6...1.7.7) # Bugfixes 🐛 - AutoloadFunctionsSourceLocator - avoid ReflectionSourceStubber bugs by trying AutoloadSourceLocator first ([#&#8203;1373](https://github.com/phpstan/phpstan-src/pull/1373)), [#&#8203;7365](https://github.com/phpstan/phpstan/issues/7365), [#&#8203;7360](https://github.com/phpstan/phpstan/issues/7360), [#&#8203;7363](https://github.com/phpstan/phpstan/issues/7363) - BetterReflection - allow class autoloading for `invoke()` etc. (https://github.com/ondrejmirtes/BetterReflection/commit/2a0638be397dfe7aa30a5e530ebf7b59f9c1d4e7), [#&#8203;7333](https://github.com/phpstan/phpstan/issues/7333) ### [`v1.7.6`](https://github.com/phpstan/phpstan/releases/tag/1.7.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.5...1.7.6) # Bugfixes 🐛 - Rewrite the located identifier name with class aliases in mind ([#&#8203;1369](https://github.com/phpstan/phpstan-src/pull/1369)), [#&#8203;7308](https://github.com/phpstan/phpstan/issues/7308) - Class definition from autoloader should be preferred over PhpStorm stubs, [#&#8203;7357](https://github.com/phpstan/phpstan/issues/7357), [#&#8203;3634](https://github.com/phpstan/phpstan/issues/3634) ### [`v1.7.5`](https://github.com/phpstan/phpstan/releases/tag/1.7.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.4...1.7.5) # Bugfixes 🐛 Fixes for more custom autoloader scenarios ([#&#8203;7296](https://github.com/phpstan/phpstan/issues/7296), [#&#8203;7308](https://github.com/phpstan/phpstan/issues/7308)): - Create class reflection from runtime reflection after custom autoloader run ([#&#8203;1368](https://github.com/phpstan/phpstan-src/pull/1368)) - Additional fix to make class aliases work (https://github.com/phpstan/phpstan-src/commit/99acc024f9ac00abe202da492c29cb5081a13d0c) - Include custom autoloaders registered in Composer dependencies (https://github.com/phpstan/phpstan-src/commit/eab4542c4b8877c5f7e85d31d9aa688212f77a77) ### [`v1.7.4`](https://github.com/phpstan/phpstan/releases/tag/1.7.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.3...1.7.4) # Improvements 🔧 - Avoid additional irrelevant constructor-related checks in `UnusedPrivatePropertyRule` ([#&#8203;1360](https://github.com/phpstan/phpstan-src/pull/1360)), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Fix `ConstantArrayType` optional key unsetting via `removeLastElements` ([#&#8203;1366](https://github.com/phpstan/phpstan-src/pull/1366)), [#&#8203;7351](https://github.com/phpstan/phpstan/issues/7351), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `array_walk` callback parameters ([#&#8203;1367](https://github.com/phpstan/phpstan-src/pull/1367)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Always resolve constants with namespace-aware logic (https://github.com/phpstan/phpstan-src/commit/e73f320b57951703927140b7ee27a4fa5da54b90), [#&#8203;7352](https://github.com/phpstan/phpstan/issues/7352) - Use trait property promotion in uninitialized props checks ([#&#8203;1362](https://github.com/phpstan/phpstan-src/pull/1362)), [#&#8203;7314](https://github.com/phpstan/phpstan/issues/7314), thanks [@&#8203;herndlm](https://github.com/herndlm)! - infer `non-empty-string` on `strstr()` comparison with constant string ([#&#8203;1365](https://github.com/phpstan/phpstan-src/pull/1365)), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Fix `stream_bucket_make_writeable` ([#&#8203;1361](https://github.com/phpstan/phpstan-src/pull/1361)), [#&#8203;7341](https://github.com/phpstan/phpstan/issues/7341), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! ### [`v1.7.3`](https://github.com/phpstan/phpstan/releases/tag/1.7.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.2...1.7.3) # Improvements 🔧 - [Docker image](https://phpstan.org/user-guide/docker): default tag uses PHP 8.0, introducing new tag for PHP 8.1 ([#&#8203;7334](https://github.com/phpstan/phpstan/issues/7334)): - `latest` + `latest-php8.0` use PHP 8.0 - `latest-php8.1` uses PHP 8.1 - `1` + `1-php8.0` use PHP 8.0 - `1-php8.1` uses PHP 8.1 - `1.7.3` + `1.7.3-php8.0` use PHP 8.0 - `1.7.3-php8.1` uses PHP 8.1 - `nightly` + `nightly-php8.0` use PHP 8.0 - `nightly-php8.1` uses PHP 8.1 - NodeScopeResolver: call `nodeCallback` for all attribute-related nodes ([#&#8203;1333](https://github.com/phpstan/phpstan-src/pull/1333)), [#&#8203;7071](https://github.com/phpstan/phpstan/issues/7071), thanks [@&#8203;janedbal](https://github.com/janedbal)! - Consistent approach to stubFiles + StubFilesExtension (https://github.com/phpstan/phpstan-src/commit/d3589dc5415f5a639ef68bc9dccd481922df50c5), [#&#8203;7330](https://github.com/phpstan/phpstan/issues/7330) - Consider optional keys in ConstantArrayType removeFirst and removeLast ([#&#8203;1352](https://github.com/phpstan/phpstan-src/pull/1352)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Consider optional keys in `ConstantArrayType::slice` ([#&#8203;1345](https://github.com/phpstan/phpstan-src/pull/1345)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Understand variadic arg type with `@no-named-args` ([#&#8203;1349](https://github.com/phpstan/phpstan-src/pull/1349)), [#&#8203;5968](https://github.com/phpstan/phpstan/issues/5968), thanks [@&#8203;jrmajor](https://github.com/jrmajor)! - Add `ArrayChunkFunctionReturnTypeExtension` ([#&#8203;1356](https://github.com/phpstan/phpstan-src/pull/1356)), [#&#8203;7277](https://github.com/phpstan/phpstan/issues/7277), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - TypeSpecifier - observe `hasSideEffects()` for static methods (https://github.com/phpstan/phpstan-src/commit/1182199bcffbb3f6cd73a1e5058020ecbbcfa02a), [#&#8203;7210](https://github.com/phpstan/phpstan/issues/7210) - Use ReadWritePropertiesExtensions in `MissingReadOnlyPropertyAssignRule` ([#&#8203;1357](https://github.com/phpstan/phpstan-src/pull/1357)), [#&#8203;6632](https://github.com/phpstan/phpstan/issues/6632), [#&#8203;7337](https://github.com/phpstan/phpstan/issues/7337), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Function signature fixes 🤖 - Fix incorrect type for `NumberFormatter:format()` and `NumberFormatter::formatCurrency()` ([#&#8203;1350](https://github.com/phpstan/phpstan-src/pull/1350)), thanks [@&#8203;MartkCz](https://github.com/MartkCz)! ### [`v1.7.2`](https://github.com/phpstan/phpstan/releases/tag/1.7.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.1...1.7.2) # Improvements 🔧 - Specify types from conditional return types ([#&#8203;1343](https://github.com/phpstan/phpstan-src/pull/1343)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Introduce CiDetectedErrorFormatter (https://github.com/phpstan/phpstan-src/commit/86cfb85437e38964154a23d343ade703efa44b6f), [#&#8203;7305](https://github.com/phpstan/phpstan/issues/7305) - Generic `AppendIterator` stub (https://github.com/phpstan/phpstan-src/commit/50cbc45cd5affb88b43efaff4edba39c5449768e), https://github.com/phpstan/phpstan/discussions/7322 # Bugfixes 🐛 - ConsistentConstructorRule - use defined parent constructor to compare ([#&#8203;1344](https://github.com/phpstan/phpstan-src/pull/1344)), [#&#8203;7307](https://github.com/phpstan/phpstan/issues/7307), thanks [@&#8203;canvural](https://github.com/canvural)! - Fix/issue with `isset` / `??` ([#&#8203;1351](https://github.com/phpstan/phpstan-src/pull/1351)), [#&#8203;7318](https://github.com/phpstan/phpstan/issues/7318), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix static reflection issues with custom autoloaders (https://github.com/phpstan/phpstan-src/commit/6962280fde4815cb4eb5870e0d8ba1d4867b4cb0), [#&#8203;7308](https://github.com/phpstan/phpstan/issues/7308), [#&#8203;7306](https://github.com/phpstan/phpstan/issues/7306), [#&#8203;7293](https://github.com/phpstan/phpstan/issues/7293) ### [`v1.7.1`](https://github.com/phpstan/phpstan/releases/tag/1.7.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.7.0...1.7.1) # Improvements 🔧 - Simplify and cleanup `ArraySliceFunctionReturnTypeExtension` ([#&#8203;1341](https://github.com/phpstan/phpstan-src/pull/1341)), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Properly support constant arrays in `array_reverse` ([#&#8203;1342](https://github.com/phpstan/phpstan-src/pull/1342)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - ReflectionSourceStubber - do not make optional parameter without default value available nullable (fixes Phalcon reflection issue) (https://github.com/phpstan/phpstan/commit/7beee3d5db13cb1535915c2ec45d5b656be25f1a, https://github.com/ondrejmirtes/BetterReflection/commit/4495bf122966e316c2e171fcc940aa789f4746e4, https://github.com/phpstan/phpstan-src/commit/c24aa5a165bf7e5bd1cd5edc2a6aedbc238a0de3), [#&#8203;7294](https://github.com/phpstan/phpstan/issues/7294) ### [`v1.7.0`](https://github.com/phpstan/phpstan/releases/tag/1.7.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.9...1.7.0) This release closes **25 issues**! 🥳 # Major new features 🚀 - **Fully static reflection!** ([#&#8203;1265](https://github.com/phpstan/phpstan-src/pull/1265)) - PHPStan used runtime reflection before June 2020 (https://phpstan.org/blog/zero-config-analysis-with-static-reflection) and hybrid reflection after that - Analysed code is no longer executed, except for files referenced in `bootstrapFiles` and `files` sections in Composer `autoload` configuration - This prevents various fatal errors during analysis - Also solves edge cases like [#&#8203;7077](https://github.com/phpstan/phpstan/issues/7077), [#&#8203;7019](https://github.com/phpstan/phpstan/issues/7019) - Native reflection is always `BetterReflection` adapter (https://github.com/phpstan/phpstan-src/pull/1265/commits/ef603397df6036647f6b030407b3316159dc330f) - Global constants no longer have to be defined in `bootstrapFiles` ([#&#8203;1277](https://github.com/phpstan/phpstan-src/pull/1277), [#&#8203;1282](https://github.com/phpstan/phpstan-src/pull/1282)), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Implement `@phpstan-consistent-constructor` and add a new rule as another way to supress `new static()` issues ([#&#8203;1296](https://github.com/phpstan/phpstan-src/pull/1296)), thanks [@&#8203;canvural](https://github.com/canvural)! - See the update article: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static - Offset/index access PHPDoc type (https://github.com/phpstan/phpdoc-parser/pull/119, [#&#8203;1318](https://github.com/phpstan/phpstan-src/pull/1318)), [#&#8203;7094](https://github.com/phpstan/phpstan/issues/7094), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Bleeding edge 🔪 - Unresolvable parameters ([#&#8203;1319](https://github.com/phpstan/phpstan-src/pull/1319)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support `@readonly` property and `@immutable` class PHPDoc ([#&#8203;1295](https://github.com/phpstan/phpstan-src/pull/1295), [#&#8203;1335](https://github.com/phpstan/phpstan-src/pull/1335)), [#&#8203;4082](https://github.com/phpstan/phpstan/issues/4082), thanks [@&#8203;herndlm](https://github.com/herndlm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - Allow setting error format in configuration file ([#&#8203;841](https://github.com/phpstan/phpstan-src/pull/841)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Deprecated `PHPStan\Type\ConstantTypeHelper::getTypeFromValue()`. Instead of going from runtime value -> PHPStan type, use `PHPStan\Reflection\InitializerExprTypeResolver::getType()` to go from Expr -> PHPStan type. In case you have `Scope` available, use `Scope::getType()`. - Read default values from php-8-stubs and jetbrains/phpstorm-stubs (https://github.com/phpstan/phpstan-src/commit/7ce177e71b7f6b363d07585015ed2e2c08e9a32e) - Normalize named arguments when calling extensions ([#&#8203;1301](https://github.com/phpstan/phpstan-src/pull/1301), [#&#8203;1313](https://github.com/phpstan/phpstan-src/pull/1313)), [#&#8203;5866](https://github.com/phpstan/phpstan/issues/5866), thanks [@&#8203;staabm](https://github.com/staabm)! - implement str-case functions return type extension ([#&#8203;1325](https://github.com/phpstan/phpstan-src/pull/1325)), thanks [@&#8203;staabm](https://github.com/staabm)! - ClearResultCacheCommand: allow `--debug` flag (https://github.com/phpstan/phpstan-src/commit/5f5b96d432207395dc7371f62a9d52081f56a405) # Bugfixes 🐛 - Fix `get_class` on enum case ([#&#8203;1272](https://github.com/phpstan/phpstan-src/pull/1272)), [#&#8203;7167](https://github.com/phpstan/phpstan/issues/7167), thanks [@&#8203;olsavmic](https://github.com/olsavmic)! - Keep template types when using `::class` ([#&#8203;1271](https://github.com/phpstan/phpstan-src/pull/1271)), [#&#8203;6864](https://github.com/phpstan/phpstan/issues/6864), [#&#8203;6986](https://github.com/phpstan/phpstan/issues/6986), thanks [@&#8203;olsavmic](https://github.com/olsavmic)! - Fix supertype checks for conditional types ([#&#8203;1287](https://github.com/phpstan/phpstan-src/pull/1287)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Fix using `value-of`/`key-of` with template types ([#&#8203;1288](https://github.com/phpstan/phpstan-src/pull/1288)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Invalidate `openssl_error_string` after openssl function calls ([#&#8203;1292](https://github.com/phpstan/phpstan-src/pull/1292)), [#&#8203;7106](https://github.com/phpstan/phpstan/issues/7106), thanks [@&#8203;pbourdet](https://github.com/pbourdet)! - Fix initializer expr ConstFetch (https://github.com/phpstan/phpstan-src/commit/761d1168224f5fdda4ffa0c5ba7d8069f6a79987), [#&#8203;4950](https://github.com/phpstan/phpstan/issues/4950) - Fix various things around `isset()` and `ArrayDimFetch` ([#&#8203;1307](https://github.com/phpstan/phpstan-src/pull/1307)), [#&#8203;6508](https://github.com/phpstan/phpstan/issues/6508), [#&#8203;7000](https://github.com/phpstan/phpstan/issues/7000), [#&#8203;7190](https://github.com/phpstan/phpstan/issues/7190), [#&#8203;7144](https://github.com/phpstan/phpstan/issues/7144), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix call to `DatePeriod` constructor with named arguments (https://github.com/phpstan/phpstan-src/commit/59453678ac863bd3293e03fe355e0f17a33783b9), [#&#8203;7048](https://github.com/phpstan/phpstan/issues/7048), [#&#8203;5553](https://github.com/phpstan/phpstan/issues/5553) - Prevent redundant messages about missing iterable types in conditional target/subject ([#&#8203;1314](https://github.com/phpstan/phpstan-src/pull/1314)), [#&#8203;7215](https://github.com/phpstan/phpstan/issues/7215), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - StubSourceLocatorFactory - read files from StubFilesExtension (https://github.com/phpstan/phpstan-src/commit/0ecddcca760fc220b1a907d921b2d2c02809551f) - improve `is_subclass_of` type checks ([#&#8203;1321](https://github.com/phpstan/phpstan-src/pull/1321)), [#&#8203;2755](https://github.com/phpstan/phpstan/issues/2755), thanks [@&#8203;staabm](https://github.com/staabm)! - allow `$isOffsetAccessible->maybe()` for isUndefinedExpressionAllowed and isSpecified expression ([#&#8203;1312](https://github.com/phpstan/phpstan-src/pull/1312)), [#&#8203;7229](https://github.com/phpstan/phpstan/issues/7229), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix constant array comparison for optional keys ([#&#8203;1324](https://github.com/phpstan/phpstan-src/pull/1324)), [#&#8203;7248](https://github.com/phpstan/phpstan/issues/7248), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Simplify resolving constant scalar identical expressions ([#&#8203;1329](https://github.com/phpstan/phpstan-src/pull/1329)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Use `ConstructorsHelper` in `ReadOnlyByPhpDocPropertyAssignRule` and `ReadOnlyPropertyAssignRule` ([#&#8203;1328](https://github.com/phpstan/phpstan-src/pull/1328)), [#&#8203;6612](https://github.com/phpstan/phpstan/issues/6612), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Class attributes should also be included in class statements ([#&#8203;1338](https://github.com/phpstan/phpstan-src/pull/1338)), [#&#8203;7116](https://github.com/phpstan/phpstan/issues/7116), thanks [@&#8203;bartv2](https://github.com/bartv2)! - Use trait properties in uninitialized props checks ([#&#8203;1340](https://github.com/phpstan/phpstan-src/pull/1340)), [#&#8203;7219](https://github.com/phpstan/phpstan/issues/7219), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve `array_reverse` with constant arrays ([#&#8203;1337](https://github.com/phpstan/phpstan-src/pull/1337)), [#&#8203;7278](https://github.com/phpstan/phpstan/issues/7278), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Function signature fixes 🤖 - Replace `var_export()` extension with conditional-type stub ([#&#8203;1244](https://github.com/phpstan/phpstan-src/pull/1244)), thanks [@&#8203;staabm](https://github.com/staabm)! - Use conditional types for `is_a()` via stub ([#&#8203;1310](https://github.com/phpstan/phpstan/issues/1310)) ([#&#8203;1310](https://github.com/phpstan/phpstan-src/pull/1310), [#&#8203;1311](https://github.com/phpstan/phpstan-src/pull/1311)), [#&#8203;4371](https://github.com/phpstan/phpstan/issues/4371), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow the type for the `mb_ereg_replace_callback()` callable. ([#&#8203;1316](https://github.com/phpstan/phpstan-src/pull/1316)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Add an array shape for the elements returned by `DateTimeZone::getTransitions()`. ([#&#8203;1315](https://github.com/phpstan/phpstan-src/pull/1315)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Fix incorrect argument for `RedisCluster::getOption()` and `RedisCluster::setOption()` ([#&#8203;1334](https://github.com/phpstan/phpstan-src/pull/1334)), thanks [@&#8203;taka-oyama](https://github.com/taka-oyama)! ### [`v1.6.9`](https://github.com/phpstan/phpstan/releases/tag/1.6.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.8...1.6.9) # Bugfixes 🐛 - Fix endless recursion with nested traits via anonymous classes ([#&#8203;1303](https://github.com/phpstan/phpstan-src/pull/1303)), [#&#8203;7214](https://github.com/phpstan/phpstan/issues/7214), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Support string accessory types in `BitwiseNot` ([#&#8203;1266](https://github.com/phpstan/phpstan-src/pull/1266)), thanks [@&#8203;staabm](https://github.com/staabm)! - infer `non-empty-string` on `substr()` comparison with constant string ([#&#8203;1259](https://github.com/phpstan/phpstan-src/pull/1259)), [#&#8203;6792](https://github.com/phpstan/phpstan/issues/6792), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix invalidating conditional expressions after `ArrayDimFetch` unset (https://github.com/phpstan/phpstan-src/commit/cc640d797c201b5de0ac00f8e1bdf22a5707928f) ### [`v1.6.8`](https://github.com/phpstan/phpstan/releases/tag/1.6.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.7...1.6.8) # Bugfixes 🐛 - Support narrowing types via `in_array()` for enum cases ([#&#8203;1291](https://github.com/phpstan/phpstan-src/pull/1291)), [#&#8203;7176](https://github.com/phpstan/phpstan/issues/7176), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix checking of generic attributes (https://github.com/phpstan/phpstan-src/commit/361e064d4b92119fb98bb96143a2b3bd4105dd90), [#&#8203;7171](https://github.com/phpstan/phpstan/issues/7171), [#&#8203;7208](https://github.com/phpstan/phpstan/issues/7208) ### [`v1.6.7`](https://github.com/phpstan/phpstan/releases/tag/1.6.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.6...1.6.7) - Make `DateTime(Immutable)::modify()` behaviour less annoying (https://github.com/phpstan/phpstan-src/commit/7bd9fb7285ee8cab34dac2d29f84485ad3c40643) ### [`v1.6.6`](https://github.com/phpstan/phpstan/releases/tag/1.6.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.5...1.6.6) # Improvements 🔧 - OptimizedPsrAutoloaderLocator - look for other symbols in already scanned files (https://github.com/phpstan/phpstan-src/commit/e40474b3fcd27e5a2b37b8f6add8e7ad906db019), [#&#8203;7157](https://github.com/phpstan/phpstan/issues/7157), [#&#8203;7112](https://github.com/phpstan/phpstan/issues/7112) - Bleeding Edge: Move IllegalConstructorMethodCallRule and IllegalConstructorStaticCallRule to phpstan-strict-rules (https://github.com/phpstan/phpstan-src/commit/124b30f98c182193187be0b9c2e151e477429b7a, https://github.com/phpstan/phpstan-strict-rules/commit/0c82c96f2a55d8b91bbc7ee6512c94f68a206b43) - Add DateTimeModifyReturnTypeExtension ([#&#8203;1267](https://github.com/phpstan/phpstan-src/pull/1267)), [#&#8203;4927](https://github.com/phpstan/phpstan/issues/4927), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! # Bugfixes 🐛 - Fix return type of `DateTime(Immutable)::modify()` (https://github.com/phpstan/phpstan-src/commit/b5da7cea2acb069249f474053e430559ef913280), [#&#8203;6609](https://github.com/phpstan/phpstan/issues/6609) ### [`v1.6.5`](https://github.com/phpstan/phpstan/releases/tag/1.6.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.4...1.6.5) # Improvements 🔧 - Implement conditional parameter types ([#&#8203;1264](https://github.com/phpstan/phpstan-src/pull/1264)), [#&#8203;7124](https://github.com/phpstan/phpstan/issues/7124), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Narrow type of `json_decode` ([#&#8203;993](https://github.com/phpstan/phpstan-src/pull/993)), thanks [@&#8203;TomasVotruba](https://github.com/TomasVotruba) and [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Fix Rector autoloading issue (https://github.com/phpstan/phpstan-src/commit/46f51e71c32b79313e36e6fd26fba94e6e8c70db), [#&#8203;7150](https://github.com/phpstan/phpstan/issues/7150) - Make `$conditionalExpressions` key consistent in all usages ([#&#8203;1270](https://github.com/phpstan/phpstan-src/pull/1270)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Do not call `TypeSpecifier::specifyTypesInCondition` with a non-null context in case the original context is null ([#&#8203;1275](https://github.com/phpstan/phpstan-src/pull/1275)), [#&#8203;7166](https://github.com/phpstan/phpstan/issues/7166), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add throw point for division by zero ([#&#8203;1280](https://github.com/phpstan/phpstan-src/pull/1280)), [#&#8203;6349](https://github.com/phpstan/phpstan/issues/6349), thanks [@&#8203;rajyan](https://github.com/rajyan)! ### [`v1.6.4`](https://github.com/phpstan/phpstan/releases/tag/1.6.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.3...1.6.4) # Improvements 🔧 - Generating baseline preserves the number of newlines at the end of the file ([#&#8203;1243](https://github.com/phpstan/phpstan-src/pull/1243)), thanks [@&#8203;VasekPurchart](https://github.com/VasekPurchart)! - Infer `non-empty-string` on `literal-string and` `strlen()` ([#&#8203;1260](https://github.com/phpstan/phpstan-src/pull/1260)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - AutoloadSourceLocator - fix opcache corruption (https://github.com/phpstan/phpstan-src/commit/ae53760a875a118131df949a7547fb9f1a55e904), [#&#8203;7151](https://github.com/phpstan/phpstan/issues/7151) - FileReadTrapStreamWrapper - be aware of multiple files (https://github.com/phpstan/phpstan-src/commit/28eaba24ac21097fb8f2b5f738db9c090e4d6443), [#&#8203;7151](https://github.com/phpstan/phpstan/issues/7151) ### [`v1.6.3`](https://github.com/phpstan/phpstan/releases/tag/1.6.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.2...1.6.3) # Improvements 🔧 - Handle ConstantArrayType === ConstantArrayType (https://github.com/phpstan/phpstan-src/commit/6e02453df3b991d3c17fb54dbfafc9e6c8d1e7a0) - Handle ConstantArrayType == ConstantArrayType (https://github.com/phpstan/phpstan-src/commit/c9ae89cab4ea23b0c867fd5162bd5b3022331aa3) - Understand == between ConstantScalarType (https://github.com/phpstan/phpstan-src/commit/5c85200c977101a57a3910f1c10b872093fe5b47) - Use root expression when checking impossible types ([#&#8203;1254](https://github.com/phpstan/phpstan-src/pull/1254)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - implemented `str_contains` FunctionTypeSpecifyingExtension ([#&#8203;1068](https://github.com/phpstan/phpstan-src/pull/1068)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bleeding edge 🔪 - ConstantLooseComparisonRule - level 4 (https://github.com/phpstan/phpstan-src/commit/6ebf2361a3c831dd105a815521889428c295dc9f) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix first-class callable internal error (https://github.com/phpstan/phpstan-src/commit/3f75d8ac0c43650a77b0774810cb79802db016aa), [#&#8203;7135](https://github.com/phpstan/phpstan/issues/7135) ### [`v1.6.2`](https://github.com/phpstan/phpstan/releases/tag/1.6.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.1...1.6.2) # Improvements 🔧 - Remove unneeded continue in `array_push` / `array_unset` arg handling ([#&#8203;1252](https://github.com/phpstan/phpstan-src/pull/1252)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - BaselineNeonErrorFormatter does not need to implement ErrorFormatter interface (https://github.com/phpstan/phpstan-src/commit/3a3c69eb93851fdb10dd360770e6d0bf5e65f827) # Bugfixes 🐛 - Fix TypeError with `constUses` in ExportedPhpDocNode (https://github.com/phpstan/phpstan-src/commit/3fe27268f6a32cb3303711f23bf45da1ed1948be), [#&#8203;7130](https://github.com/phpstan/phpstan/issues/7130) - Do not report unnecessary nullsafe property fetch inside `??` / `isset` / `empty`, report it in bleedingEdge with different message ([#&#8203;1253](https://github.com/phpstan/phpstan-src/pull/1253), https://github.com/phpstan/phpstan-src/commit/54f15441eba3907c4ff056f6dafb1c2801a6b766), [#&#8203;7109](https://github.com/phpstan/phpstan/issues/7109), thanks [@&#8203;rajyan](https://github.com/rajyan)! ### [`v1.6.1`](https://github.com/phpstan/phpstan/releases/tag/1.6.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.6.0...1.6.1) # Bugfixes 🐛 - Be more resilient against non-existent traits and interfaces (https://github.com/ondrejmirtes/BetterReflection/commit/72bb30507092beca32ed3ab021a0de1f685bbd54), [#&#8203;7112](https://github.com/phpstan/phpstan/issues/7112) - Fix `BackedEnum::from()` and `tryFrom()` methods (https://github.com/phpstan/phpstan-src/commit/e97439c5987fc7747b68d3617a128fad68102642), [#&#8203;7096](https://github.com/phpstan/phpstan/issues/7096) - ConditionalReturnTypeRuleHelper - increase type description verbosity (https://github.com/phpstan/phpstan-src/commit/2f49187491aa034d37d2728deb4ee8f5e1102aa6), [#&#8203;7111](https://github.com/phpstan/phpstan/issues/7111) - Fix ConstantArrayType for optional/non-optional keys ([#&#8203;1249](https://github.com/phpstan/phpstan-src/pull/1249)), [#&#8203;7111](https://github.com/phpstan/phpstan/issues/7111), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - AutoloadSourceLocator - store the first included file (https://github.com/phpstan/phpstan-src/commit/63ef0a9eb76cb25e85ff1966c2011dd4c5d1892a), [#&#8203;7113](https://github.com/phpstan/phpstan/issues/7113) - Fix `array_push` / `array_unshift` with unpacked non-constant array types ([#&#8203;1247](https://github.com/phpstan/phpstan-src/pull/1247)), [#&#8203;7115](https://github.com/phpstan/phpstan/issues/7115), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.6.0`](https://github.com/phpstan/phpstan/releases/tag/1.6.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.7...1.6.0) [**Read the article about PHPStan 1.6.0 »**](https://phpstan.org/blog/phpstan-1-6-0-with-conditional-return-types) # Major new features 🚀 - **Conditonal return types** ([pull requests](https://github.com/phpstan/phpstan-src/pulls?q=is%3Apr+is%3Aclosed+author%3Arvanvelzen+conditional)), [#&#8203;3853](https://github.com/phpstan/phpstan/issues/3853), big thanks to [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Allows return types in the form of `@return ($i is positive-int ? non-empty-array : array)` (don't forget the parentheses!) - Another possible form is with generic `@template` tags: `@return (T is positive-int ? non-empty-array : array)` - `int-mask<...>` and `int-mask-of<...>` types ([#&#8203;1166](https://github.com/phpstan/phpstan-src/pull/1166)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Allow global constants as PHPDoc types ([#&#8203;1163](https://github.com/phpstan/phpstan-src/pull/1163)), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Update `php-8-stubs` to know about PHP 8.1 function signature changes, [#&#8203;7017](https://github.com/phpstan/phpstan/issues/7017), [#&#8203;6448](https://github.com/phpstan/phpstan/issues/6448) - Make `isset()` and null-coalesce (`??`) operators consistent with each other ([#&#8203;1223](https://github.com/phpstan/phpstan-src/pull/1223)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - New option `checkDynamicProperties` to restore the original stricter behaviour ([#&#8203;1234](https://github.com/phpstan/phpstan-src/pull/1234)), thanks [@&#8203;rajyan](https://github.com/rajyan)! # Bleeding edge 🔪 - Fully static reflection engine - After feedback is gathered and processed, this will be enabled for everyone later in PHPStan 1.x release cycle. - Lower memory consumption thanks to breaking up of reference cycles - This is a BC break for rules that use `'parent'`, `'next'`, and `'previous'` node attributes. [Learn more »](https://phpstan.org/blog/preprocessing-ast-for-custom-rules) - In testing the memory consumption was reduced by 50–70 %. - ArrayUnpackingRule (level 3) ([#&#8203;856](https://github.com/phpstan/phpstan-src/pull/856)), thanks [@&#8203;canvural](https://github.com/canvural)! - Rules for checking direct calls to `__construct()` (level 2) ([#&#8203;1208](https://github.com/phpstan/phpstan-src/pull/1208)), [#&#8203;7022](https://github.com/phpstan/phpstan/issues/7022), thanks [@&#8203;muno92](https://github.com/muno92)! - `checkMissingIterableValueType: false` no longer does anything (https://github.com/phpstan/phpstan-src/commit/50d0c8e23ea85da508ab8481f1ff2c89148cc80b) *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Improvements 🔧 - EnumCaseObjectType cannot be compared in a numeric sense (https://github.com/phpstan/phpstan-src/commit/f7d80d6c130d0294d8df7bbdb8172fd22b71b173), [#&#8203;7052](https://github.com/phpstan/phpstan/issues/7052) - StatementResult is part of BC promise (https://github.com/phpstan/phpstan-src/commit/796c9d5f85736de214cad0ff7058eec83967429c), [#&#8203;7075](https://github.com/phpstan/phpstan/issues/7075) # Bugfixes 🐛 - Fix uncaught LogicException from phpdoc-parser (https://github.com/phpstan/phpstan-src/commit/b95949a0bfbec85dab19b5109d04806ed748d70a), [#&#8203;7030](https://github.com/phpstan/phpstan/issues/7030) - Fix issue with dynamic properties ([#&#8203;1237](https://github.com/phpstan/phpstan-src/pull/1237)), [#&#8203;3171](https://github.com/phpstan/phpstan/issues/3171), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Class with final doesn't mean dynamic property is prohibited ([#&#8203;1238](https://github.com/phpstan/phpstan-src/pull/1238)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix `isset()` with multiple arguments ([#&#8203;1240](https://github.com/phpstan/phpstan-src/pull/1240)), [#&#8203;3601](https://github.com/phpstan/phpstan/issues/3601), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Match expression `isset()` fix (https://github.com/phpstan/phpstan-src/commit/3c7d9c8dcf6a01a2dc5c9b606577dcf87fb8ad65), [#&#8203;7095](https://github.com/phpstan/phpstan/issues/7095) # Function signature fixes 🤖 - Fix `json_decode` error return type ([#&#8203;1235](https://github.com/phpstan/phpstan-src/pull/1235)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add return type extension for `mb_strlen` ([#&#8203;1211](https://github.com/phpstan/phpstan-src/pull/1211)), thanks [@&#8203;fluffycondor](https://github.com/fluffycondor)! - `db2_last_insert_id` may return NULL ([#&#8203;1214](https://github.com/phpstan/phpstan-src/pull/1214)), thanks [@&#8203;morozov](https://github.com/morozov)! - Fix `SimpleXMLElement::addChild` signature ([#&#8203;1215](https://github.com/phpstan/phpstan-src/pull/1215)), thanks [@&#8203;szepeviktor](https://github.com/szepeviktor)! - Make the type signatures of some hash functions more specific ([#&#8203;1224](https://github.com/phpstan/phpstan-src/pull/1224)), thanks [@&#8203;oliverklee](https://github.com/oliverklee)! - Do benevolent union for `SimpleXMLElement::children()` (https://github.com/phpstan/phpstan-src/commit/3a2f1058b11d56eba95f207da71080827f63ed4d) ### [`v1.5.7`](https://github.com/phpstan/phpstan/releases/tag/1.5.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.6...1.5.7) # Bugfixes 🐛 - Fix `array_merge` with numeric keys ([#&#8203;1218](https://github.com/phpstan/phpstan-src/pull/1218)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `ConstantArrayTypeBuilder` optional keys via `setOffsetValueType` ([#&#8203;1225](https://github.com/phpstan/phpstan-src/pull/1225)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `array_push` with an empty constant array ([#&#8203;1210](https://github.com/phpstan/phpstan-src/pull/1210)), [#&#8203;6974](https://github.com/phpstan/phpstan/issues/6974), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix `array_push` / `array_unshift` with `ConstantArrayType` arguments ([#&#8203;1232](https://github.com/phpstan/phpstan-src/pull/1232)), [#&#8203;5783](https://github.com/phpstan/phpstan/issues/5783), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix variadic parameters for generics (https://github.com/phpstan/phpstan-src/commit/f091c5629a48620972c657993032522def8a840d), [#&#8203;7068](https://github.com/phpstan/phpstan/issues/7068) - PHPStan Pro download API - pass current PHP version (https://github.com/phpstan/phpstan-src/commit/9044bfc33d254858ce44969848230477cb8f3ca7) - PHPStan Pro - fix for potential issues on temp files (https://github.com/phpstan/phpstan-src/commit/2a145bad4e3d171e3a917e0f1f3e757bd5a6c523) - Improve variadic parameter support in `array_merge` ([#&#8203;1233](https://github.com/phpstan/phpstan-src/pull/1233)), thanks [@&#8203;herndlm](https://github.com/herndlm)! ### [`v1.5.6`](https://github.com/phpstan/phpstan/releases/tag/1.5.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.5...1.5.6) This release enables to write forward-compatible custom rules with PHPStan 1.6.0+Bleeding Edge. Detailed instructions are here: https://phpstan.org/blog/preprocessing-ast-for-custom-rules - Allow registering of custom rich parser node visitors (https://github.com/phpstan/phpstan-src/commit/b0dafcc4921bb6e3b0e5db5065b4989c3b350bab) ### [`v1.5.5`](https://github.com/phpstan/phpstan/releases/tag/1.5.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.4...1.5.5) # Improvements 🔧 - Remove unnecessary `ConstantArrayType::getKeyType()` ([#&#8203;1173](https://github.com/phpstan/phpstan-src/pull/1173)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve `ConstantArrayType` union performance ([#&#8203;1176](https://github.com/phpstan/phpstan-src/pull/1176)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Do not evaluate constructors as having side effects by default, Handle side effects of constructors in `new` ([#&#8203;1205](https://github.com/phpstan/phpstan-src/pull/1205)), thanks [@&#8203;VasekPurchart](https://github.com/VasekPurchart)! # Bleeding edge 🔪 - Specify explicit mixed array type via `is_array` ([#&#8203;1191](https://github.com/phpstan/phpstan-src/pull/1191)), thanks [@&#8203;herndlm](https://github.com/herndlm)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - Fix `curl_getinfo($ch, CURLINFO_CONTENT_TYPE)` ([#&#8203;1170](https://github.com/phpstan/phpstan-src/pull/1170)), [#&#8203;6929](https://github.com/phpstan/phpstan/issues/6929), thanks [@&#8203;oschwald](https://github.com/oschwald)! - Fix return types for `bcdiv()`, `bcmod()`, `bcpowmod()` and `bcsqrt()` in PHP 8.0 and higher ([#&#8203;1152](https://github.com/phpstan/phpstan-src/pull/1152)), [#&#8203;5134](https://github.com/phpstan/phpstan/issues/5134), thanks [@&#8203;W0rma](https://github.com/W0rma)! - Add support for `int` and `bool` args for `strlen()` ([#&#8203;1162](https://github.com/phpstan/phpstan-src/pull/1162)), thanks [@&#8203;fluffycondor](https://github.com/fluffycondor)! - Add support for `float` and `null` for `strlen()`, improve support for booleans ([#&#8203;1199](https://github.com/phpstan/phpstan-src/pull/1199)), thanks [@&#8203;fluffycondor](https://github.com/fluffycondor)! - Feature/undefined expression allowed ([#&#8203;1174](https://github.com/phpstan/phpstan-src/pull/1174)), [#&#8203;6107](https://github.com/phpstan/phpstan/issues/6107), [#&#8203;5971](https://github.com/phpstan/phpstan/issues/5971), [#&#8203;5337](https://github.com/phpstan/phpstan/issues/5337), [#&#8203;6899](https://github.com/phpstan/phpstan/issues/6899), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix/coalesce simulate ternary ([#&#8203;1193](https://github.com/phpstan/phpstan-src/pull/1193)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Support variadic parameter in `array_replace` ([#&#8203;1209](https://github.com/phpstan/phpstan-src/pull/1209)), [#&#8203;7020](https://github.com/phpstan/phpstan/issues/7020), thanks [@&#8203;herndlm](https://github.com/herndlm)! - ObjectType - fix imprecise cache key issue (https://github.com/phpstan/phpstan-src/commit/ee934468b707f46d0416bba7b89cc33d3a0d7cd7), [#&#8203;6944](https://github.com/phpstan/phpstan/issues/6944) - Fix int overflow internal error (https://github.com/phpstan/phpstan-src/commit/c5d0902d2b3fbf8f00913002f9ba72b6caa929a0), [#&#8203;6979](https://github.com/phpstan/phpstan/issues/6979) # Function signature fixes 🤖 - `DOMText::splitText()` may return false ([#&#8203;1180](https://github.com/phpstan/phpstan-src/pull/1180)), thanks [@&#8203;xPaw](https://github.com/xPaw)! - `Collator` creation function/method can return null ([#&#8203;1182](https://github.com/phpstan/phpstan-src/pull/1182)), thanks [@&#8203;finwe](https://github.com/finwe)! - Fix return signature of `SplObjectStorage` methods ([#&#8203;1185](https://github.com/phpstan/phpstan-src/pull/1185)), thanks [@&#8203;Furgas](https://github.com/Furgas)! - Fix return signature of `SimpleXMLElement::getDocNamespaces` ([#&#8203;1190](https://github.com/phpstan/phpstan-src/pull/1190)), thanks [@&#8203;Furgas](https://github.com/Furgas)! ### [`v1.5.4`](https://github.com/phpstan/phpstan/releases/tag/1.5.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.3...1.5.4) # Bugfixes 🐛 - Support named arguments when resolving template parameters ([#&#8203;1151](https://github.com/phpstan/phpstan-src/pull/1151)), [#&#8203;5262](https://github.com/phpstan/phpstan/issues/5262), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Various fixes for constant arrays ([#&#8203;1154](https://github.com/phpstan/phpstan-src/pull/1154)), [#&#8203;4308](https://github.com/phpstan/phpstan/issues/4308), [#&#8203;6965](https://github.com/phpstan/phpstan/issues/6965), [#&#8203;6961](https://github.com/phpstan/phpstan/issues/6961), [#&#8203;6383](https://github.com/phpstan/phpstan/issues/6383), [#&#8203;5933](https://github.com/phpstan/phpstan/issues/5933), [#&#8203;5382](https://github.com/phpstan/phpstan/issues/5382), [#&#8203;6379](https://github.com/phpstan/phpstan/issues/6379), [#&#8203;3284](https://github.com/phpstan/phpstan/issues/3284) - Fix for arrays not being accepted when having an accessory type (https://github.com/phpstan/phpstan-src/commit/843ebbb1d889ac4d9a152a52f1f1ee9690d2e721), [#&#8203;6552](https://github.com/phpstan/phpstan/issues/6552) - Avoid describing ConstantArrayType values twice ([#&#8203;1168](https://github.com/phpstan/phpstan-src/pull/1168), [#&#8203;1169](https://github.com/phpstan/phpstan-src/pull/1169)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix false positive `UnhandledMatchError` throw point ([#&#8203;1165](https://github.com/phpstan/phpstan-src/pull/1165)), [#&#8203;6910](https://github.com/phpstan/phpstan/issues/6910), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix `in_array()` bug (https://github.com/phpstan/phpstan-src/commit/0ae28f761b2e0d473224aded78960d3d96b4e31e) - Various optimization attempts (https://github.com/phpstan/phpstan-src/commit/91c7507787b4a9a63568562cda35644f139460c2, https://github.com/phpstan/phpstan-src/commit/5400b5858ef1750ede656dffc894acbbbc228e88, https://github.com/phpstan/phpstan-src/commit/c4c64fe6dae985d196aea92f3b7eca40e70c7ef4) # Function signature fixes 🤖 - added `show_source()` signature, an alias of `highlight_file()` ([#&#8203;1160](https://github.com/phpstan/phpstan-src/pull/1160)), thanks [@&#8203;staabm](https://github.com/staabm)! - more precise `getenv()` signature ([#&#8203;1161](https://github.com/phpstan/phpstan-src/pull/1161)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.5.3`](https://github.com/phpstan/phpstan/releases/tag/1.5.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.2...1.5.3) # Improvements 🔧 - Update phpdoc-parser with multi-line union/intersection/conditional types support (https://github.com/phpstan/phpstan-src/commit/6fa7c9097d060e7eddd81adf7a6809eb94a221a6), https://github.com/phpstan/phpdoc-parser/pull/114, thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Bugfixes 🐛 - Mark `Memcached::HAVE_*` constants as dynamic ([#&#8203;1142](https://github.com/phpstan/phpstan-src/pull/1142)), [#&#8203;6263](https://github.com/phpstan/phpstan/issues/6263), thanks [@&#8203;VasekPurchart](https://github.com/VasekPurchart)! - Improve return types for `array_fill_keys` and `array_combine` ([#&#8203;1139](https://github.com/phpstan/phpstan-src/pull/1139)), thanks [@&#8203;canvural](https://github.com/canvural)! - Guard `Equal` (`==`) expression specification with empty array on both sides ([#&#8203;1143](https://github.com/phpstan/phpstan-src/pull/1143)), [#&#8203;6940](https://github.com/phpstan/phpstan/issues/6940), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix huge union types result from "+"-array-merge operation ([#&#8203;1141](https://github.com/phpstan/phpstan-src/pull/1141)), [#&#8203;6936](https://github.com/phpstan/phpstan/issues/6936), thanks [@&#8203;staabm](https://github.com/staabm)! - Improve return type of `array_fill_keys` for not constant arrays ([#&#8203;1145](https://github.com/phpstan/phpstan-src/pull/1145)), thanks [@&#8203;canvural](https://github.com/canvural)! - Handle `false` return in `substr()` with PHP < 8 ([#&#8203;1144](https://github.com/phpstan/phpstan-src/pull/1144)), [#&#8203;6939](https://github.com/phpstan/phpstan/issues/6939), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `array_merge` lost non-empty-string keys type ([#&#8203;1135](https://github.com/phpstan/phpstan-src/pull/1135)), [#&#8203;6927](https://github.com/phpstan/phpstan/issues/6927), [#&#8203;5846](https://github.com/phpstan/phpstan/issues/5846), [#&#8203;2567](https://github.com/phpstan/phpstan/issues/2567), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.5.2`](https://github.com/phpstan/phpstan/releases/tag/1.5.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.1...1.5.2) # Bugfixes 🐛 - Fix infinite recursion when caching types ([#&#8203;1137](https://github.com/phpstan/phpstan-src/pull/1137)), [#&#8203;6896](https://github.com/phpstan/phpstan/issues/6896), [#&#8203;6911](https://github.com/phpstan/phpstan/issues/6911) - Fixing bugs by removing caching 😂 - Timewise performance optimizations (https://github.com/phpstan/phpstan-src/commit/22f755c6a0bf5fd551634419680070fabf571a07) - Offseting the removal of PHPDocs cache ### [`v1.5.1`](https://github.com/phpstan/phpstan/releases/tag/1.5.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.5.0...1.5.1) # Bugfixes 🐛 - `is_subclass_of()`: do not infer anything when context is falsy ([#&#8203;1124](https://github.com/phpstan/phpstan-src/pull/1124)), [#&#8203;6891](https://github.com/phpstan/phpstan/issues/6891), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Fix inferring template types on intersection types ([#&#8203;1122](https://github.com/phpstan/phpstan-src/pull/1122)), [#&#8203;6904](https://github.com/phpstan/phpstan/issues/6904), [#&#8203;6917](https://github.com/phpstan/phpstan/issues/6917), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! # Function signature fixes 🤖 - more precise `getTrace()` return-type ([#&#8203;1123](https://github.com/phpstan/phpstan-src/pull/1123)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix type definition of curl "certinfo" array ([#&#8203;1118](https://github.com/phpstan/phpstan-src/pull/1118)), thanks [@&#8203;cs278](https://github.com/cs278)! - Update various DB functions for more specific row counts ([#&#8203;1116](https://github.com/phpstan/phpstan-src/pull/1116)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - small signature update ([#&#8203;1126](https://github.com/phpstan/phpstan-src/pull/1126)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - tests: use unique namespace to prevent collisions ([#&#8203;1119](https://github.com/phpstan/phpstan-src/pull/1119)), thanks [@&#8203;staabm](https://github.com/staabm)! - ParaTest: leverage WrapperRunner for quicker tests ([#&#8203;1115](https://github.com/phpstan/phpstan-src/pull/1115)), thanks [@&#8203;Slamdunk](https://github.com/Slamdunk)! - LevelsTestCase performance improvement - clear result cache just once (https://github.com/phpstan/phpstan-src/commit/0a3e1a79738070c95e3a69406b33d9277a49840c) - Update phpdoc-parser to 1.4 (https://github.com/phpstan/phpstan-src/commit/6700eb69c1566190f3cad75fd5fa3edba64fce8e, https://github.com/phpstan/phpstan-src/commit/a3a7fad5b75dbf30e7685aac148e4b89b3e60509) - Update BetterReflection to 5.3 ([#&#8203;1132](https://github.com/phpstan/phpstan-src/pull/1132)) ### [`v1.5.0`](https://github.com/phpstan/phpstan/releases/tag/1.5.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.10...1.5.0) **This release fixes 26 issues! 🎉** # Improvements 🔧 - Dropped support for PHP 7.1, PHPStan 1.5.0 runs on PHP 7.2-8.1. Users on PHP 7.1 accounted only for 0.8 % of installatoins. - Allow null as a return value when resolving return types ([#&#8203;1061](https://github.com/phpstan/phpstan-src/pull/1061)), [#&#8203;5855](https://github.com/phpstan/phpstan/issues/5855), thanks [@&#8203;matthiasnoback](https://github.com/matthiasnoback)! - Output elapsed time per file in debug mode ([#&#8203;1062](https://github.com/phpstan/phpstan-src/pull/1062)), [#&#8203;5294](https://github.com/phpstan/phpstan/issues/5294), thanks [@&#8203;janedbal](https://github.com/janedbal)! - A bit more precise concatenation of unions of literal strings ([#&#8203;937](https://github.com/phpstan/phpstan-src/pull/937)), [#&#8203;6439](https://github.com/phpstan/phpstan/issues/6439), thanks [@&#8203;staabm](https://github.com/staabm)! - `OptimizedDirectorySourceLocator::locateIdentifiersByType()` returns all located classes or functions ([#&#8203;1080](https://github.com/phpstan/phpstan-src/pull/1080)), thanks [@&#8203;tomasfejfar](https://github.com/tomasfejfar)! - Backward compatibility promise: ReflectionProvider cannot be extended/implemented by 3rd party code (https://github.com/phpstan/phpstan-src/commit/e60d6d6e9637db8a00bfd11cf446fabb3d545aa2) - implement `ArraySearchFunctionTypeSpecifyingExtension` ([#&#8203;1086](https://github.com/phpstan/phpstan-src/pull/1086)), [#&#8203;6863](https://github.com/phpstan/phpstan/issues/6863), thanks [@&#8203;staabm](https://github.com/staabm)! - added `ArrayReplaceFunctionReturnTypeExtension` ([#&#8203;1087](https://github.com/phpstan/phpstan-src/pull/1087)), [#&#8203;5327](https://github.com/phpstan/phpstan/issues/5327), thanks [@&#8203;staabm](https://github.com/staabm)! - Dynamic return type extension for `curl_getinfo` ([#&#8203;1072](https://github.com/phpstan/phpstan-src/pull/1072)), thanks [@&#8203;PrinsFrank](https://github.com/PrinsFrank)! - Support intersection types in template bounds ([#&#8203;1101](https://github.com/phpstan/phpstan-src/pull/1101)), [#&#8203;6649](https://github.com/phpstan/phpstan/issues/6649), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Support `value-of<BackedEnum>` ([#&#8203;1082](https://github.com/phpstan/phpstan-src/pull/1082)), [#&#8203;6775](https://github.com/phpstan/phpstan/issues/6775), thanks [@&#8203;staabm](https://github.com/staabm)! # Bleeding edge 🔪 - Report useless `array_filter()` calls ([#&#8203;1077](https://github.com/phpstan/phpstan-src/pull/1077)), [#&#8203;6840](https://github.com/phpstan/phpstan/issues/6840), thanks [@&#8203;leongersen](https://github.com/leongersen)! *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](https://phpstan.org/blog/what-is-bleeding-edge)* # Bugfixes 🐛 - fix handling of `JSON_THROW_ON_ERROR` with optional bitwise flags ([#&#8203;1025](https://github.com/phpstan/phpstan-src/pull/1025)), [#&#8203;6654](https://github.com/phpstan/phpstan/issues/6654), thanks [@&#8203;staabm](https://github.com/staabm)! - Keep non nullability if right expr is `NeverType` ([#&#8203;1063](https://github.com/phpstan/phpstan-src/pull/1063)), [#&#8203;5351](https://github.com/phpstan/phpstan/issues/5351), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Support more dynamic `$flags` arg in `preg_split()` ([#&#8203;1081](https://github.com/phpstan/phpstan-src/pull/1081)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `array_keys` and `array_values` with accessory types ([#&#8203;1084](https://github.com/phpstan/phpstan-src/pull/1084)), [#&#8203;6859](https://github.com/phpstan/phpstan/issues/6859), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix memory error when trying to represent big literal string types ([#&#8203;1088](https://github.com/phpstan/phpstan-src/pull/1088)), [#&#8203;6866](https://github.com/phpstan/phpstan/issues/6866), thanks [@&#8203;mathroc](https://github.com/mathroc)! - Add throw point for `UnhandledMatchError` ([#&#8203;1056](https://github.com/phpstan/phpstan-src/pull/1056)), [#&#8203;6115](https://github.com/phpstan/phpstan/issues/6115), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Do not report unhandled match expression value if `@throws` tag is present with `UnhandledMatchError` ([#&#8203;1103](https://github.com/phpstan/phpstan-src/pull/1103)), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Retain accessory string types in generics ([#&#8203;1096](https://github.com/phpstan/phpstan-src/pull/1096)), [#&#8203;6301](https://github.com/phpstan/phpstan/issues/6301), [#&#8203;3951](https://github.com/phpstan/phpstan/issues/3951), [#&#8203;6845](https://github.com/phpstan/phpstan/issues/6845), [#&#8203;5336](https://github.com/phpstan/phpstan/issues/5336), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - Simplify `FloatType::accepts` handling of `CompoundType`s ([#&#8203;1097](https://github.com/phpstan/phpstan-src/pull/1097)), [#&#8203;6872](https://github.com/phpstan/phpstan/issues/6872), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Early termination for NeverType match expression ([#&#8203;1078](https://github.com/phpstan/phpstan-src/pull/1078)), [#&#8203;6257](https://github.com/phpstan/phpstan/issues/6257), [#&#8203;6251](https://github.com/phpstan/phpstan/issues/6251), thanks [@&#8203;rajyan](https://github.com/rajyan)! - ObjectType - different priority in iterable key and iterable value (https://github.com/phpstan/phpstan-src/commit/125619231fc24bf8bb99e9e1586a49d7199380b2), [#&#8203;6494](https://github.com/phpstan/phpstan/issues/6494) - Support `enum_exists` in ClassExistsFunctionTypeSpecifyingExtension ([#&#8203;1109](https://github.com/phpstan/phpstan-src/pull/1109)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix/issue 6870 expr early termination for `BinaryOp` ([#&#8203;1105](https://github.com/phpstan/phpstan-src/pull/1105)), [#&#8203;6870](https://github.com/phpstan/phpstan/issues/6870), [#&#8203;6890](https://github.com/phpstan/phpstan/issues/6890), thanks [@&#8203;rajyan](https://github.com/rajyan)! # Function signature fixes 🤖 - Fix DOMNodeList stub and add DOMXPath::query() ([#&#8203;1052](https://github.com/phpstan/phpstan-src/pull/1052)), [#&#8203;6748](https://github.com/phpstan/phpstan/issues/6748), thanks [@&#8203;mkrauss](https://github.com/mkrauss)! - Change `ReflectionMethod::$class` type to `class-string` ([#&#8203;1107](https://github.com/phpstan/phpstan-src/pull/1107)), [#&#8203;6889](https://github.com/phpstan/phpstan/issues/6889), thanks [@&#8203;rvanvelzen](https://github.com/rvanvelzen)! - More precise function signatures ([#&#8203;1110](https://github.com/phpstan/phpstan-src/pull/1110)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update `context` parameter signature in `fopen()` ([#&#8203;1113](https://github.com/phpstan/phpstan-src/pull/1113)), thanks [@&#8203;bytestream](https://github.com/bytestream)! - clear stat-cache also on `is_writeable()` calls ([#&#8203;1112](https://github.com/phpstan/phpstan-src/pull/1112)), thanks [@&#8203;staabm](https://github.com/staabm)! # Internals 🔍 - PHPStan now utilizes version-based naming of Git branches (`1.5.x`) instead of `master` - CI pipeline is faster thanks to several improvements: - Support for PHP 7.1 was dropped - Reproducible `phpstan.phar` checksum is computed and compared when running integration tests from `phpstan/phpstan` on pull requests in `phpstan-src`. The integration tests run only when the checksum was changed. This means that for example if only unit tests in phpstan-src were changed, PHAR didn't change and those integration tests from `phpstan/phpstan` don't have to run. - Rector downgrade cache was implemented. When transforming sources from PHP 8.0 to various lower PHP versions, cache is utilized instead of making Rector do the hard work each time. ### [`v1.4.10`](https://github.com/phpstan/phpstan/releases/tag/1.4.10) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.9...1.4.10) - Fix the difference between `?T` and `T|null` (https://github.com/phpstan/phpstan-src/commit/28776ffd4604e92761e09413cfc9c096d2547ad8), [#&#8203;6790](https://github.com/phpstan/phpstan/issues/6790) - Check property assign `TypeError` throw point by native type ([#&#8203;1065](https://github.com/phpstan/phpstan-src/pull/1065)), [#&#8203;6791](https://github.com/phpstan/phpstan/issues/6791), [#&#8203;6786](https://github.com/phpstan/phpstan/issues/6786), thanks [@&#8203;rajyan](https://github.com/rajyan)! ### [`v1.4.9`](https://github.com/phpstan/phpstan/releases/tag/1.4.9) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.8...1.4.9) # Improvements 🔧 - `Identical` (`===` and `!==`) and `Equal` (`==` and `!=`) with the same variables resolve to `ConstantBooleanType` (https://github.com/phpstan/phpstan-src/commit/98c4d84ec983fb36992119d4c393d7192a2a99b6) - Scalars of the same type on both of `Equal` (`==` and `!=`) are delegated to `Identical` (`===` and `!==`) (https://github.com/phpstan/phpstan-src/commit/316f269d6e81fcfa435f74cb1155076e349f053f) # Bugfixes 🐛 - Fix trait detection recursion ([#&#8203;1050](https://github.com/phpstan/phpstan-src/pull/1050)), [#&#8203;6740](https://github.com/phpstan/phpstan/issues/6740), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Do not add `null` to a template type for a default parameter value `null` (https://github.com/phpstan/phpstan-src/commit/7a66cb6eda85703811c7dce472355e036d70c144), [#&#8203;6584](https://github.com/phpstan/phpstan/issues/6584) - Fix nullable closure parameter type (https://github.com/phpstan/phpstan-src/commit/c05ba984a08d1fa50e0edf63e99a9a893e78e821), [#&#8203;6701](https://github.com/phpstan/phpstan/issues/6701) - TemplateType - fix description for subtracted mixed bound (https://github.com/phpstan/phpstan-src/commit/6525d6805b1beece69ec97802bdf16dd8545cfdf) - Fix dead catch when iterating objects ([#&#8203;1051](https://github.com/phpstan/phpstan-src/pull/1051)), [#&#8203;5903](https://github.com/phpstan/phpstan/issues/5903), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix false positive dead catch on property assignment ([#&#8203;1047](https://github.com/phpstan/phpstan-src/pull/1047)), [#&#8203;6256](https://github.com/phpstan/phpstan/issues/6256), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix template type subtraction and union (https://github.com/phpstan/phpstan-src/commit/51e2df38ee7fbda5416e1c5c1091dacf8618f3e1), [#&#8203;6591](https://github.com/phpstan/phpstan/issues/6591) - Simulate `offsetSet` to get throw points for ArrayAccess assignment ([#&#8203;1054](https://github.com/phpstan/phpstan-src/pull/1054)), [#&#8203;4852](https://github.com/phpstan/phpstan/issues/4852), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Make return type extension for `array_column()` aware of PHP version ([#&#8203;1053](https://github.com/phpstan/phpstan-src/pull/1053)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix Unused private constant with an indirect access ([#&#8203;1059](https://github.com/phpstan/phpstan-src/pull/1059)), [#&#8203;6758](https://github.com/phpstan/phpstan/issues/6758), thanks [@&#8203;rajyan](https://github.com/rajyan)! - Fix `Equal` (`==` and `!=`) handling in TypeSpecifier (https://github.com/phpstan/phpstan-src/commit/10b295f3cde7d91cc2b2784fc012910be6a06fb8) - Fix more TypeSpecifier issues regarding `Identical` (`===` and `!==`) ([#&#8203;1058](https://github.com/phpstan/phpstan-src/pull/1058)) ### [`v1.4.8`](https://github.com/phpstan/phpstan/releases/tag/1.4.8) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.7...1.4.8) # Improvements 🔧 - Validate `ignoreErrors` regexes during DIC compilation (save time in each run) (https://github.com/phpstan/phpstan-src/commit/692158c194eff722167f5316d31369a188a88a72), [#&#8203;6693](https://github.com/phpstan/phpstan/issues/6693) - Validate `parametersSchema` only during DIC compilation (https://github.com/phpstan/phpstan-src/commit/50f25e95ad2f99d9fb73e512ac9b54599653305b) - Retain left and right types in `==` and `===` expression ([#&#8203;1046](https://github.com/phpstan/phpstan-src/pull/1046)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Add support for integer ranges in `strtotime()` with constant strings ([#&#8203;1045](https://github.com/phpstan/phpstan-src/pull/1045)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! # Bugfixes 🐛 - Fix `is_subclass_of` with same class ([#&#8203;1044](https://github.com/phpstan/phpstan-src/pull/1044)), [#&#8203;6305](https://github.com/phpstan/phpstan/issues/6305), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix Incorrectly nested style tag found for narrow terminals (https://github.com/phpstan/phpstan-src/commit/d921d067702acb1cc0451753dcdf3be142b29aed), [#&#8203;6724](https://github.com/phpstan/phpstan/issues/6724), [#&#8203;6727](https://github.com/phpstan/phpstan/issues/6727) - Empty array infers key and value type as never (https://github.com/phpstan/phpstan-src/commit/c2b9e713daa09db18111d28ba5c8cd79beeaeec5), [#&#8203;3400](https://github.com/phpstan/phpstan/issues/3400), [#&#8203;6353](https://github.com/phpstan/phpstan/issues/6353), [#&#8203;5757](https://github.com/phpstan/phpstan/issues/5757), [#&#8203;5065](https://github.com/phpstan/phpstan/issues/5065) - `ArrayType::traverse()` - create empty `ConstantArrayType` in case of `never` (https://github.com/phpstan/phpstan-src/commit/8c1dfc1afb3f381c8e50befe38e8abc581c67db2) ### [`v1.4.7`](https://github.com/phpstan/phpstan/releases/tag/1.4.7) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.6...1.4.7) **This release fixes 43 issues! 🎉** # Improvements 🔧 - Run the parallel worker even for a low number of files ([#&#8203;686](https://github.com/phpstan/phpstan-src/commit/21590573d4cf113d13b8ea0518ebd06eeee9a98e)), [#&#8203;6606](https://github.com/phpstan/phpstan/issues/6606) - Autodiscover `phpstan.dist.neon` as a config file ([#&#8203;1006](https://github.com/phpstan/phpstan-src/pull/1006)), [#&#8203;6561](https://github.com/phpstan/phpstan/issues/6561), thanks [@&#8203;b1rdex](https://github.com/b1rdex)! - Make editor links clickable for terminals supporting hrefs ([#&#8203;1013](https://github.com/phpstan/phpstan-src/pull/1013), https://github.com/phpstan/phpstan-src/commit/bbf14bf635e91aad4be81ad6eacc8b18fb3b31ed), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Table format error output - improve table wrapping (https://github.com/phpstan/phpstan-src/commit/bc481b74fb54f494d616e5f7bb04053b7fffc28f) - Implemented ConstantStringType inference for `str_repeat` ([#&#8203;1030](https://github.com/phpstan/phpstan-src/pull/1030)), [#&#8203;6679](https://github.com/phpstan/phpstan/issues/6679), thanks [@&#8203;staabm](https://github.com/staabm)! - Deprecate `TypeUtils::generalizeType()` (https://github.com/phpstan/phpstan-src/commit/267457712854e8ed1de9c6b99e918e2d9d1219d3) - Date format return type extensions (https://github.com/phpstan/phpstan-src/commit/b49df58105e5300d4a2d7b0ff44a5a6f5806f240), [#&#8203;6550](https://github.com/phpstan/phpstan/issues/6550) - Infer explicit mixed when instantiating generic class with unknown template types ([bleeding edge](https://phpstan.org/blog/what-is-bleeding-edge)) (https://github.com/phpstan/phpstan-src/commit/089d4c6fb6eb709c44123548d33990113d174b86), [#&#8203;6398](https://github.com/phpstan/phpstan/issues/6398) # Bugfixes 🐛 - Fix incorrect array `sizeof()` when using `unset()` ([#&#8203;971](https://github.com/phpstan/phpstan-src/pull/971)), [#&#8203;6488](https://github.com/phpstan/phpstan/issues/6488), thanks [@&#8203;staabm](https://github.com/staabm)! - Split `TemplateType::isSubTypeOf()` and `TemplateType::isAcceptedBy()` ([#&#8203;1001](https://github.com/phpstan/phpstan-src/pull/1001)), [#&#8203;6589](https://github.com/phpstan/phpstan/issues/6589), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Use a BenovolentUnionType for properties in SimpleXMLElement ([#&#8203;76](https://github.com/phpstan/phpstan-src/pull/76)), [#&#8203;2784](https://github.com/phpstan/phpstan/issues/2784), [#&#8203;6020](https://github.com/phpstan/phpstan/issues/6020), thanks [@&#8203;orklah](https://github.com/orklah)! - Binary operations on `non-empty-string` and `string` should error ([#&#8203;1011](https://github.com/phpstan/phpstan-src/pull/1010)), [#&#8203;6624](https://github.com/phpstan/phpstan/issues/6624), thanks [@&#8203;staabm](https://github.com/staabm)! - No longer verify types when `TypeSpecifyingExtension` uses `$overwrite=true` ([#&#8203;1011](https://github.com/phpstan/phpstan-src/pull/1011)), [#&#8203;6620](https://github.com/phpstan/phpstan/issues/6620), thanks [@&#8203;staabm](https://github.com/staabm)! - Normalize specified types before intersection ([#&#8203;1016](https://github.com/phpstan/phpstan-src/pull/1016)), [#&#8203;6329](https://github.com/phpstan/phpstan/issues/6329), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Improve intersect and union of SubtractableTypes ([#&#8203;1028](https://github.com/phpstan/phpstan-src/pull/1028)), [#&#8203;6672](https://github.com/phpstan/phpstan/issues/6672), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Ignore `@template` above a property (https://github.com/phpstan/phpstan-src/commit/53563e9429f9559120aa8e043d9283c6b4c2d0a9) - Add missing `SpecifiedTypes` for `count()` and `strlen()` in `===` expressions ([#&#8203;1021](https://github.com/phpstan/phpstan-src/pull/1021)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Detect closure parameter types when passing closure in a union ([#&#8203;1019](https://github.com/phpstan/phpstan-src/pull/1019)), [#&#8203;5675](https://github.com/phpstan/phpstan/issues/5675), [#&#8203;6629](https://github.com/phpstan/phpstan/issues/6629), thanks [@&#8203;axlon](https://github.com/axlon)! - Fix another BooleanOr issue (https://github.com/phpstan/phpstan-src/commit/cc6655f9311a738bc2dec6bad2c6e6b6b8173c81), [#&#8203;6696](https://github.com/phpstan/phpstan/issues/6696), [#&#8203;6112](https://github.com/phpstan/phpstan/issues/6112), [#&#8203;5749](https://github.com/phpstan/phpstan/issues/5749) - Fix anonymous class reflection error (https://github.com/phpstan/phpstan-src/commit/0e5d58604e4cfdc5f9c2742736a05c1434de8821), [#&#8203;6681](https://github.com/phpstan/phpstan/issues/6681) - OptimizedDirectorySourceLocator - fix bug with uppercase Enum keyword (https://github.com/phpstan/phpstan-src/commit/7110a088ffb28e368b4ba23f73c23b936e4ff05c) - Template tag without bound is explicit mixed (https://github.com/phpstan/phpstan-src/commit/0808a89469a0d28bebd0b8d7b14af1639e441215) - Fix isSmallerThan etc. in BenevolentUnionType (https://github.com/phpstan/phpstan-src/commit/dd5633f1835d58f67edb95858185b7791a13220c), [#&#8203;5969](https://github.com/phpstan/phpstan/issues/5969), [#&#8203;5295](https://github.com/phpstan/phpstan/issues/5295) - Do not generalize `class-string` during template type inference ([#&#8203;1038](https://github.com/phpstan/phpstan-src/pull/1038)), [#&#8203;6505](https://github.com/phpstan/phpstan/issues/6505), [#&#8203;6699](https://github.com/phpstan/phpstan/issues/6699), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Support for `class-string` `$class` parameter in `is_subclass_of()` ([#&#8203;1039](https://github.com/phpstan/phpstan-src/pull/1039)), [#&#8203;6698](https://github.com/phpstan/phpstan/issues/6698), [#&#8203;5369](https://github.com/phpstan/phpstan/issues/5369), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Fix generalization of `EnumCaseObjectType` (https://github.com/phpstan/phpstan-src/commit/9e428966d8f985db3199a234406c6799abd18617), [#&#8203;6695](https://github.com/phpstan/phpstan/issues/6695), [#&#8203;6433](https://github.com/phpstan/phpstan/issues/6433) - Duplicate and adapt solution from `is_subclass_of()` for `is_a()` ([#&#8203;1040](https://github.com/phpstan/phpstan-src/pull/1040)), [#&#8203;6704](https://github.com/phpstan/phpstan/issues/6704), thanks [@&#8203;herndlm](https://github.com/herndlm)! - ImplodeFunctionReturnTypeExtension - fix handling optional keys in ConstantArrayType (https://github.com/phpstan/phpstan-src/commit/7f643c5866c3aab51a93e971ab0a7cf471111edf), [#&#8203;6715](https://github.com/phpstan/phpstan/issues/6715) - Improve `ArrayType::castToArrayKeyType()` for booleans ([#&#8203;1033](https://github.com/phpstan/phpstan-src/pull/1033)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix `ArrayColumnFunctionReturnTypeExtension` producing array key types ([#&#8203;1033](https://github.com/phpstan/phpstan-src/pull/1033)), [#&#8203;6682](https://github.com/phpstan/phpstan/issues/6682), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix `in_array()` for arrays with union value type (https://github.com/phpstan/phpstan-src/commit/4321374cadc2d0a2a738fa322888e15d61116d56), [#&#8203;6705](https://github.com/phpstan/phpstan/issues/6705), [#&#8203;5668](https://github.com/phpstan/phpstan/issues/5668), [#&#8203;5759](https://github.com/phpstan/phpstan/issues/5759), [#&#8203;3314](https://github.com/phpstan/phpstan/issues/3314), [#&#8203;5496](https://github.com/phpstan/phpstan/issues/5496), [#&#8203;4666](https://github.com/phpstan/phpstan/issues/4666), [#&#8203;3892](https://github.com/phpstan/phpstan/issues/3892), [#&#8203;5354](https://github.com/phpstan/phpstan/issues/5354), [#&#8203;2870](https://github.com/phpstan/phpstan/issues/2870) # Function signature fixes 🤖 - Add FilterIterator stub (https://github.com/phpstan/phpstan-src/commit/c5f4c3b1693b8e0b3bcab5705d4f301999c523b3) - Add CallbackFilterIterator stub (https://github.com/phpstan/phpstan-src/commit/868720e093f4246748846f7629dc57391d7daaff) - Add RecursiveCallbackFilterIterator stub (https://github.com/phpstan/phpstan-src/commit/86a63ff1f07352fffe84b2ad0468d5d14a0fc2d3) - Correct the case for various class names. ([#&#8203;1007](https://github.com/phpstan/phpstan-src/pull/1007)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Update the signature for `set_error_handler()`. ([#&#8203;1008](https://github.com/phpstan/phpstan-src/pull/1008)), [#&#8203;6619](https://github.com/phpstan/phpstan/issues/6619), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - `PDOStatement::fetchAll` no longer returns false on PHP8 ([#&#8203;1014](https://github.com/phpstan/phpstan-src/pull/1014)), thanks [@&#8203;xPaw](https://github.com/xPaw)! - `mb_*` fatal errors on php8 with invalid encoding ([#&#8203;969](https://github.com/phpstan/phpstan-src/pull/969)), thanks [@&#8203;staabm](https://github.com/staabm)! - Allow 1st argument `$read` of `stream_select` to be nullable ([#&#8203;1031](https://github.com/phpstan/phpstan-src/pull/1031)), thanks [@&#8203;niconoe-](https://github.com/niconoe-)! - Fix `PDOException::getCode()` return type ([#&#8203;1018](https://github.com/phpstan/phpstan-src/pull/1018)), [#&#8203;6651](https://github.com/phpstan/phpstan/issues/6651), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Countable stub with `0|positive-int` ([bleeding edge](https://phpstan.org/blog/what-is-bleeding-edge)) ([#&#8203;1027](https://github.com/phpstan/phpstan-src/pull/1027)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `substr()` return type on PHP < 8 - use benevolent union type ([#&#8203;1036](https://github.com/phpstan/phpstan-src/pull/1036)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Fixed error return signatures for `\SplFileInfo` ([#&#8203;1034](https://github.com/phpstan/phpstan-src/pull/1034)), [#&#8203;6680](https://github.com/phpstan/phpstan/issues/6680), thanks [@&#8203;siganushka](https://github.com/siganushka)! - Fix `setFetchMode` signature with `fetch_class` ([#&#8203;1043](https://github.com/phpstan/phpstan-src/pull/1043)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - `preg_filter` return type extension ([#&#8203;1024](https://github.com/phpstan/phpstan-src/pull/1024)), [#&#8203;6664](https://github.com/phpstan/phpstan/issues/6664), thanks [@&#8203;staabm](https://github.com/staabm)! - more precise `preg_match_all` return type on PHP 8 ([#&#8203;1023](https://github.com/phpstan/phpstan-src/pull/1023)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.4.6`](https://github.com/phpstan/phpstan/releases/tag/1.4.6) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.5...1.4.6) # Improvements 🔧 - Implemented constant type inference for `implode()` function ([#&#8203;991](https://github.com/phpstan/phpstan-src/pull/991)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Fix interaction between template type and union type ([#&#8203;992](https://github.com/phpstan/phpstan-src/pull/992)), [#&#8203;5591](https://github.com/phpstan/phpstan/issues/5591), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Delegate most of `TypeCombinator::remove()` to `Type::tryRemove()` ([#&#8203;994](https://github.com/phpstan/phpstan-src/pull/994)), [#&#8203;6438](https://github.com/phpstan/phpstan/issues/6438), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - TemplateType should accept a TemplateType derived from itself ([#&#8203;999](https://github.com/phpstan/phpstan-src/pull/999)), [#&#8203;5844](https://github.com/phpstan/phpstan/issues/5844), [#&#8203;5706](https://github.com/phpstan/phpstan/issues/5706), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Fixed intersecting and removal from TemplateUnionType (https://github.com/phpstan/phpstan-src/commit/0d288353ca782ef79e362657c2581abf4246a2f8), [#&#8203;6566](https://github.com/phpstan/phpstan/issues/6566) - Fixed type seen by IterableInForeachRule with inline `@var` right above `foreach` (https://github.com/phpstan/phpstan-src/commit/b6bbbaf6b01cbd43ae2800bbd00fe0ddbcb2e0d9), [#&#8203;6564](https://github.com/phpstan/phpstan/issues/6564) - modulo 1 is always zero ([#&#8203;973](https://github.com/phpstan/phpstan-src/pull/973)), thanks [@&#8203;staabm](https://github.com/staabm)! - multiply by zero is always zero ([#&#8203;974](https://github.com/phpstan/phpstan-src/pull/974)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fixed discovering backed enum without space around `:` (https://github.com/phpstan/phpstan-src/commit/5162bcfea5456eb827035cd249c5ace55057237b), https://github.com/composer/composer/issues/10498 # Function signature fixes 🤖 - Function `md5()` always return `non-empty-string` ([#&#8203;987](https://github.com/phpstan/phpstan-src/pull/987)), thanks [@&#8203;janbarasek](https://github.com/janbarasek)! - Correct the case for parameters that accept an instance of `Iterator`. ([#&#8203;988](https://github.com/phpstan/phpstan-src/pull/988)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Fix the return types of `round()`/`ceil()`/`floor()` ([#&#8203;729](https://github.com/phpstan/phpstan-src/pull/729)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Correct the return type of `SplFileObject::fstat()` ([#&#8203;996](https://github.com/phpstan/phpstan-src/pull/996)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Improve the return type of functions that return an indexed array of strings ([#&#8203;997](https://github.com/phpstan/phpstan-src/pull/997)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! ### [`v1.4.5`](https://github.com/phpstan/phpstan/releases/tag/1.4.5) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.4...1.4.5) # Improvements 🔧 - AnalyseApplication: Do not re-analyse stubs on every run ([#&#8203;730](https://github.com/phpstan/phpstan-src/pull/730)), [#&#8203;5826](https://github.com/phpstan/phpstan/issues/5826), thanks [@&#8203;dktapps](https://github.com/dktapps)! - Add shorthand for `--generate-baseline` (`-b`) ([#&#8203;980](https://github.com/phpstan/phpstan-src/pull/980)), thanks [@&#8203;Seldaek](https://github.com/Seldaek)! - Support narrowing down `array_filter()` return type via string callable ([#&#8203;938](https://github.com/phpstan/phpstan-src/pull/938)), [#&#8203;6417](https://github.com/phpstan/phpstan/issues/6417), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Loop optimization ([#&#8203;757](https://github.com/phpstan/phpstan-src/pull/757)), thanks [@&#8203;ging-dev](https://github.com/ging-dev)! # Bugfixes 🐛 - Fixed level 9 issues (https://github.com/phpstan/phpstan-src/commit/9f12f0fb4877b28cdad42644d927f579c42db22d), [#&#8203;6423](https://github.com/phpstan/phpstan/issues/6423), [#&#8203;6464](https://github.com/phpstan/phpstan/issues/6464), [#&#8203;6236](https://github.com/phpstan/phpstan/issues/6236), [#&#8203;6418](https://github.com/phpstan/phpstan/issues/6418), [#&#8203;6118](https://github.com/phpstan/phpstan/issues/6118), [#&#8203;6081](https://github.com/phpstan/phpstan/issues/6081), [#&#8203;6053](https://github.com/phpstan/phpstan/issues/6053), [#&#8203;6055](https://github.com/phpstan/phpstan/issues/6055), [#&#8203;5860](https://github.com/phpstan/phpstan/issues/5860), [#&#8203;6230](https://github.com/phpstan/phpstan/issues/6230) - Cast PHPDoc array key type with array key casting rules (https://github.com/phpstan/phpstan-src/commit/5d17b847d9f60a0fba21d76d813a612c042fdb1c), [#&#8203;6117](https://github.com/phpstan/phpstan/issues/6117) - Support closure bind with class-string ([#&#8203;706](https://github.com/phpstan/phpstan-src/pull/706)), [#&#8203;4949](https://github.com/phpstan/phpstan/issues/4949), thanks [@&#8203;mvorisek](https://github.com/mvorisek)! - Fix `NeverType::toBoolean()` (https://github.com/phpstan/phpstan-src/commit/fe3a3419d5d8d2b276456971afc3e1804ab1c759), [#&#8203;6258](https://github.com/phpstan/phpstan/issues/6258) - Fix `DatePeriod` constructor extension in subclasses (https://github.com/phpstan/phpstan-src/commit/0c82b3a2675f636db920a0a3e077a45a87200766), [#&#8203;6500](https://github.com/phpstan/phpstan/issues/6500) - Forget remembered specific type when entering arrow function with same-named parameter (https://github.com/phpstan/phpstan-src/commit/af38f03b41d002bd01afa989921acd9f1114fc0e), [#&#8203;6473](https://github.com/phpstan/phpstan/issues/6473) - Fix segfault (https://github.com/phpstan/phpstan-src/commit/d101764ff94a5838930a11fdac7ca9156ded7dc4), [#&#8203;6501](https://github.com/phpstan/phpstan/issues/6501) # Function signature fixes 🤖 - More precise `array_chunk` signature ([#&#8203;709](https://github.com/phpstan/phpstan-src/pull/709)), thanks [@&#8203;staabm](https://github.com/staabm)! - Narrow the type for the `preg_replace_callback()` callable. ([#&#8203;758](https://github.com/phpstan/phpstan-src/pull/758)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Update return types for hash functions ([#&#8203;822](https://github.com/phpstan/phpstan-src/pull/822)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Fix type for `array_splice()` argument `$replacement` ([#&#8203;901](https://github.com/phpstan/phpstan-src/pull/901)), [#&#8203;6288](https://github.com/phpstan/phpstan/issues/6288), thanks [@&#8203;spawnia](https://github.com/spawnia)! - `stream_bucket_new` returns an object ([#&#8203;968](https://github.com/phpstan/phpstan-src/pull/968)), thanks [@&#8203;mind-bending-forks](https://github.com/mind-bending-forks)! - More precise signatures for `mb_*` functions ([#&#8203;717](https://github.com/phpstan/phpstan-src/pull/717)), thanks [@&#8203;staabm](https://github.com/staabm)! - Fix `array_column()` with `null` as `$column_key` ([#&#8203;970](https://github.com/phpstan/phpstan-src/pull/970)), thanks [@&#8203;jlherren](https://github.com/jlherren)! ### [`v1.4.4`](https://github.com/phpstan/phpstan/releases/tag/1.4.4) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.3...1.4.4) # Improvements 🔧 - Return type extension for `array_column()` ([#&#8203;948](https://github.com/phpstan/phpstan-src/pull/948)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Generic stub for `DatePeriod` + constructor dynamic return type extension ([#&#8203;958](https://github.com/phpstan/phpstan-src/pull/958)), [#&#8203;5953](https://github.com/phpstan/phpstan/issues/5953), thanks [@&#8203;Alban-io](https://github.com/Alban-io)! - Resolve remaining predefined constants ([#&#8203;693](https://github.com/phpstan/phpstan-src/pull/693)), thanks [@&#8203;herndlm](https://github.com/herndlm)! # Bugfixes 🐛 - Support all `array_filter()` flags for narrowing down types ([#&#8203;941](https://github.com/phpstan/phpstan-src/pull/941)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix error The supplied range exceeds the maximum array size ([#&#8203;934](https://github.com/phpstan/phpstan-src/pull/934)), [#&#8203;6375](https://github.com/phpstan/phpstan/issues/6375), thanks [@&#8203;voku](https://github.com/voku)! - Nullable union template type bound is actually supported (https://github.com/phpstan/phpstan-src/commit/1d8b2eb269b1de8c449b372580852c2a6307c323), [#&#8203;4656](https://github.com/phpstan/phpstan/issues/4656), [#&#8203;5305](https://github.com/phpstan/phpstan/issues/5305), [#&#8203;3384](https://github.com/phpstan/phpstan/issues/3384) - Fix reporting nonexistent offset in `isset()` (https://github.com/phpstan/phpstan-src/commit/f05e8eb8fe3d979afa9e627371f4df92ab28fadf), [#&#8203;4926](https://github.com/phpstan/phpstan/issues/4926) - Fix interaction between template type and intersection type ([#&#8203;955](https://github.com/phpstan/phpstan-src/pull/955)), [#&#8203;6210](https://github.com/phpstan/phpstan/issues/6210), thanks [@&#8203;arnaud-lb](https://github.com/arnaud-lb)! - Fix tests on 32-bit ([#&#8203;957](https://github.com/phpstan/phpstan-src/pull/957)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix resolving type of `isset()`, `empty()` and null coalesce operator (`??`) (https://github.com/phpstan/phpstan-src/commit/3b17acc5de4ac507d678f9ca9b2cd15937921ffb), [#&#8203;4592](https://github.com/phpstan/phpstan/issues/4592), [#&#8203;4903](https://github.com/phpstan/phpstan/issues/4903), [#&#8203;2420](https://github.com/phpstan/phpstan/issues/2420), [#&#8203;2718](https://github.com/phpstan/phpstan/issues/2718), [#&#8203;3126](https://github.com/phpstan/phpstan/issues/3126), [#&#8203;4586](https://github.com/phpstan/phpstan/issues/4586), [#&#8203;4887](https://github.com/phpstan/phpstan/issues/4887) # Function signature fixes 🤖 - Narrow down the return type of the `Throwable::getTrace()` method ([#&#8203;914](https://github.com/phpstan/phpstan-src/pull/914)), thanks [@&#8203;ste93cry](https://github.com/ste93cry)! - Fix DOMDocument::saveXML signature ([#&#8203;956](https://github.com/phpstan/phpstan-src/pull/956)), thanks [@&#8203;kissifrot](https://github.com/kissifrot)! ### [`v1.4.3`](https://github.com/phpstan/phpstan/releases/tag/1.4.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.2...1.4.3) # Improvements 🔧 - Support for `--memory-limit` CLI option in `clear-result-cache` command (https://github.com/phpstan/phpstan-src/commit/156700b5152ada253edba34b39cda955729e97a8), [#&#8203;6432](https://github.com/phpstan/phpstan/issues/6432) - Pass verbosity to workers and show stack trace on error ([#&#8203;935](https://github.com/phpstan/phpstan-src/pull/935)), thanks [@&#8203;benja-M-1](https://github.com/benja-M-1)! - Move collecting errors from error handler from Analyser to FileAnalyser to be used in parallel runs too (https://github.com/phpstan/phpstan-src/commit/7dd699f9461704a8ef2f4505f1dec534f13e7ccd) - Use memory limit management trick from Laravel instead of the current `.memory_limit` file (https://github.com/phpstan/phpstan-src/commit/daf7d5577bd8c796509768eb6a8d2862b6027a53), https://twitter.com/timacdonald87/status/1484804225658146823 # Bugfixes 🐛 - Fix unset() on intersection with hasOffset (https://github.com/phpstan/phpstan-src/commit/b43c057d2d34448b421cd879320974f393d992ac), [#&#8203;6399](https://github.com/phpstan/phpstan/issues/6399), [#&#8203;4357](https://github.com/phpstan/phpstan/issues/4357) - ConstantStringType - catch Error in setOffsetValueType (https://github.com/phpstan/phpstan-src/commit/54f67c5252fe1a4eff30703875b734111ab46e5a), [#&#8203;6231](https://github.com/phpstan/phpstan/issues/6231) - Fix reflection error for the attribute `#[ReturnTypeWillChange]` on PHP 7.1-7.4 (https://github.com/ondrejmirtes/BetterReflection/commit/bf362441dceecd766dbd54bd470c7b4c333e4c13, https://github.com/phpstan/phpstan-src/commit/639a055975fceffe94902fee9d90bff88ec11cf0), [#&#8203;6414](https://github.com/phpstan/phpstan/issues/6414) - Fix `array_filter` with callback that always evaluates to false ([#&#8203;939](https://github.com/phpstan/phpstan-src/pull/939)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix iterable key and value type - prefer generic type variables instead of key()/current() typehints (https://github.com/phpstan/phpstan-src/commit/a2acf64f793976a21f22babbfc27318a60fea4fa), [#&#8203;5817](https://github.com/phpstan/phpstan/issues/5817) - Fix trait detection recursion for anonymous classes ([#&#8203;946](https://github.com/phpstan/phpstan-src/pull/946)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Fix internal error with a big number in for loop condition (https://github.com/phpstan/phpstan-src/commit/f1734dc5318d1777c7ae6e77d4d3777182e845aa), [#&#8203;6466](https://github.com/phpstan/phpstan/issues/6466) # Function signature fixes 🤖 - Add missing `Ds\Set::reduce()` to stubs ([#&#8203;942](https://github.com/phpstan/phpstan-src/pull/942)), thanks [@&#8203;ZebulanStanphill](https://github.com/ZebulanStanphill)! - Refine `*strlen()` return type to exclude negative integers ([#&#8203;945](https://github.com/phpstan/phpstan-src/pull/945)), thanks [@&#8203;staabm](https://github.com/staabm)! - Bugfix `DatePeriod::getEndDate` declaration ([#&#8203;951](https://github.com/phpstan/phpstan-src/pull/951)), thanks [@&#8203;nyamsprod](https://github.com/nyamsprod)! ### [`v1.4.2`](https://github.com/phpstan/phpstan/releases/tag/1.4.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.1...1.4.2) - CleaningParser - remove conditional code by `PHP_VERSION_ID` (https://github.com/phpstan/phpstan-src/commit/433511a3eb526b0a340277aeb48ff20f292922d1), [#&#8203;6386](https://github.com/phpstan/phpstan/issues/6386), https://github.com/api-platform/core/issues/4614, https://github.com/api-platform/api-platform/issues/2101 - Enums will no longer crash the playground (https://github.com/phpstan/phpstan-src/commit/121e0212db869fe0c42307a1485f27054d492041) - Fix `ObjectType::equals()` when compared to `EnumCaseObjectType` (https://github.com/phpstan/phpstan-src/commit/ab0245c49a16609da528d8e91dc5124b2c911ecb), [#&#8203;6394](https://github.com/phpstan/phpstan/issues/6394) - Fix calling method statically on string (https://github.com/phpstan/phpstan-src/commit/3aa878f2b22907b440055a714c605e8bb6e3de58), [#&#8203;6404](https://github.com/phpstan/phpstan/issues/6404) - Fix native type of variadic parameter (https://github.com/phpstan/phpstan-src/commit/a5447db695e55151c52d5cf67b489fceb7d51c43), [#&#8203;6393](https://github.com/phpstan/phpstan/issues/6393), [#&#8203;5698](https://github.com/phpstan/phpstan/issues/5698) - Update PhpStorm stubs ([#&#8203;930](https://github.com/phpstan/phpstan-src/pull/930)) ### [`v1.4.1`](https://github.com/phpstan/phpstan/releases/tag/1.4.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.4.0...1.4.1) # Improvements 🔧 - TypeSpecifier - understand `==` operator for the same types on both sides (https://github.com/phpstan/phpstan-src/commit/e40eff0a8e34ceae776e38d48a31efbe67ea399a), [#&#8203;6370](https://github.com/phpstan/phpstan/issues/6370), [#&#8203;4413](https://github.com/phpstan/phpstan/issues/4413) - Add `ClassReflection::getBackedEnumType()` method (https://github.com/phpstan/phpstan-src/commit/a0ed2d304e0344df34b49e010d5f491f0d321d3a) - Achieve `BenevolentUnionType` return type without dynamic return type extension (https://github.com/phpstan/phpstan-src/commit/723dfc51eab190ff940d0b0130b9986eb1b5d36a), https://github.com/phpstan/phpstan/discussions/6391 # Bugfixes 🐛 - Allow readonly property write in `__unserialize` ([#&#8203;929](https://github.com/phpstan/phpstan-src/pull/929)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Fix missing properties on `UnitEnum` and `BackedEnum` (https://github.com/phpstan/phpstan-src/commit/67d3a882a85e53f36158e60a8cb30e997aca293c), [#&#8203;6385](https://github.com/phpstan/phpstan/issues/6385) - `ConstantArrayTypeBuilder` - fix for potential performance problems (https://github.com/phpstan/phpstan-src/commit/86b93068ae863a0377118dfe93c3b1286a8673b7), [#&#8203;6375](https://github.com/phpstan/phpstan/issues/6375) # Function signature fixes 🤖 - Add missing `Set::map()` method to functionMap ([#&#8203;923](https://github.com/phpstan/phpstan-src/pull/923)), thanks [@&#8203;simPod](https://github.com/simPod)! - `gnupg_verify()` accepts false fot its signature param ([#&#8203;925](https://github.com/phpstan/phpstan-src/pull/925)), thanks [@&#8203;spaze](https://github.com/spaze)! - Improve signature of `random_bytes()` ([#&#8203;926](https://github.com/phpstan/phpstan-src/pull/926)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `count_chars()` mode-param ([#&#8203;927](https://github.com/phpstan/phpstan-src/pull/927)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `getdate()` return type ([#&#8203;928](https://github.com/phpstan/phpstan-src/pull/928)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.4.0`](https://github.com/phpstan/phpstan/releases/tag/1.4.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.3.3...1.4.0) **This release fixes 25 issues! 🎉** # Major new features 🚀 - Support for PHP 8.1 `readonly` properties ([RFC](https://wiki.php.net/rfc/readonly_properties_v2)) - Readonly properties must be assigned in the constructor of the declaring class - Memoized type of a readonly property is not invalidated even when calling a method with side effects - Readonly properties cannot be passed by reference - Improved detection of incorrect types assigned to properties: - [#&#8203;5804](https://github.com/phpstan/phpstan/issues/5804), [#&#8203;6333](https://github.com/phpstan/phpstan/issues/6333), [#&#8203;4906](https://github.com/phpstan/phpstan/issues/4906), [#&#8203;4165](https://github.com/phpstan/phpstan/issues/4165), [#&#8203;3703](https://github.com/phpstan/phpstan/issues/3703) # Improvements 🔧 - `ParametersAcceptorSelector` - message for `ShouldNotHappenException` (https://github.com/phpstan/phpstan-src/commit/d3c34832c7e27ee068cef99c437add30cce5ad23), [#&#8203;6328](https://github.com/phpstan/phpstan/issues/6328) - Constructor of `BenevolentUnionType` is covered by BC promise (https://github.com/phpstan/phpstan-src/commit/8f28dc8453f0da1f1476fe2f732e7be3f209d726) # Bugfixes 🐛 - Fix PHPDocs with `require` statement (https://github.com/phpstan/phpstan-src/commit/b5a2c8f2b5f0b87c09f87a1457610212e688d6e2), [#&#8203;6348](https://github.com/phpstan/phpstan/issues/6348) - Fix inferring template types in `ClosureType` ([#&#8203;921](https://github.com/phpstan/phpstan-src/pull/921)), thanks [@&#8203;canvural](https://github.com/canvural)! - Fix `random_int()` without args crash (https://github.com/phpstan/phpstan-src/commit/6d7ba0f0db550df34aac51af3a0f8f13e710ca0c), [#&#8203;6361](https://github.com/phpstan/phpstan/issues/6361) Thanks to some internal refactorings listed below, the following issues have been fixed: [#&#8203;5337](https://github.com/phpstan/phpstan/issues/5337), [#&#8203;4910](https://github.com/phpstan/phpstan/issues/4910), [#&#8203;5316](https://github.com/phpstan/phpstan/issues/5316), [#&#8203;5607](https://github.com/phpstan/phpstan/issues/5607), [#&#8203;3766](https://github.com/phpstan/phpstan/issues/3766), [#&#8203;3858](https://github.com/phpstan/phpstan/issues/3858), [#&#8203;3310](https://github.com/phpstan/phpstan/issues/3310), [#&#8203;3264](https://github.com/phpstan/phpstan/issues/3264), [#&#8203;2806](https://github.com/phpstan/phpstan/issues/2806), [#&#8203;5328](https://github.com/phpstan/phpstan/issues/5328), [#&#8203;3044](https://github.com/phpstan/phpstan/issues/3044), [#&#8203;6184](https://github.com/phpstan/phpstan/issues/6184), [#&#8203;3339](https://github.com/phpstan/phpstan/issues/3339), [#&#8203;5656](https://github.com/phpstan/phpstan/issues/5656), [#&#8203;5362](https://github.com/phpstan/phpstan/issues/5362), [#&#8203;3867](https://github.com/phpstan/phpstan/issues/3867), [#&#8203;5707](https://github.com/phpstan/phpstan/issues/5707) - Fix scope after for-loop (https://github.com/phpstan/phpstan-src/commit/4fb1a77b02415356c98fd86323cdc19495b652dd) - Improve preserving `ConstantArrayType` after setting new offset (https://github.com/phpstan/phpstan-src/commit/ec117fa2aec96ea1aef1190c3decb9d945219e21) - `ConstantArrayTypeBuilder` - preserve `ConstantArrayType` for integer range offsets (https://github.com/phpstan/phpstan-src/commit/3eab4628f2f031456eb320b43f9c722ab419d370) - Fix generalizing `ConstantIntegerType` in Scope (https://github.com/phpstan/phpstan-src/commit/d6c7595ba5ee9ea6ff137082fe3a59d8803962ae) - Scope generalization for integer range types (https://github.com/phpstan/phpstan-src/commit/36513388a628fac652f5d9cc5db8c6cdf21a175e) # Function signature fixes 🤖 - Changed signature of `gmp_div` ([#&#8203;915](https://github.com/phpstan/phpstan-src/pull/915)), thanks [@&#8203;danielmarschall](https://github.com/danielmarschall)! - `PDO::prepare()` might return `false` ([#&#8203;916](https://github.com/phpstan/phpstan-src/pull/916), https://github.com/phpstan/phpstan-src/commit/a9881e3afd4a105f0bd1391fb57a8e5c3462d2bc), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `preg_match*` return type signatures ([#&#8203;918](https://github.com/phpstan/phpstan-src/pull/918)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.3.3`](https://github.com/phpstan/phpstan/releases/tag/1.3.3) [Compare Source](https://github.com/phpstan/phpstan/compare/1.3.2...1.3.3) # Improvements 🔧 - ThrowableReturnTypeExtension honors `@method` tag for `getCode()` method above child Exception classes (https://github.com/phpstan/phpstan-src/commit/e04cc8dfb8f6b3a2c4ac399232a6691baed1d162) - Development repository [`phpstan/phpstan-src`](https://github.com/phpstan/phpstan-src) now uses promoted properties (https://github.com/phpstan/phpstan-src/pull/910) ### [`v1.3.2`](https://github.com/phpstan/phpstan/releases/tag/1.3.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.3.1...1.3.2) # Improvements - Scope - Improved file description for traits used by anonymous classes (https://github.com/phpstan/phpstan-src/commit/10e46026885ba643d63513594682efd634bf6350), [#&#8203;6312](https://github.com/phpstan/phpstan/issues/6312) # Bugfixes 🐛 - Fix handling renamed trait method (https://github.com/phpstan/phpstan-src/commit/8498b01253f94f142554463aa23f2b842ee8f0c4), [#&#8203;6306](https://github.com/phpstan/phpstan/issues/6306) - Fix FileTypeMapper call in MethodTemplateTypeRule (https://github.com/phpstan/phpstan-src/commit/63838ee7c202d7b116a5d3dd57f9bb608fdb54fd) - Fix looking for PHPDocs in trait in anonymous class in trait (https://github.com/phpstan/phpstan-src/commit/11176c76aac5b7e15cc16d32e88ecc31cf6de64b), [#&#8203;6253](https://github.com/phpstan/phpstan/issues/6253) - Better progress bar visuals for CI environments (https://github.com/phpstan/phpstan-src/commit/0993d180e5a15a17631d525909356081be59ffeb), [#&#8203;6295](https://github.com/phpstan/phpstan/issues/6295) # Function signature fixes 🤖 - These functions return `false` since PHP 5.4 ([#&#8203;907](https://github.com/phpstan/phpstan-src/pull/907)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Improve `Exception::getCode()` type (https://github.com/phpstan/phpstan-src/commit/11817175c9977a835d8a0dcc6f8edf2d87744b47) ### [`v1.3.1`](https://github.com/phpstan/phpstan/releases/tag/1.3.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.3.0...1.3.1) # Bugfixes 🐛 - Fixed `mixed` type not considered nullable (https://github.com/phpstan/phpstan-src/commit/c0aad86b543c97ce00e012f0092c22fa96728f35), [#&#8203;6293](https://github.com/phpstan/phpstan/issues/6293), [#&#8203;6158](https://github.com/phpstan/phpstan/issues/6158) - Fix renamed trait method visibility (https://github.com/phpstan/phpstan-src/commit/fc5be6a991e355094a97c3b9cdc27ff39284f192), [#&#8203;6264](https://github.com/phpstan/phpstan/issues/6264) - Fix `PDO::pgsqlGetNotify()` call (https://github.com/phpstan/phpstan-src/commit/3624bbb2c47c997f2048cc490854e32bb7a77e92), [#&#8203;6255](https://github.com/phpstan/phpstan/issues/6255) - Fix PHPDocs in file with `#!` shebang (https://github.com/phpstan/phpstan-src/commit/c87284a8eafcea2fde391b69a29daa8f4a0adf37), [#&#8203;6252](https://github.com/phpstan/phpstan/issues/6252) - Fix infinite recursion in `@mixin` extensions (https://github.com/phpstan/phpstan-src/commit/9ab4e6fd8ef29d7bf7b0b729250e04f3dd5ad75d), [#&#8203;6300](https://github.com/phpstan/phpstan/issues/6300) # Function signature fixes 🤖 - Fix return type of `SessionHandler::gc()` ([#&#8203;899](https://github.com/phpstan/phpstan-src/pull/899)), thanks [@&#8203;Khartir](https://github.com/Khartir)! - added `preg_quote` to NonEmptyStringFunctionsReturnTypeExtension ([#&#8203;881](https://github.com/phpstan/phpstan-src/pull/881)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support non-empty-string type in string-replace functions ([#&#8203;879](https://github.com/phpstan/phpstan-src/pull/879)), thanks [@&#8203;staabm](https://github.com/staabm)! - uniqid() always returns a non-empty-string ([#&#8203;905](https://github.com/phpstan/phpstan-src/pull/905)), thanks [@&#8203;MidnightDesign](https://github.com/MidnightDesign)! ### [`v1.3.0`](https://github.com/phpstan/phpstan/releases/tag/1.3.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.2.0...1.3.0) # Major new features 🚀 - **Support for PHP 8.1 Enums** - [RFC](https://wiki.php.net/rfc/enumerations) - Thanks to [@&#8203;kukulich](https://github.com/kukulich) for custom Enum rules! - Upgraded [Roave/BetterReflection to 5.0.0](https://github.com/Roave/BetterReflection/releases/tag/5.0.0) - PHP 7.1+ is still supported because the dependency is downgraded automatically in [our own fork](https://github.com/ondrejmirtes/BetterReflection/tree/ng) - This brings plenty of bugfixes, for example PHP 8.0 Attributes can now be read in static reflection context - PHPStan now works when OPCache is enabled! - Thanks to this commit: https://github.com/phpstan/phpstan-src/commit/e30f4467ab8fa2421f7da6c3909061ab4d5ba743 - The development repository `phpstan/phpstan-src` is now PHP 8.0+ only, while the distribution package `phpstan/phpstan` still supports PHP 7.1+. - This is achieved thanks to automatic downgrade of source code using Rector during PHAR compilation - PHPStan now ships with Symfony PHP polyfills for PHP 7.2-8.0. # Improvements 🔧 - Update `nikic/php-parser` to 4.13.2 (https://github.com/phpstan/phpstan-src/commit/8939964ecfb44a01629c3f2747dbecbc6b273ea0) - Update to Symfony 5.4 ([#&#8203;863](https://github.com/phpstan/phpstan-src/pull/863)) - CLI option `--allow-empty-baseline` to allow generating empty baseline ([#&#8203;776](https://github.com/phpstan/phpstan-src/pull/776)), thanks [@&#8203;Lctrs](https://github.com/Lctrs)! - Support for `@phpstan-property`, `@phpstan-property-read`, and `@phpstan-property-write` ([#&#8203;775](https://github.com/phpstan/phpstan-src/pull/775)), thanks [@&#8203;mad-briller](https://github.com/mad-briller)! - Add support for the `key-of<...>` and `value-of<...>` types ([#&#8203;800](https://github.com/phpstan/phpstan-src/pull/800)), thanks [@&#8203;ste93cry](https://github.com/ste93cry)! - GithubErrorFormatter > Allow any `ErrorFormatter` ([#&#8203;854](https://github.com/phpstan/phpstan-src/pull/854)), thanks [@&#8203;ruudk](https://github.com/ruudk)! - Array unpacking support for string-keyed arrays ([#&#8203;803](https://github.com/phpstan/phpstan-src/pull/803)), thanks [@&#8203;canvural](https://github.com/canvural)! - Moved some classes from ClassBlacklistReflectionProvider to staticReflectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too (https://github.com/phpstan/phpstan-src/commit/e40ba1569885ce70cdfea4d06abe429960589b31) - PHPStanTestCase: Added a helper method to assert no errors happend ([#&#8203;894](https://github.com/phpstan/phpstan-src/pull/894)), thanks [@&#8203;staabm](https://github.com/staabm)! # Bugfixes 🐛 - Resolve deprecated tag also from parents ([#&#8203;792](https://github.com/phpstan/phpstan-src/pull/792)), thanks [@&#8203;eiriksm](https://github.com/eiriksm)! - `echo` isn't callable either. ([#&#8203;777](https://github.com/phpstan/phpstan-src/pull/777)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Resolve object type by class const fetch in switch statement ([#&#8203;745](https://github.com/phpstan/phpstan-src/pull/745)), thanks [@&#8203;marmichalski](https://github.com/marmichalski)! - Allow also `$object::class` with Identical ([#&#8203;745](https://github.com/phpstan/phpstan-src/pull/745)), thanks [@&#8203;marmichalski](https://github.com/marmichalski)! - Fixed ErrorFormatter tests in terminals with console support ([#&#8203;805](https://github.com/phpstan/phpstan-src/pull/805)), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Copy all environment variables when running PHPStan Pro (https://github.com/phpstan/phpstan-src/commit/e61ad9575a000b410efcf2824ef3a4c87083e1b6), [#&#8203;5433](https://github.com/phpstan/phpstan/issues/5433) - Allow destructuring of objects implementing ArrayAccess ([#&#8203;819](https://github.com/phpstan/phpstan-src/pull/819)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Spreading of general arrays should not lead to a non-empty-array ([#&#8203;818](https://github.com/phpstan/phpstan-src/pull/818)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Simplify FileTypeMapper (https://github.com/phpstan/phpstan-src/commit/256d11b8fe9f19924b9f4decc3451665fc8c2769) - Make FileTypeMapper more deterministic (https://github.com/phpstan/phpstan-src/commit/ae6dca5d4f485fde77a1b2c7eaca55fe2ec9b28a) - Fix normal vs. stub PHPDoc (https://github.com/phpstan/phpstan-src/commit/e9dd3a30339de34a3fe11092b3aa245216038953) - ReflectionAttribute is no longer final class (https://github.com/phpstan/phpstan-src/commit/97e153ce52148d94719e3af442aa7358f3a73d07) - ReflectionAttribute stub - IS_INSTANCEOF constant (https://github.com/phpstan/phpstan-src/commit/cfb6fad051a4419872b4de47db45c398c90be6e1) - DependencyResolver - cause autoloading less often when looking at literal arrays (https://github.com/phpstan/phpstan-src/commit/b927c87f585d314ba5a766203a32671186d612c5), [#&#8203;6187](https://github.com/phpstan/phpstan/issues/6187), [#&#8203;6096](https://github.com/phpstan/phpstan/issues/6096) - MemoizingReflectionProvider - cache `hasClass()` as case-sensitive (https://github.com/phpstan/phpstan-src/commit/792ce0af4b4bd59f8c5c4f67a28685922e0fff15), [#&#8203;6096](https://github.com/phpstan/phpstan/issues/6096) - XdebugHandler - setPersistent ([#&#8203;726](https://github.com/phpstan/phpstan-src/pull/726)), [#&#8203;5809](https://github.com/phpstan/phpstan/issues/5809), thanks [@&#8203;fsmoak](https://github.com/fsmoak)! - Simplify AutoloadSourceLocator - let it actually autoload the file (https://github.com/phpstan/phpstan-src/commit/e30f4467ab8fa2421f7da6c3909061ab4d5ba743) - AutoloadSourceLocator - filter classes by startLine only if there are multiple of them ([#&#8203;882](https://github.com/phpstan/phpstan-src/pull/882)) - ComposerJsonAndInstalledJsonSourceLocatorMaker - fix for autoload-dev section ([#&#8203;882](https://github.com/phpstan/phpstan-src/pull/882)) - TestCaseSourceLocatorFactory - skip invalid Composer locations ([#&#8203;882](https://github.com/phpstan/phpstan-src/pull/882)) - Fix ReturnTypeRule ([#&#8203;882](https://github.com/phpstan/phpstan-src/pull/882)) - Silent `@` operator should use `& $errno` check ([#&#8203;889](https://github.com/phpstan/phpstan-src/pull/889)), thanks [@&#8203;samsonasik](https://github.com/samsonasik)! - ClassTemplateTypeRule should not be executed for interfaces (https://github.com/phpstan/phpstan-src/commit/9adf6bff2e4a3564dfacb073f99d7638797c0a19) - MixinRule - check interfaces and enums (https://github.com/phpstan/phpstan-src/commit/8519cca4247f34ca201f38e16f57dd7aff275fe0) # Function signature fixes 🤖 - Added DynamicReturnTypeExtension for `trigger_error` ([#&#8203;766](https://github.com/phpstan/phpstan-src/pull/766)), thanks [@&#8203;staabm](https://github.com/staabm)! - The array returned by `array_count_values()` can never contain a zero. ([#&#8203;773](https://github.com/phpstan/phpstan-src/pull/773)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Add ThrowableReturnTypeExtension ([#&#8203;795](https://github.com/phpstan/phpstan-src/pull/795)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - Update functionMap for XSLTProcessor ([#&#8203;797](https://github.com/phpstan/phpstan-src/pull/797)), thanks [@&#8203;hbrecht](https://github.com/hbrecht)! - imap_delete / imap_undelete: correction ([#&#8203;799](https://github.com/phpstan/phpstan-src/pull/799)), thanks [@&#8203;hbrecht](https://github.com/hbrecht)! - Fix the signature of the value returned from the `date_parse` and `date_parse_from_format` functions ([#&#8203;807](https://github.com/phpstan/phpstan-src/pull/807)), thanks [@&#8203;ste93cry](https://github.com/ste93cry)! - Fix the signature of `get_resources()` ([#&#8203;837](https://github.com/phpstan/phpstan-src/pull/837)), thanks [@&#8203;MidnightDesign](https://github.com/MidnightDesign)! - Fix preg_filter function signature ([#&#8203;826](https://github.com/phpstan/phpstan-src/pull/826)), thanks [@&#8203;johnstevenson](https://github.com/johnstevenson)! - Fix ldap_set_rebind_proc signature ([#&#8203;851](https://github.com/phpstan/phpstan-src/pull/851)), thanks [@&#8203;villfa](https://github.com/villfa)! - `restore_error_handler` and `restore_exception_handler` always return boolean `true`. ([#&#8203;850](https://github.com/phpstan/phpstan-src/pull/850)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - More specific return types for some `DateTimeZone` methods ([#&#8203;857](https://github.com/phpstan/phpstan-src/pull/857)), thanks [@&#8203;johnbillion](https://github.com/johnbillion)! - Add missing `Set::map()` method to `ext-ds` stub ([#&#8203;855](https://github.com/phpstan/phpstan-src/pull/855)), thanks [@&#8203;simPod](https://github.com/simPod)! - Support variable constant flags in `preg_split` (https://github.com/phpstan/phpstan-src/commit/a16c7aeac11f3072edc2d5f01dfef4e5442290d2), thanks [@&#8203;clxmstaab](https://github.com/clxmstaab)! ### [`v1.2.0`](https://github.com/phpstan/phpstan/releases/tag/1.2.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.1.2...1.2.0) # Improvements 🔧 - Support for some features from PHP 8.1 - Support for `new` in initializers - [RFC](https://wiki.php.net/rfc/new_in_initializers) (https://github.com/phpstan/phpstan-src/commit/1a102fec28a2901927ce703a540fb82e47d17143) - Support for first-class callables - [RFC](https://wiki.php.net/rfc/first_class_callable_syntax) - Support for `array_is_list()` - [RFC](https://wiki.php.net/rfc/is_list) ([#&#8203;770](https://github.com/phpstan/phpstan-src/pull/770)), thanks [@&#8203;canvural](https://github.com/canvural)! - Support `literal-string` with encapsed strings ([#&#8203;768](https://github.com/phpstan/phpstan-src/pull/768)), thanks [@&#8203;craigfrancis](https://github.com/craigfrancis)! - Tips for always used properties and constants extensions (https://github.com/phpstan/phpstan-src/commit/2db3c268e26d44125aa728c917ba51ec400b46b3) - Autowire rules from the `rules` config section by their class name (https://github.com/phpstan/phpstan-src/commit/50cb90ddc6e6f6bdd248b7ea4bb5002193e808d6) # Bugfixes 🐛 - Type system: ConstantStringType created from `::class` is always considered a classname (https://github.com/phpstan/phpstan-src/commit/da34d3f1d642d71d5a5130d371bb243c65b0b195), [#&#8203;5979](https://github.com/phpstan/phpstan/issues/5979) - Do not run PHP bug workaround on PHP 8+ where it's fixed (https://github.com/phpstan/phpstan-src/commit/6573959829e3d07e1fa2a93845c973d47a12fdfd), [#&#8203;5954](https://github.com/phpstan/phpstan/issues/5954) - Promoted properties do not have a default value (https://github.com/phpstan/phpstan-src/commit/7c8e81dcf88378039ac57da459b4288b7e620a59), [#&#8203;5906](https://github.com/phpstan/phpstan/issues/5906) - CleaningParser - do not remove inline `@var` tags (https://github.com/phpstan/phpstan-src/commit/2652f2dc6c713ba2200df922a62fe651f2e4445e), [#&#8203;5921](https://github.com/phpstan/phpstan/issues/5921) - AttributesCheck - do not report named arguments in attributes (https://github.com/phpstan/phpstan-src/commit/6366066f3b28a5bdef0c6a3d533c291a8490e1f8), [#&#8203;5898](https://github.com/phpstan/phpstan/issues/5898) # Function signature fixes 🤖 - functionMap - removed functions that are reserved keywords and separate AST nodes (https://github.com/phpstan/phpstan-src/commit/08f3e2d02329fa39561356c630d8d561631419d9), [#&#8203;6014](https://github.com/phpstan/phpstan/issues/6014) ### [`v1.1.2`](https://github.com/phpstan/phpstan/releases/tag/1.1.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.1.1...1.1.2) # Bugfixes 🐛 - Properties are read when using AssignRef (`=&`) too (https://github.com/phpstan/phpstan-src/commit/74787be3fe520a72febf3b779f12e9ad9e471c85), [#&#8203;5935](https://github.com/phpstan/phpstan/issues/5935) - Fixed internal error with method attributes referencing `self::` (https://github.com/phpstan/phpstan-src/commit/b5e44f7936d54accf7c5f5e5df9941b884f5b779), [#&#8203;5951](https://github.com/phpstan/phpstan/issues/5951) - Fix stub namespaces in some extensions like `pecl_http` (https://github.com/ondrejmirtes/BetterReflection/commit/9f2b6eb6b8c17949bf82a46c34167504de0b0782, https://github.com/ondrejmirtes/BetterReflection/commit/bdd25238b192396e633d9ca07a25f2da724a9dc0), [#&#8203;5460](https://github.com/phpstan/phpstan/issues/5460), thanks [@&#8203;kukulich](https://github.com/kukulich)! - Do not attempt to clear old containers if the directory does not exist (https://github.com/phpstan/phpstan-src/commit/2427b83fc13d8151034ae57cc625e525897af748) # Function signature fixes 🤖 - Mark file resource functions as having side effects ([#&#8203;698](https://github.com/phpstan/phpstan-src/pull/698)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Use positive integers for various time functions ([#&#8203;760](https://github.com/phpstan/phpstan-src/pull/760)), thanks [@&#8203;staabm](https://github.com/staabm)! ### [`v1.1.1`](https://github.com/phpstan/phpstan/releases/tag/1.1.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.1.0...1.1.1) # Bugfixes 🐛 - Fixed `/** @&#8203;phpstan-ignore-line */` and `/** @&#8203;phpstan-ignore-next-line */` annotations sometimes not working because of AST (https://github.com/phpstan/phpstan-src/commit/9474696dff040ba6d5a9adadc8c87551074cbf94), [#&#8203;4750](https://github.com/phpstan/phpstan/issues/4750), [#&#8203;4759](https://github.com/phpstan/phpstan/issues/4759), [#&#8203;3834](https://github.com/phpstan/phpstan/issues/3834), [#&#8203;3563](https://github.com/phpstan/phpstan/issues/3563), [#&#8203;4250](https://github.com/phpstan/phpstan/issues/4250), [#&#8203;4798](https://github.com/phpstan/phpstan/issues/4798) - Do not report non-existent function after `function_exists()` check (https://github.com/phpstan/phpstan-src/commit/28e8c11a2bdf11eede53a152825fd3bd7733d95d), [#&#8203;3576](https://github.com/phpstan/phpstan/issues/3576) - Make `function_exists()` similar to `is_callable()` (https://github.com/phpstan/phpstan-src/commit/4a988637e67b6ff6854192c57adbbe3c32d62629), [#&#8203;1849](https://github.com/phpstan/phpstan/issues/1849) ### [`v1.1.0`](https://github.com/phpstan/phpstan/releases/tag/1.1.0) [Compare Source](https://github.com/phpstan/phpstan/compare/1.0.2...1.1.0) # Improvements 🔧 - Update `nikic/php-parser` to 4.13.1 (https://github.com/phpstan/phpstan-src/commit/6a64c8aa95ebdd15832cf482d10e543cbe18ae35), [#&#8203;5458](https://github.com/phpstan/phpstan/issues/5458) - Update `jetbrains/phpstorm-stubs` (https://github.com/phpstan/phpstan-src/commit/546e87c61ff1b8591c7300d16484093870410a8c), [#&#8203;5833](https://github.com/phpstan/phpstan/issues/5833) - Support for `PhpStormStubsElementAvailable` attribute in `jetbrains/phpstorm-stubs` (https://github.com/phpstan/phpstan-src/commit/e41e66a1ecab998ed6e49376e6a5d0894c8ccc98) - Support for some features from PHP 8.1 - Support for native `never` return type - [RFC](https://wiki.php.net/rfc/noreturn_type) (https://github.com/phpstan/phpstan-src/commit/59be92fd7e736217185b075c99d2fca21a6393b1) - Support for native pure intersection types - [RFC](https://wiki.php.net/rfc/pure-intersection-types) (https://github.com/phpstan/phpstan-src/commit/be0555743559a43c183089417a390299a11b7a3b, https://github.com/phpstan/phpstan-src/commit/021e25ed2b6da96401ef754455ac5589db8eeda1), [#&#8203;5870](https://github.com/phpstan/phpstan/issues/5870) - Support for tentative return types - [RFC](https://wiki.php.net/rfc/internal_method_return_types) (https://github.com/phpstan/phpstan-src/commit/0e98150eff1d71de28c683a8de115c4efef83b8a, https://github.com/phpstan/phpstan-src/commit/762fc470a2b5308d4d0469457bac809e6ddc2196) - ReflectionEnum runtime stubs (PHP 8.0+) (https://github.com/phpstan/phpstan-src/commit/e3a0e0d1b968c4338d2a50d76562c49e49521565) - Full Enums support is coming in a later release # Bugfixes 🐛 - Fix chaining nullsafe operator ([#&#8203;752](https://github.com/phpstan/phpstan-src/pull/752)), [#&#8203;5868](https://github.com/phpstan/phpstan/issues/5868), thanks [@&#8203;olsavmic](https://github.com/olsavmic)! # Function signature fixes 🤖 - Fix return type of `get_loaded_extensions()` ([#&#8203;754](https://github.com/phpstan/phpstan-src/pull/754)), thanks [@&#8203;dktapps](https://github.com/dktapps)! - `call_user_func_array()` support named arguments ([#&#8203;727](https://github.com/phpstan/phpstan-src/pull/727)), thanks [@&#8203;mglaman](https://github.com/mglaman)! - `phpversion()` does not return false when no arguments are given ([#&#8203;753](https://github.com/phpstan/phpstan-src/pull/753)), thanks [@&#8203;dktapps](https://github.com/dktapps)! ### [`v1.0.2`](https://github.com/phpstan/phpstan/releases/tag/1.0.2) [Compare Source](https://github.com/phpstan/phpstan/compare/1.0.1...1.0.2) # Bugfixes 🐛 - Analyze `Composer` namespace only with static reflection, some classes in PHAR are unprefixed (https://github.com/phpstan/phpstan-src/commit/95754d1c52c99a9cfebfb595d58413955bbe61d4), https://github.com/composer/composer/pull/10253 - ArrayType - use BenevolentUnionType even if it contains StrictMixedType (https://github.com/phpstan/phpstan-src/commit/c59330c539a5cabba7a1c06a7f468d0c3a7dcfa7), [#&#8203;5834](https://github.com/phpstan/phpstan/issues/5834), [#&#8203;5881](https://github.com/phpstan/phpstan/issues/5881), [#&#8203;5872](https://github.com/phpstan/phpstan/issues/5872), [#&#8203;5861](https://github.com/phpstan/phpstan/issues/5861) - This fixes "expects array, array given" errors # Function signature fixes 🤖 - Unified the name of the second `array_map` parameter (https://github.com/phpstan/phpstan-src/commit/94333459e3fc2cfdd2800437e2bb336bb46d304f) - More precise `connection_aborted()` signature ([#&#8203;715](https://github.com/phpstan/phpstan-src/pull/715)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise `str_split()` signature ([#&#8203;718](https://github.com/phpstan/phpstan-src/pull/718)), thanks [@&#8203;staabm](https://github.com/staabm)! - `DateFunctionReturnTypeExtension`: support more precise single-char date-formats ([#&#8203;721](https://github.com/phpstan/phpstan-src/pull/721)), thanks [@&#8203;staabm](https://github.com/staabm)! - Support `$preserve_keys` argument for `iterator_to_array()` ([#&#8203;748](https://github.com/phpstan/phpstan-src/pull/748)), thanks [@&#8203;Lctrs](https://github.com/Lctrs)! ### [`v1.0.1`](https://github.com/phpstan/phpstan/releases/tag/1.0.1) [Compare Source](https://github.com/phpstan/phpstan/compare/1.0.0...1.0.1) - Fixed "Expected node type PhpParser\Node\Stmt\Property, NULL occurred" (https://github.com/phpstan/phpstan-src/commit/e5f8e72c41692014f1352c411e81e605b694fabe), [#&#8203;5875](https://github.com/phpstan/phpstan/issues/5875) - `DerivativeContainerFactory` - pass all arguments to the derived container (https://github.com/phpstan/phpstan-src/commit/f28c7e9d06f65fff2ebcb954a581989078929a90) - `PhpStanNamespaceIn3rdPartyPackageRule` - fix segfault when there's no composer.json (https://github.com/phpstan/phpstan-src/commit/d4efedbd50af2317b18a2628cbadac40d66eed6d) ### [`v1.0.0`](https://github.com/phpstan/phpstan/releases/tag/1.0.0) [Compare Source](https://github.com/phpstan/phpstan/compare/0.12.100...1.0.0) **PHPStan 1.0 is here** and I'm really excited about it! [Read the accompanying article](https://phpstan.org/blog/phpstan-1-0-released) on PHPStan's blog and also [check out the merchandise](https://phpstan.org/merch) we're selling for limited time (until November 22nd). It includes white and blue PHPStan t-shirts, PHPStan stickers, and also something very special: Rule level badges that you can pin to your clothes to show off that you care about code quality 😊 <a href="https://phpstan.org/merch"><img src="https://phpstan.org/images/og-merch.jpg" width="600" alt="White and blue PHPStan T-shirts"></a> # Major new features 🚀 - Level 9 with checkExplicitMixed (https://github.com/phpstan/phpstan-src/commit/e5bbb52fbc9139502f231999173ba6412e62587d) - Consistent remembering and forgetting returned values (https://github.com/phpstan/phpstan-src/commit/d4edc59b36927a2d70f2e8665e657f99dd9d6be2) - [Learn more on PHPStan's blog](https://phpstan.org/blog/remembering-and-forgetting-returned-values) - Fixes: [#&#8203;2420](https://github.com/phpstan/phpstan/issues/2420), [#&#8203;4588](https://github.com/phpstan/phpstan/issues/4588), [#&#8203;3553](https://github.com/phpstan/phpstan/issues/3553), [#&#8203;3382](https://github.com/phpstan/phpstan/issues/3382), [#&#8203;4177](https://github.com/phpstan/phpstan/issues/4177), [#&#8203;4091](https://github.com/phpstan/phpstan/issues/4091), [#&#8203;2288](https://github.com/phpstan/phpstan/issues/2288), [#&#8203;1157](https://github.com/phpstan/phpstan/issues/1157) - Precise try-catch-finally analysis (https://github.com/phpstan/phpstan-src/commit/4588e73dd618e1077bfe1cec7b8e62e251d5eb95) - [Learn more on PHPStan's blog](https://phpstan.org/blog/precise-try-catch-finally-analysis) - Validate overriding methods in stubs (https://github.com/phpstan/phpstan-src/commit/c98d0a4946c373543c379427983e02ccef71f86c) - Nicer type descriptions usable in PHPDocs (https://github.com/phpstan/phpstan-src/commit/03341cc6bf010faf1e99f1dbddf5cea66d56e3cf, https://github.com/phpstan/phpstan-src/commit/51d7431dbe802827bac61907d7bcb58a168dff81) **New rules** - Level 0 - Check leading and trailing file whitespace and BOM (https://github.com/phpstan/phpstan-src/commit/6905d66cf4256eae48ae997b88fbbc58e0ad2ae8) - Check overriding constants (https://github.com/phpstan/phpstan-src/commit/89acb0db4400c95b231ae74830e8607d72824cbc) - Check classes extending `@final` classes (https://github.com/phpstan/phpstan-src/commit/dffd2c2351e5fc5d22b752bf3b8be84bf1708f71), https://github.com/phpstan/phpstan/discussions/5343 - Check that function-scoped template type is in a parameter (https://github.com/phpstan/phpstan-src/commit/18bdd34a808763764ea281d4f1b62fc0e7968873) - Check overriding properties (https://github.com/phpstan/phpstan-src/commit/0f4885aa101e0cc49f906e72990e356bd281ec63), [#&#8203;4281](https://github.com/phpstan/phpstan/issues/4281) - Level 1 - Rule for checking null-coalescing `??` operator issues ([#&#8203;36](https://github.com/phpstan/phpstan-src/pull/36)), thanks [@&#8203;leongersen](https://github.com/leongersen)! - Level 2 - Detect wrong usage of `@var` PHPDoc tag (https://github.com/phpstan/phpstan-src/commit/58860536dcc60bfc86c29ad67711ed1b19046cb0) - Rules for accessing private class elements through `static::` (https://github.com/phpstan/phpstan-src/commit/d8e89538ac84236cb3c40ea85b524e4f7cc30852, https://github.com/phpstan/phpstan-src/commit/bad2607a032787d822a1a8f91d5176455eac8693, https://github.com/phpstan/phpstan-src/commit/270326a1ed22398a98b15880e12a3b8015a83c4a) - Class constants - incompatible PHPDoc types (https://github.com/phpstan/phpstan-src/commit/780a54cd0149d8cb5a62bb1ef6fa2b0871114ee5) - Cross-check generic interface implementations (https://github.com/phpstan/phpstan-src/commit/284af50d76210a449f210699732171ecacf3307f), [#&#8203;5222](https://github.com/phpstan/phpstan/issues/5222) - Level 3 - Check that function with `@throws void` does not have an explicit throw point (https://github.com/phpstan/phpstan-src/commit/8b3382aceac801b9801fccda253033d8e8e5f655) - Check array deconstruction (https://github.com/phpstan/phpstan-src/commit/aae34d935081a8f8d34f5bd9bdf50ebdfdb85a7e), [#&#8203;3267](https://github.com/phpstan/phpstan/issues/3267) - Level 4 - Detect unused and write-only/read-only private properties, methods, and constants - [Read more on the PHPStan's blog](http://phpstan.org/blog/detecting-unused-private-properties-methods-constants) - Rule for checking additional issues like always-defined/never-defined properties, array offsets etc. in `isset()` (https://github.com/phpstan/phpstan-src/commit/25b61d974f5ca1cb00d7d2be4dce750553787b87) - `empty()` rule (https://github.com/phpstan/phpstan-src/commit/601460ccecfd72888d96e9c53d21cc3a8b66c719), [#&#8203;970](https://github.com/phpstan/phpstan/issues/970) - While loop - detect always true and always false conditions (https://github.com/phpstan/phpstan-src/commit/217fac309862f82485f8b756f09665192235aa13, https://github.com/phpstan/phpstan-src/commit/fb3f83e8f601b31a6eb5a12d58211dfced629821) - Do-while loop - detect always true and always false conditions (https://github.com/phpstan/phpstan-src/commit/e81ccd40a4872bde4f6578919b93b4d821021557) - Report dead catch with exception that is not thrown in the try block (https://github.com/phpstan/phpstan-src/commit/ce9299c0e9ab55fc63d7a2e0814c99cc221cb514) - Rule for detecting overwriting exit points in finally (https://github.com/phpstan/phpstan-src/commit/3f712be7c4a840fcae3bb8d3ebfa888ead4e964e) - Level 5 - Check callable parameter types for `array_map()` and `array_filter()` calls ([#&#8203;555](https://github.com/phpstan/phpstan-src/pull/555)), [#&#8203;5609](https://github.com/phpstan/phpstan/issues/5609), [#&#8203;5356](https://github.com/phpstan/phpstan/issues/5356), [#&#8203;1954](https://github.com/phpstan/phpstan/issues/1954), thanks [@&#8203;BackEndTea](https://github.com/BackEndTea)! - `implode()` function rule ([#&#8203;679](https://github.com/phpstan/phpstan-src/pull/679)), thanks [@&#8203;staabm](https://github.com/staabm)! - Check `DateTime` instantiation ([#&#8203;380](https://github.com/phpstan/phpstan-src/pull/380)), thanks [@&#8203;b1rdex](https://github.com/b1rdex)! - `random_int()` dynamic return type extension and parameters rule ([#&#8203;99](https://github.com/phpstan/phpstan-src/pull/99)), thanks [@&#8203;cs278](https://github.com/cs278)! - Level 6 - Detect unresolvable return type after generic function call (https://github.com/phpstan/phpstan-src/commit/9070c5bce39105a186d03e3e5b6871c2b5d28550), [#&#8203;2581](https://github.com/phpstan/phpstan/issues/2581) - Inspect types for missing typehints recursively (https://github.com/phpstan/phpstan-src/commit/2f456b91bbbc8c376ad4e5866fc7a7b457710eab), [#&#8203;5148](https://github.com/phpstan/phpstan/issues/5148) # BC breaks for end-users - Level `max` is now level 9. Feel free to update `max` to `8` if your code isn't ready. - Description of some types was updated to match the syntax in PHPDocs. This includes `numeric-string` (it was previously described as `string&numeric`), and also [array shapes](https://phpstan.org/writing-php-code/phpdoc-types#array-shapes). - Removed `baselineNeon` error formatter, use `--generate-baseline` CLI option instead (https://github.com/phpstan/phpstan-src/commit/492cfbcd74b540eda1520e11b67d7be00cbc7c31) - Removed `polluteCatchScopeWithTryAssignments` config parameter (https://github.com/phpstan/phpstan-src/commit/8933c7e28c2ebb1fd69584c031f579cd53ddf4ae) - Removed deprecated `autoload_files` parameter - use [Discovering Symbols](https://phpstan.org/user-guide/discovering-symbols) instead (https://github.com/phpstan/phpstan-src/commit/7a21246cae9dd7968bf7bef92223b53f5d681b72) - Removed deprecated `autoload_directories` parameter - use [Discovering Symbols](https://phpstan.org/user-guide/discovering-symbols) instead (https://github.com/phpstan/phpstan-src/commit/f67b48a71220b295a1704fe9749492e5de9ee18f) - Removed `bootstrap` parameter - use `bootstrapFiles` instead (https://github.com/phpstan/phpstan-src/commit/1baa29425d2e170af8ac53e4e579c34c25b640e4) - Moved `implicitThrows` configuration parameter to `exceptions.implicitThrows` (https://github.com/phpstan/phpstan-src/commit/96b7c48025dcbd5a709cea71ee4e9e73770e0d54) - Removed `--paths-file` CLI option (https://github.com/phpstan/phpstan-src/commit/5670cf221723eb652643623ad487351cb187f6c3), [#&#8203;5756](https://github.com/phpstan/phpstan/issues/5756) - Removed `dump-deps` command (https://github.com/phpstan/phpstan-src/commit/9c7017c697c29668f8a7c766236e597737f99f91) - Deprecated `excludes_analyse` option, use `excludePaths` instead (https://github.com/phpstan/phpstan-src/commit/d25c5e5a6c62a4537d4a108707ff26b5bea687d9) The following are interesting only if you create a custom ruleset in your configuration file: - Removed `DeadCatchRule`, replaced by `CatchWithUnthrownExceptionRule` (https://github.com/phpstan/phpstan-src/commit/4dba60bacbf3ac0efe8627fa32177ee21cdd3eca) - Removed `VariableCertaintyInIssetRule`, replaced by `IssetRule` (https://github.com/phpstan/phpstan-src/commit/2e858dee389d4843e4d1a7dc1bc565c264be247f) - Removed `MissingClosureNativeReturnTypehintRule`, no longer needed thanks to type inference (https://github.com/phpstan/phpstan-src/commit/1c34d8dc855cb5f4cf5c8b033b7155eeed0e277b) - Rename rules with typos (https://github.com/phpstan/phpstan-src/commit/003ab1aea558085cd27636a0b95a4c9f0e062e9a) # BC breaks for extension developers - Extensions are checked with rules for correct usage of PHPStan internals according to [backward compatibility promise](https://phpstan.org/developing-extensions/backward-compatibility-promise). - Thanks to upgrading `nikic/php-parser` to [version 4.13.0](https://github.com/nikic/PHP-Parser/releases/tag/v4.13.0), you should now use `->getArgs()` instead of `->args` wherever possible. \* Helpful message about this change is also included in PHPStan itself: https://github.com/phpstan/phpstan-src/commit/c836a423d34faa818127e34efb89ef4b3a7b66b6 - `PHPStan\Parser\Parser` service is no longer autowired. You need to choose the right instance for your needs and register it in the [`arguments` section of your service](https://phpstan.org/developing-extensions/dependency-injection-configuration) that needs the parser in the configuration. The Parser services you can choose from are: - `@defaultAnalysisParser` - the best choice if you're parsing files that are among the analysed files - `@currentPhpVersionSimpleDirectParser` - the closest choice to default behaviour from previous PHPStan versions - [Read more about this here.](https://github.com/rectorphp/rector/issues/6744#issuecomment-950282826) - Helpful message about this change is also included in PHPStan itself: https://github.com/phpstan/phpstan-src/commit/038c7a518f57b1a04536b038d24f110f9d06aa01 - Removed `CompoundTypeHelper` (https://github.com/phpstan/phpstan-src/commit/145c4e3af4045b074b1d6e697022a835433cd5f2) - Removed `CommentHelper` (https://github.com/phpstan/phpstan-src/commit/ebad6f61b9a65b68c200f7ac3a444ce198149396) - Removed `DependencyDumper` (https://github.com/phpstan/phpstan-src/commit/9c7017c697c29668f8a7c766236e597737f99f91) - Removed `PHPStan\Reflection\Generic\ResolvedFunctionVariant`, replaced by `PHPStan\Reflection\ResolvedFunctionVariant` (https://github.com/phpstan/phpstan-src/commit/1cc6c8175a6d92cf717cd553506c9da8a2dd72cc) - Removed `ClassReflection::getNativeMethods()`, use `getNativeReflection()` instead (https://github.com/phpstan/phpstan-src/commit/d2c1446b3b0f581502019c522ccb521b37e7dc15) - Removed `PhpPropertyReflection::hasPhpDoc()`, replaced by `hasPhpDocType()` (https://github.com/phpstan/phpstan-src/commit/bedd5be99107254f42efb7728c9ce3a7b958e33e) - `NodeDependencies` no longer iterable (https://github.com/phpstan/phpstan-src/commit/f76875a84d8dcca8f9d67c08b6492c609e9aff98) - Renamed `TestCase` to `PHPStanTestCase` ([#&#8203;634](https://github.com/phpstan/phpstan-src/pull/634)), thanks [@&#8203;frankdejonge](https://github.com/frankdejonge)! - `StaticType` and `ThisType` - require `ClassReflection` in constructor (https://github.com/phpstan/phpstan-src/commit/7aabc848351689f18a1db99598df8d5b4944aa87) - `PHPStanTestCase` - extensions can no longer be provided by overriding methods from `PHPStanTestCase`. Use `getAdditionalConfigFiles()` instead. (https://github.com/phpstan/phpstan-src/commit/65efd93f764e9db076851ef262179fe670f1ab38, https://github.com/phpstan/phpstan-src/commit/239291a91089da6684d8c52e58b9a77ceb178071) - Removed some unused internal helper methods from Broker (https://github.com/phpstan/phpstan-src/commit/d57815103091d8f25347b8441da3ed099f70d7af) - Changed return types of various methods that had `|false` to `|null` (https://github.com/phpstan/phpstan-src/commit/629ccf6b02146e1cbf0499982358c595e3d6edd5) - Type generalization precision is now a required argument (https://github.com/phpstan/phpstan-src/commit/65681033ff625c67a478212a0cd6da29cd5ab5fa) - Some constructor parameters are now required (https://github.com/phpstan/phpstan-src/commit/1f4062fe2d0d5406e9b8a782f99b6da61eceafde) - Deprecated `BrokerAwareExtension` (https://github.com/phpstan/phpstan-src/commit/db2f7fb9e7928de68665ca09a3e1002d8a329b33) - Deprecated `PHPStanTestCase::createBroker()`. Use `createReflectionProvider()` instead. (https://github.com/phpstan/phpstan-src/commit/1e5cf58e07446e634803c3be87e7c41fdd903c7c) - Deprecated `PHPStan\Broker\Broker`. Use `PHPStan\Reflection\ReflectionProvider` instead. (https://github.com/phpstan/phpstan-src/commit/c7755948c124cfbcb1220ab912a6eaa863cdf5fb) - Deprecated `PHPStan\Broker\Broker::getInstance()`. Use `PHPStan\Reflection\ReflectionProviderStaticAccessor` instead. (https://github.com/phpstan/phpstan-src/commit/4e7d60d74b3fda7dc4d3e0c0798b7fd55a7b32f2) - Cannot create `IntersectionType` with less than two types (https://github.com/phpstan/phpstan-src/commit/f7d232a666151bd3cd6417e103b358b8b13afa69) - Removed `ReflectionWithFilename`, use `ClassReflection|FunctionReflection` instead (https://github.com/phpstan/phpstan-src/commit/3738fcd98a98f5a8ef61b40a4c0c5384b7704714) # Improvements 🔧 - Performance optimizations - use is_file() over file_exists(), which is faster ([#&#8203;724](https://github.com/phpstan/phpstan-src/pull/724)), thanks [@&#8203;staabm](https://github.com/staabm)! - faster IgnoredError->shouldIgnore() ([#&#8203;736](https://github.com/phpstan/phpstan-src/pull/736)), thanks [@&#8203;staabm](https://github.com/staabm)! - faster `FileHelper::normalizePath()` ([#&#8203;735](https://github.com/phpstan/phpstan-src/pull/735)), thanks [@&#8203;staabm](https://github.com/staabm)! - faster `TypeCombinator::compareTypesInUnion()` ([#&#8203;742](https://github.com/phpstan/phpstan-src/pull/742)), thanks [@&#8203;voku](https://github.com/voku)! - faster `TypeCombinator::union()` ([#&#8203;743](https://github.com/phpstan/phpstan-src/pull/743)), thanks [@&#8203;voku](https://github.com/voku)! - faster `TypeCombinator::union()` v2 ([#&#8203;747](https://github.com/phpstan/phpstan-src/pull/747)), thanks [@&#8203;voku](https://github.com/voku)! - faster `TypeCombinator::intersect()` ([#&#8203;747](https://github.com/phpstan/phpstan-src/pull/747)), thanks [@&#8203;voku](https://github.com/voku)! - faster `TypeCombinator::remove()` ([#&#8203;746](https://github.com/phpstan/phpstan-src/pull/746)), thanks [@&#8203;voku](https://github.com/voku)! - TypeCombinator - call count() less often (https://github.com/phpstan/phpstan-src/commit/f3c054b19975d570991b2ea99c1ca1c42d42161c) - TypeCombinator - eliminate same types before normalization (https://github.com/phpstan/phpstan-src/commit/ac6a1022ff90851171f29cbceb45b1d639099255) - This caused bad memory leak (https://github.com/phpstan/phpstan-src/commit/25cb765aca4c9a3ab05fee99ff3295b61ccaf7c0) - Improve memory consumption (https://github.com/phpstan/phpstan-src/commit/d781e34a35e1dd6d6918b3160edae8d93b9fae6b) - FileExcluder: Improve performance of isExcludedFromAnalysing ([#&#8203;728](https://github.com/phpstan/phpstan-src/pull/728)), thanks [@&#8203;dktapps](https://github.com/dktapps)! - Changing analysedPaths does not regenerate the DI container (https://github.com/phpstan/phpstan-src/commit/27df5cf55ee17cd3368c9cbecb681105def7f581), [#&#8203;5825](https://github.com/phpstan/phpstan/issues/5825) - Do not clear old containers in worker processes ([#&#8203;733](https://github.com/phpstan/phpstan-src/pull/733)), [#&#8203;5825](https://github.com/phpstan/phpstan/issues/5825), thanks [@&#8203;dktapps](https://github.com/dktapps)! - Always populate `analysedPathsFromConfig` (https://github.com/phpstan/phpstan-src/commit/9f5f911337e810e5674421abc1745b2f9b6ae0b5), [#&#8203;5850](https://github.com/phpstan/phpstan/issues/5850) - Teach `IssetRule` everything what `VariableCertaintyInIssetRule` does (https://github.com/phpstan/phpstan-src/commit/9689fbd0ed9f8438afc8679c90df61ee48a638fe), [#&#8203;970](https://github.com/phpstan/phpstan/issues/970) - `MissingReturnRule` - make the error non-ignorable for native typehints (https://github.com/phpstan/phpstan-src/commit/9ecefd56d8b1d5cf0100c50d6e620285d5312291) - `get_class()` returns `false` for mixed argument types (https://github.com/phpstan/phpstan-src/commit/e86742db58f9cb3459b777570cc33d64af0ed8fa), [#&#8203;4741](https://github.com/phpstan/phpstan/issues/4741) - Require specifying template types for `RecursiveIterator`, `RecursiveArrayIterator`, `WeakMap` (https://github.com/phpstan/phpstan-src/commit/0b9288832073210d52a3915d9fdc1d7991a1b86b) - Rewrite OptimizedDirectorySourceLocator to use PhpFileCleaner from Composer (https://github.com/phpstan/phpstan-src/commit/b7bd0a98dbe3f8536f92b66ff17a42c98968783c) - Detect stub file added multiple times (https://github.com/phpstan/phpstan-src/commit/4a82eec4044e900be192096d58f04b4e2be80a0a) - Type inference of `new $string` leads to `object`, not `mixed` (https://github.com/phpstan/phpstan-src/commit/78a9f057d7a1c73cc34af70db406b9392ce0ca3a) - Basic support for `interface-string` and `trait-string` (https://github.com/phpstan/phpstan-src/commit/d0ef5d4af755e52eba3fd678bdd28f211f3b7d80) - Change message 'typehint' to 'type' and 'typehint type' to 'type'. ([#&#8203;270](https://github.com/phpstan/phpstan-src/pull/270)), thanks [@&#8203;Danack](https://github.com/Danack)! - IgnoredErrorHelper does not produce warnings, only errors (https://github.com/phpstan/phpstan-src/commit/915fa2e2bb567d22e9d5968008a46e762605c780) - Support general array and array shape as template type bound ([#&#8203;673](https://github.com/phpstan/phpstan-src/pull/673)), thanks [@&#8203;drupol](https://github.com/drupol)! - TypeSpecifierContext - Do not create multiple equivalent objects ([#&#8203;677](https://github.com/phpstan/phpstan-src/pull/677)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - Distinguish circular type aliases from invalid type definitions ([#&#8203;678](https://github.com/phpstan/phpstan-src/pull/678)), thanks [@&#8203;jiripudil](https://github.com/jiripudil)! - more precise `SpecifiedTypes` phpdocs ([#&#8203;682](https://github.com/phpstan/phpstan-src/pull/682)), thanks [@&#8203;staabm](https://github.com/staabm) - Resolve `PHP_INT_MAX` as positive integer ([#&#8203;684](https://github.com/phpstan/phpstan-src/pull/684)), thanks [@&#8203;herndlm](https://github.com/herndlm)! - `config.platform.php` in project's `composer.json` is respected and overrides the current runtime PHP version (https://github.com/phpstan/phpstan-src/commit/d2351952200507028d6785de882aaccf0b649336) - Check LogicalOr and LogicalAnd constant conditions (https://github.com/phpstan/phpstan-src/commit/40a76e88d0866f7d541e0e43364de07c5a94c465, https://github.com/phpstan/phpstan-src/commit/ae9a558484dc4f330873e962b8dc1b2d18f0c9b7) - Tip about template bound type when combined with a native type (https://github.com/phpstan/phpstan-src/commit/5314a6b20503e8e1ccaa74e8dfb1e3c30c5667ed) - define: case_insensitive is ignored, case-insensitive constants are no longer supported ([#&#8203;589](https://github.com/phpstan/phpstan-src/pull/589)), thanks [@&#8203;mglaman](https://github.com/mglaman)! - NativeFunctionReflection deprecated support ([#&#8203;713](https://github.com/phpstan/phpstan-src/pull/713)), thanks [@&#8203;mglaman](https://github.com/mglaman)! - ReturnTypeWillChange attribute class is always defined (https://github.com/phpstan/phpstan-src/commit/c72145976431cf95b90dbb7397b53575597e3b06) - Intersect array key type with `int|string` (https://github.com/phpstan/phpstan-src/commit/724c8bad2e458852f177df26cb863ad62aa0c41d), [#&#8203;3753](https://github.com/phpstan/phpstan/issues/3753) - Inspect prefixed PHPDocs for invalid types recursively (https://github.com/phpstan/phpstan-src/commit/003d235cc59ed2a3b79d2960043d0d2b2d3b72e7), [#&#8203;3723](https://github.com/phpstan/phpstan/issues/3723) - Inspect unresolvable types in PHPDoc recursively (https://github.com/phpstan/phpstan-src/commit/1de5de80ecb02255251ee0324801c56ac30a1943), [#&#8203;3753](https://github.com/phpstan/phpstan/issues/3753) - NameResolver - `preserveOriginalNames` set to true (https://github.com/phpstan/phpstan-src/commit/2a9d1beb7aa15e747d4f5ec486bc762df8ca06e1) - Fixed PHP 8.1 deprecations (https://github.com/phpstan/phpstan-src/commit/4e5ed5d8b9cd5090e8ed5559a9da2454bf081509, https://github.com/phpstan/phpstan-src/commit/fd99879e0bcd53b0586030fba6afe3dcb9ad74d9, https://github.com/phpstan/phpstan-src/commit/9d0e070ed9cacf9093397f16280dab99caf3a37c, https://github.com/phpstan/phpstan-src/commit/458a8fb66300e203ae2e46ceb92fcf66972e83c8, https://github.com/phpstan/phpstan-src/commit/50a7141a6eaa8df169933116164ad12d63f8ebb4) - Analyser: do not report `E_DEPRECATED` (https://github.com/phpstan/phpstan-src/commit/1a4338552e45e4e0026a07682ba13cd516fc6db1) - All FunctionReflection implementations have getFileName() (https://github.com/phpstan/phpstan-src/commit/5ddca4279e348a3e9e8ce1b1dbac70459b7ab20c) # Bugfixes 🐛 - MethodCall with Expr name adds an implicit throw point (https://github.com/phpstan/phpstan-src/commit/84b09349dc04fa30097900b5deb8e316b1657e4b) - Fixed InterRangeType multiplication/division of maximas by a negative constant ([#&#8203;670](https://github.com/phpstan/phpstan-src/pull/670)), thanks [@&#8203;staabm](https://github.com/staabm)! - `Throwable::toString()` can throw an exception (https://github.com/phpstan/phpstan-src/commit/18adc8c99f725ce95f097cba0ece1369626f26d1) - Fixed `new $object` with a template type (https://github.com/phpstan/phpstan-src/commit/956a7f483552dff1e3fb8195651bd983304ac17e) - Respect treatPhpDocAsCertain in IssetCheck ([#&#8203;674](https://github.com/phpstan/phpstan-src/pull/674)), thanks [@&#8203;VincentLanglet](https://github.com/VincentLanglet)! - Function that returns `never` is always an explicit throw point (https://github.com/phpstan/phpstan-src/commit/c362fc59b25e10d3079b5004cd738ae5fd4fed4e), [#&#8203;5627](https://github.com/phpstan/phpstan/issues/5627) - ObjectType - make class line part of the cache key (https://github.com/phpstan/phpstan-src/commit/be27584056cbfe25b6a0e875d3e42e1fcd7efb31), [#&#8203;5639](https://github.com/phpstan/phpstan/issues/5639) - eval function can throw exception ([#&#8203;676](https://github.com/phpstan/phpstan-src/pull/676)), thanks [@&#8203;canvural](https://github.com/canvural)! - Updated BetterReflection with trait fixes (https://github.com/phpstan/phpstan-src/commit/1e717d73c22061a2b275fb73fd27c704588b2be1) - Process do-while loop condition even if the loop always terminates (https://github.com/phpstan/phpstan-src/commit/0837be403f590f857a9ba117fbe236e4ce7dcc99) - Process attribute arguments recursively (https://github.com/phpstan/phpstan-src/commit/0cfeb1b93021e293481e3071196b1d360dc04962), [#&#8203;5651](https://github.com/phpstan/phpstan/issues/5651) - Set the correct method visibility when entering the method in regard to trait adaptation (https://github.com/phpstan/phpstan-src/commit/c524c4e134c547a6ac4d6db9989a37c5ee303489), [#&#8203;4516](https://github.com/phpstan/phpstan/issues/4516) - Fix unreachable code after do-while loop (https://github.com/phpstan/phpstan-src/commit/d484ea890dd09bbd1e2e214f2b5a0ee34f5eab75), [#&#8203;4370](https://github.com/phpstan/phpstan/issues/4370) - sprintf format string needs to be sanitized first (https://github.com/phpstan/phpstan-src/commit/a2bdfd148559dc5314dbd38ef6bb6f70aad0c351), [#&#8203;5669](https://github.com/phpstan/phpstan/issues/5669) - Property assignment invalidates all remembered method values on an object (https://github.com/phpstan/phpstan-src/commit/5f91da66bd865487bc411903640e21acb55f86b1), [#&#8203;5501](https://github.com/phpstan/phpstan/issues/5501) - Fix array_splice bugs (https://github.com/phpstan/phpstan-src/commit/6754df565a75125a800b04892e467d8c0868ab41), [#&#8203;4743](https://github.com/phpstan/phpstan/issues/4743), [#&#8203;5017](https://github.com/phpstan/phpstan/issues/5017) - TypeCombinator - fix segfault (https://github.com/phpstan/phpstan-src/commit/ac5fe1bc92b0a91e7b164c1f43eabf134dcb15b8), [#&#8203;5692](https://github.com/phpstan/phpstan/issues/5692) - Fixed integer range minus bugs ([#&#8203;690](https://github.com/phpstan/phpstan-src/pull/690)), thanks [@&#8203;staabm](https://github.com/staabm)! - Make array_map() accept null as first argument (https://github.com/phpstan/phpstan-src/commit/84bafe79d6b59f18dcbc0b3c8b9978d7af9bd837) - RuleLevelHelper::findTypeToCheck - make null-safe shortcircuiting optional ([#&#8203;687](https://github.com/phpstan/phpstan-src/pull/687)), thanks [@&#8203;olsavmic](https://github.com/olsavmic)! - IntegerRangeMath: cover more maxima cases ([#&#8203;702](https://github.com/phpstan/phpstan-src/pull/702)), thanks [@&#8203;staabm](https://github.com/staabm)! - Update react/child-process (https://github.com/phpstan/phpstan-src/commit/ca3aad0790d9a470f74992e1c0196d593f5bebeb), [#&#8203;5709](https://github.com/phpstan/phpstan/issues/5709) - Variadic parameters in PHP8 can have int|string key ([#&#8203;725](https://github.com/phpstan/phpstan-src/pull/725)), thanks [@&#8203;canvural](https://github.com/canvural)! - Fix CompileCommand renaming PhpStormStubsMap on Windows ([#&#8203;732](https://github.com/phpstan/phpstan-src/pull/732)), thanks [@&#8203;dktapps](https://github.com/dktapps)! - `+`-operator with `non-empty-array` should lead to `non-empty-array` ([#&#8203;739](https://github.com/phpstan/phpstan-src/pull/739)), thanks [@&#8203;staabm](https://github.com/staabm)! # Function signature fixes 🤖 - Rename `$cmp_function` parameters to `$callback` (https://github.com/phpstan/phpstan-src/commit/27a5d0f10b1b9b65c3165ddae500e40b769d1301) - Fix ext-ds.stub ([#&#8203;675](https://github.com/phpstan/phpstan-src/pull/675)), thanks [@&#8203;enumag](https://github.com/enumag)! - ext-ds: \`Sequence::copy()! (https://github.com/phpstan/phpstan-src/commit/2b51392ad6e86b7ac858bc3e0094ef36488977f7), [#&#8203;5638](https://github.com/phpstan/phpstan/issues/5638) - mb_ereg_replace and mb_ereg_replace_callback can return null ([#&#8203;681](https://github.com/phpstan/phpstan-src/pull/681)), thanks [@&#8203;hbrecht](https://github.com/hbrecht)! - Update functionMap for SoapClient methods ([#&#8203;683](https://github.com/phpstan/phpstan/issues/683)) ([#&#8203;683](https://github.com/phpstan/phpstan-src/pull/683)), thanks [@&#8203;hbrecht](https://github.com/hbrecht)! - more precise func_\* types ([#&#8203;697](https://github.com/phpstan/phpstan-src/pull/697)), thanks [@&#8203;staabm](https://github.com/staabm)! - use more precise types in file IO functions ([#&#8203;695](https://github.com/phpstan/phpstan-src/pull/695)), thanks [@&#8203;staabm](https://github.com/staabm)! - Added xdebug 3.1 functions "xdebug_notify" & "xdebug_connect_to_client" ([#&#8203;699](https://github.com/phpstan/phpstan-src/pull/699)), thanks [@&#8203;marc-mabe](https://github.com/marc-mabe)! - Fix signature of ReflectionClass::setStaticPropertyValue() ([#&#8203;691](https://github.com/phpstan/phpstan-src/pull/691)), thanks [@&#8203;jlherren](https://github.com/jlherren)! - mysqli_stmt_param_count() returns a non-negative int ([#&#8203;692](https://github.com/phpstan/phpstan-src/pull/692)), thanks [@&#8203;morozov](https://github.com/morozov)! - preg_match_all can return null (https://github.com/phpstan/phpstan-src/commit/0d025e7bc2ec6e84a441b2da7813ff933b5a00aa) - Add stub for mysqli_stmt properties ([#&#8203;700](https://github.com/phpstan/phpstan-src/pull/700)), thanks [@&#8203;morozov](https://github.com/morozov)! - Remove specific configuration for array_fill() with PHP 8 ([#&#8203;701](https://github.com/phpstan/phpstan-src/pull/701)), thanks [@&#8203;steevanb](https://github.com/steevanb)! - SimpleXMLElement probably iterates over `static` (https://github.com/phpstan/phpstan-src/commit/4653d1574ec85393d2f083ddd134c3d48ec960e1), [#&#8203;5700](https://github.com/phpstan/phpstan/issues/5700) - `exit()` status should be in the range 0 to 254 ([#&#8203;707](https://github.com/phpstan/phpstan-src/pull/707)), thanks [@&#8203;staabm](https://github.com/staabm)! - functionMap: fix callable signature for sapi_windows_set_ctrl_handler() ([#&#8203;708](https://github.com/phpstan/phpstan-src/pull/708)), thanks [@&#8203;dktapps](https://github.com/dktapps)! - More precise dirname signature ([#&#8203;712](https://github.com/phpstan/phpstan-src/pull/712)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise chunk_split signature ([#&#8203;711](https://github.com/phpstan/phpstan-src/pull/711)), thanks [@&#8203;staabm](https://github.com/staabm)! - More precise array\_ unshift signature ([#&#8203;710](https://github.com/phpstan/phpstan-src/pull/710)), thanks [@&#8203;staabm](https://github.com/staabm)! - Document possible return type for PDO::lastInsertId() ([#&#8203;719](https://github.com/phpstan/phpstan-src/pull/719)), thanks [@&#8203;greg0ire](https://github.com/greg0ire)! - More precise json_\* signature ([#&#8203;720](https://github.com/phpstan/phpstan-src/pull/720)), [#&#8203;5809](https://github.com/phpstan/phpstan/issues/5809), thanks [@&#8203;staabm](https://github.com/staabm)! - Implement ArrayAccess in ext-ds ([#&#8203;723](https://github.com/phpstan/phpstan-src/pull/723)), thanks [@&#8203;simPod](https://github.com/simPod)! - mysqli::fetch_fields does not return false ([#&#8203;731](https://github.com/phpstan/phpstan-src/pull/731)), thanks [@&#8203;kamil-tekiela](https://github.com/kamil-tekiela)! - functionMap: fixed incorrect signatures for igbinary_serialize() and igbinary_unserialize() In particular, igbinary_serialize() may return null on error. ([#&#8203;737](https://github.com/phpstan/phpstan-src/pull/737)), thanks [@&#8203;staabm](https://github.com/staabm)! </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODUuOCIsInVwZGF0ZWRJblZlciI6IjM5LjE4NS44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
chore(deps): update dependency phpstan/phpstan to v2
Some checks failed
renovate/artifacts Artifact file update failure
4aaa519367
Author
Collaborator

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: composer.lock
Command failed: composer update phpstan/phpstan:2.1.12 --with-dependencies --ignore-platform-req='ext-*' --ignore-platform-req='lib-*' --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires phpstan/phpstan ^2.0.0 -> satisfiable by phpstan/phpstan[2.1.12].
    - phpstan/phpstan 2.1.12 requires php ^7.4|^8.0 -> your php version (7.3.11; overridden via config.platform, actual: 8.4.4) does not satisfy that requirement.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

### ⚠️ Artifact update problem Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens: - any of the package files in this branch needs updating, or - the branch becomes conflicted, or - you click the rebase/retry checkbox if found above, or - you rename this PR's title to start with "rebase!" to trigger it manually The artifact failure details are included below: ##### File name: composer.lock ``` Command failed: composer update phpstan/phpstan:2.1.12 --with-dependencies --ignore-platform-req='ext-*' --ignore-platform-req='lib-*' --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires phpstan/phpstan ^2.0.0 -> satisfiable by phpstan/phpstan[2.1.12]. - phpstan/phpstan 2.1.12 requires php ^7.4|^8.0 -> your php version (7.3.11; overridden via config.platform, actual: 8.4.4) does not satisfy that requirement. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. ```
Some checks failed
renovate/artifacts Artifact file update failure
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/major-phpstan-packages:renovate/major-phpstan-packages
git switch renovate/major-phpstan-packages

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renovate/major-phpstan-packages
git switch renovate/major-phpstan-packages
git rebase main
git switch main
git merge --ff-only renovate/major-phpstan-packages
git switch renovate/major-phpstan-packages
git rebase main
git switch main
git merge --no-ff renovate/major-phpstan-packages
git switch main
git merge --squash renovate/major-phpstan-packages
git switch main
git merge --ff-only renovate/major-phpstan-packages
git switch main
git merge renovate/major-phpstan-packages
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kumi/alltube-library#31
No description provided.