phpstan/phpstan
### [`v1.9.13`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.13)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.12...1.9.13)
# Bugfixes π
- ctype_digit - support type narrowing with cast parameters ([#2186](https://togithub.com/phpstan/phpstan-src/pull/2186)), [#8714](https://togithub.com/phpstan/phpstan/issues/8714), thanks [@staabm](https://togithub.com/staabm)!
- PHP 8.2: Non-final classes without `#[AllowDynamicProperties]` might still have dynamic properties (https://github.com/phpstan/phpstan-src/commit/051b06ea5b36ce2f6131d07fbfcb4b065bd83ef5), [#8727](https://togithub.com/phpstan/phpstan/issues/8727), [#8474](https://togithub.com/phpstan/phpstan/issues/8474)
### [`v1.9.12`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.12)
[Compare Source](https://togithub.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()` ([#1904](https://togithub.com/phpstan/phpstan-src/pull/1904)), [#5614](https://togithub.com/phpstan/phpstan/issues/5614), thanks [@staabm](https://togithub.com/staabm)!
- Revert for performance reasons: Improve expression type resolving of superglobals (https://github.com/phpstan/phpstan-src/commit/02e1a14b4ca631c80b3eec6696b7483a5534bff7), ([#2012](https://togithub.com/phpstan/phpstan-src/pull/2012))
- Update PhpStorm stubs ([#2185](https://togithub.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 ([#1941](https://togithub.com/phpstan/phpstan-src/pull/1941)), [#2970](https://togithub.com/phpstan/phpstan/issues/2970), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
# Internals π
- Fix bash escaping: Replacing "output" with ENV "INPUT_LOG" ([#2180](https://togithub.com/phpstan/phpstan-src/pull/2180)), thanks [@rez1dent3](https://togithub.com/rez1dent3)!
### [`v1.9.11`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.11)
[Compare Source](https://togithub.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 ([#2177](https://togithub.com/phpstan/phpstan-src/pull/2177)), [#8697](https://togithub.com/phpstan/phpstan/issues/8697), thanks [@zonuexe](https://togithub.com/zonuexe)!
### [`v1.9.10`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.10)
[Compare Source](https://togithub.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](https://togithub.com/phpstan/phpstan-doctrine/issues/413)
### [`v1.9.9`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.9)
[Compare Source](https://togithub.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), [#7547](https://togithub.com/phpstan/phpstan/issues/7547)
- Fix resolving of `__CLASS__`, `__NAMESPACE__` in traits ([#2043](https://togithub.com/phpstan/phpstan-src/pull/2043)), [#3019](https://togithub.com/phpstan/phpstan/issues/3019), thanks [@staabm](https://togithub.com/staabm)!
- `class_implements` dynamic return type extension ([#2023](https://togithub.com/phpstan/phpstan-src/pull/2023)), [#4335](https://togithub.com/phpstan/phpstan/issues/4335), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
# Function signature fixes π€
- `ReflectionClass::newInstanceArgs()` type fix for named arguments ([#2176](https://togithub.com/phpstan/phpstan-src/pull/2176)), [#8679](https://togithub.com/phpstan/phpstan/issues/8679), thanks [@s3b4stian](https://togithub.com/s3b4stian)!
# Internals π
- Exit early in `TrinaryLogic::lazyAnd()` and `lazyOr()` if current instance allows it ([#2173](https://togithub.com/phpstan/phpstan-src/pull/2173)), thanks [@herndlm](https://togithub.com/herndlm)!
- Remove unused iterable check in `MissingTypehintCheck` ([#2174](https://togithub.com/phpstan/phpstan-src/pull/2174)), thanks [@herndlm](https://togithub.com/herndlm)!
### [`v1.9.8`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.8)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.7...1.9.8)
# Improvements π§
- Improve constant string support in DateTime return type extensions ([#2152](https://togithub.com/phpstan/phpstan-src/pull/2152)), thanks [@herndlm](https://togithub.com/herndlm)!
- Improve expression type resolving of superglobals ([#2012](https://togithub.com/phpstan/phpstan-src/pull/2012)), thanks [@herndlm](https://togithub.com/herndlm)!
- Improve integer range multiplication and division ([#1961](https://togithub.com/phpstan/phpstan-src/pull/1961)), thanks [@VincentLanglet](https://togithub.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](https://togithub.com/phpstan/phpstan/discussions/8502)
- Supports functions whose side effects are flipped by parameters ([#2037](https://togithub.com/phpstan/phpstan-src/pull/2037)), [#8440](https://togithub.com/phpstan/phpstan/issues/8440), thanks [@zonuexe](https://togithub.com/zonuexe)!
- `array_shift` et al. have side effects (https://github.com/phpstan/phpstan-src/commit/6276ce1c3e86e18d43989310dbd277e8ea9845f6), [#8084](https://togithub.com/phpstan/phpstan/issues/8084)
- Fix comparison with `get_class()` in traits always evaluate to true ([#2044](https://togithub.com/phpstan/phpstan-src/pull/2044)), [#3633](https://togithub.com/phpstan/phpstan/issues/3633), thanks [@staabm](https://togithub.com/staabm)!
### [`v1.9.7`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.7)
[Compare Source](https://togithub.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), [#8643](https://togithub.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 ([#2161](https://togithub.com/phpstan/phpstan-src/pull/2161)), thanks [@staabm](https://togithub.com/staabm)!
- Fix a few MongoDB definitions ([#2140](https://togithub.com/phpstan/phpstan-src/pull/2140)), thanks [@UCIS](https://togithub.com/UCIS)!
# Internals π
- Added missing namespaces in tests ([#2156](https://togithub.com/phpstan/phpstan-src/pull/2156)), thanks [@staabm](https://togithub.com/staabm)!
### [`v1.9.6`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.6)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.5...1.9.6)
# Improvements π§
- Show combined memory usage in parallel mode ([#2027](https://togithub.com/phpstan/phpstan-src/pull/2027)), [#4683](https://togithub.com/phpstan/phpstan/issues/4683), thanks [@janedbal](https://togithub.com/janedbal)!
# Bugfixes π
- One-part encapsed string is correctly converted to string (https://github.com/phpstan/phpstan-src/commit/dc77608ee9ab22e352cd3df60ce2bc2d8d135abc), [#8635](https://togithub.com/phpstan/phpstan/issues/8635)
- Conditional expressions - do not take conclusions about identical variable in assignment (https://github.com/phpstan/phpstan-src/commit/cde53d19e9b4edf81f4c469b7f2a2c3634004d86), [#8625](https://togithub.com/phpstan/phpstan/issues/8625), [#8621](https://togithub.com/phpstan/phpstan/issues/8621)
### [`v1.9.5`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.5)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.4...1.9.5)
# Improvements π§
- Improve constant string union handling for concat and encapsed string ([#2057](https://togithub.com/phpstan/phpstan-src/pull/2057)), thanks [@schlndh](https://togithub.com/schlndh)!
- PhpVersion: supportsDisjunctiveNormalForm ([#2130](https://togithub.com/phpstan/phpstan-src/pull/2130)), thanks [@janedbal](https://togithub.com/janedbal)!
- Constant scalar types might accept general type from the same family ([#2131](https://togithub.com/phpstan/phpstan-src/pull/2131)) - this moves some errors from earlier levels to level 7
- Implement OversizedArrayBuilder to improve huge constant array performance ([#2116](https://togithub.com/phpstan/phpstan-src/pull/2116)), [#8215](https://togithub.com/phpstan/phpstan/issues/8215), thanks [@staabm](https://togithub.com/staabm)!
- Improve performance again by dumbing down nested arrays ([#2077](https://togithub.com/phpstan/phpstan-src/pull/2077))
- Result cache should not be invalidated by changes to editorUrl, editorUrlTitle and errorFormat parameters ([#2136](https://togithub.com/phpstan/phpstan-src/pull/2136)), thanks [@bendavies](https://togithub.com/bendavies)!
- Faster `MutatingScope::shouldInvalidateExpression()` ([#2139](https://togithub.com/phpstan/phpstan-src/pull/2139)), thanks [@staabm](https://togithub.com/staabm)!
- Add `ReturnStatementsNode::hasNativeReturnTypehint()` ([#2141](https://togithub.com/phpstan/phpstan-src/pull/2141)), thanks [@janedbal](https://togithub.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 ([#2126](https://togithub.com/phpstan/phpstan-src/pull/2126)), thanks [@staabm](https://togithub.com/staabm)!
- Fix `pathinfo($s, PATHINFO_ALL)` return type ([#2014](https://togithub.com/phpstan/phpstan-src/pull/2014)), thanks [@staabm](https://togithub.com/staabm)!
- Bump fidry/cpu-core-counter version ([#2133](https://togithub.com/phpstan/phpstan-src/pull/2133)), thanks [@czukowski](https://togithub.com/czukowski)!
- Fix `MixedType::hasOffsetValueType()` for subtracted types ([#2135](https://togithub.com/phpstan/phpstan-src/pull/2135)), [#6705](https://togithub.com/phpstan/phpstan/issues/6705), thanks [@herndlm](https://togithub.com/herndlm)!
- Fix dumbed down arrays ([#2137](https://togithub.com/phpstan/phpstan-src/pull/2137)), [#8004](https://togithub.com/phpstan/phpstan/issues/8004)
- Return type of `parent::__set_state()` method is only object ([#2138](https://togithub.com/phpstan/phpstan-src/pull/2138)), thanks [@blankse](https://togithub.com/blankse)!
- Fix fatal error when autoloader opens directories ([#2154](https://togithub.com/phpstan/phpstan-src/pull/2154)), thanks [@staabm](https://togithub.com/staabm)!
- Fix returntype for DateInterval::createFromDateString ([#2038](https://togithub.com/phpstan/phpstan-src/pull/2038)), thanks [@verfriemelt-dot-org](https://togithub.com/verfriemelt-dot-org)!
- Fix hasSideEffects for AnnotationMethodReflection ([#2155](https://togithub.com/phpstan/phpstan-src/pull/2155)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Fix constant-string handling in union-types ([#2134](https://togithub.com/phpstan/phpstan-src/pull/2134)), [#8568](https://togithub.com/phpstan/phpstan/issues/8568), [#8562](https://togithub.com/phpstan/phpstan/issues/8562), thanks [@staabm](https://togithub.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 ([#2118](https://togithub.com/phpstan/phpstan-src/pull/2118)), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix typo ([#2127](https://togithub.com/phpstan/phpstan-src/pull/2127)), thanks [@rajyan](https://togithub.com/rajyan)!
- AnalyserIntegrationTest - run with bleedingEdge (https://github.com/phpstan/phpstan-src/commit/db2de6f17469e9bc0d078e09c895d64a39fe14ca)
- Refactor options handling in `FilterVarDynamicReturnTypeExtension` ([#2120](https://togithub.com/phpstan/phpstan-src/pull/2120)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::isScalar()` ([#2149](https://togithub.com/phpstan/phpstan-src/pull/2149)), thanks [@herndlm](https://togithub.com/herndlm)!
- Removed unused fileName in FetchedNode ([#2150](https://togithub.com/phpstan/phpstan-src/pull/2150)), thanks [@staabm](https://togithub.com/staabm)!
- Removed unused NodeList class ([#2151](https://togithub.com/phpstan/phpstan-src/pull/2151)), thanks [@staabm](https://togithub.com/staabm)!
- Add namespace to bug-8573.php / fix `GenericsIntegrationTest` ([#2147](https://togithub.com/phpstan/phpstan-src/pull/2147)), thanks [@herndlm](https://togithub.com/herndlm)!
### [`v1.9.4`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.4)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.3...1.9.4)
# Improvements π§
- Various performance optimizations from [@staabm](https://togithub.com/staabm) ([#2098](https://togithub.com/phpstan/phpstan-src/pull/2098), [#2099](https://togithub.com/phpstan/phpstan-src/pull/2099), [#2100](https://togithub.com/phpstan/phpstan-src/pull/2100), [#2101](https://togithub.com/phpstan/phpstan-src/pull/2101), [#2103](https://togithub.com/phpstan/phpstan-src/pull/2103), [#2104](https://togithub.com/phpstan/phpstan-src/pull/2104))
- Resolve parameter types only when `checkArgumentTypes=true` ([#2106](https://togithub.com/phpstan/phpstan-src/pull/2106)), thanks [@staabm](https://togithub.com/staabm)!
- Keep NeverType isExplicit flag in `TypeCombinator::intersect()` ([#2112](https://togithub.com/phpstan/phpstan-src/pull/2112)), thanks [@staabm](https://togithub.com/staabm)!
- Keep NeverType isExplicit flag in `InitializerExprTypeResolver` ([#2114](https://togithub.com/phpstan/phpstan-src/pull/2114)), thanks [@staabm](https://togithub.com/staabm)!
- Add `TypeCombinator::removeFalsey()` ([#2003](https://togithub.com/phpstan/phpstan-src/pull/2003)), thanks [@axlon](https://togithub.com/axlon)!
- Option `usePathConstantsAsConstantString` ([#2050](https://togithub.com/phpstan/phpstan-src/pull/2050)), thanks [@MartinMystikJonas](https://togithub.com/MartinMystikJonas)!
# Bugfixes π
- Fix native type on `unset` ([#2107](https://togithub.com/phpstan/phpstan-src/pull/2107)), [#7805](https://togithub.com/phpstan/phpstan/issues/7805), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix return type of `array_search()` with constant array type haystack ([#1806](https://togithub.com/phpstan/phpstan-src/pull/1806)), [#3789](https://togithub.com/phpstan/phpstan/issues/3789), thanks [@takaram](https://togithub.com/takaram)!
- `parse_str()` might return nested arrays by-ref ([#1994](https://togithub.com/phpstan/phpstan-src/pull/1994)), [#8356](https://togithub.com/phpstan/phpstan/issues/8356), thanks [@staabm](https://togithub.com/staabm)!
- Fix regression in `for` loop (https://github.com/phpstan/phpstan-src/commit/a8975b1800d6c5cb88a6af02e132b4e44e093fc3), [#8520](https://togithub.com/phpstan/phpstan/issues/8520)
- Fix readonly properties bugs and infinite recursion (https://github.com/phpstan/phpstan-src/commit/a7fed03bbf1bef545c8afcbf6c906ac93b34c876), [#8543](https://togithub.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), [#8537](https://togithub.com/phpstan/phpstan/issues/8537)
# Internals π
- Implement `getConstantStrings()` on Type ([#1979](https://togithub.com/phpstan/phpstan-src/pull/1979)), thanks [@staabm](https://togithub.com/staabm)!
- Fix node PHPDoc type hints ([#2053](https://togithub.com/phpstan/phpstan-src/pull/2053)), thanks [@herndlm](https://togithub.com/herndlm)!
- Refactor FilterVarDynamicReturnTypeExtension to pass around Types instead of Args and the Scope ([#2109](https://togithub.com/phpstan/phpstan-src/pull/2109)), thanks [@herndlm](https://togithub.com/herndlm)!
### [`v1.9.3`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.3)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.2...1.9.3)
# Bleeding edge πͺ
- Fix invariance composition ([#2054](https://togithub.com/phpstan/phpstan-src/pull/2054)), thanks [@jiripudil](https://togithub.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 ([#1992](https://togithub.com/phpstan/phpstan-src/pull/1992)), [#8346](https://togithub.com/phpstan/phpstan/issues/8346), [#8094](https://togithub.com/phpstan/phpstan/issues/8094), thanks [@herndlm](https://togithub.com/herndlm)!
- `DateTimeZone::__construct` throw type extension ([#2034](https://togithub.com/phpstan/phpstan-src/pull/2034))
- TableErrorFormatter: allow editor url title configuration ([#2035](https://togithub.com/phpstan/phpstan-src/pull/2035)), [#7796](https://togithub.com/phpstan/phpstan/issues/7796), thanks [@janedbal](https://togithub.com/janedbal)!
- Various generics variance fixes ([#2051](https://togithub.com/phpstan/phpstan-src/pull/2051), [#2064](https://togithub.com/phpstan/phpstan-src/pull/2064)), [#3960](https://togithub.com/phpstan/phpstan/issues/3960), thanks [@jiripudil](https://togithub.com/jiripudil)!
- Add `deprecationRulesInstalled` configuration ([#2062](https://togithub.com/phpstan/phpstan-src/pull/2062)), thanks [@villfa](https://togithub.com/villfa)!
- To be used in phpstan-deprecation-rules and phpstan-phpunit extensions soon!
- ArrayFilterRule should care about `treatPhpDocTypesAsCertain` ([#2065](https://togithub.com/phpstan/phpstan-src/pull/2065)), thanks [@VincentLanglet](https://togithub.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), [#8499](https://togithub.com/phpstan/phpstan/issues/8499), [#8497](https://togithub.com/phpstan/phpstan/issues/8497)
- Remove unnecessary file IO ([#2069](https://togithub.com/phpstan/phpstan-src/pull/2069), [#2094](https://togithub.com/phpstan/phpstan-src/pull/2094)), thanks [@staabm](https://togithub.com/staabm)!
- Reduce calls to `Scope::getType()`. Cheap checks first. ([#2071](https://togithub.com/phpstan/phpstan-src/pull/2071)), thanks [@staabm](https://togithub.com/staabm)!
- Cache resolved phpdoc in ClassReflection ([#2072](https://togithub.com/phpstan/phpstan-src/pull/2072)), thanks [@staabm](https://togithub.com/staabm)!
- Don't re-calculate node-key over and over again ([#2073](https://togithub.com/phpstan/phpstan-src/pull/2073)), thanks [@staabm](https://togithub.com/staabm)!
- Improve the CPU core count detection ([#2047](https://togithub.com/phpstan/phpstan-src/pull/2047)), thanks [@theofidry](https://togithub.com/theofidry)!
- Optimize path related utils on windows ([#2068](https://togithub.com/phpstan/phpstan-src/pull/2068)), thanks [@staabm](https://togithub.com/staabm)!
- Don't re-calculate node-key over and over again - part 2 ([#2074](https://togithub.com/phpstan/phpstan-src/pull/2074)), [#8503](https://togithub.com/phpstan/phpstan/issues/8503), thanks [@staabm](https://togithub.com/staabm)!
- Faster ConstantStringType->toArrayKey() ([#2081](https://togithub.com/phpstan/phpstan-src/pull/2081)), thanks [@staabm](https://togithub.com/staabm)!
- Faster ConstantFloatType->isSuperTypeOf(ConstantFloatType) ([#2080](https://togithub.com/phpstan/phpstan-src/pull/2080)), thanks [@staabm](https://togithub.com/staabm)!
- TypeSpecifier micro-optimization (https://github.com/phpstan/phpstan-src/commit/30e6d19496adb16b6bfd9be1cd1bf767f6ce8713)
- Faster TrinaryLogic->lazyExtremeIdentity() ([#2083](https://togithub.com/phpstan/phpstan-src/pull/2083)), thanks [@staabm](https://togithub.com/staabm)!
- Faster ConstantArrayType->isSuperTypeOf() ([#2086](https://togithub.com/phpstan/phpstan-src/pull/2086)), thanks [@staabm](https://togithub.com/staabm)!
- Loops analysed in linear time instead of exponential time ([#2088](https://togithub.com/phpstan/phpstan-src/pull/2088), [#2091](https://togithub.com/phpstan/phpstan-src/pull/2091)), [#8503](https://togithub.com/phpstan/phpstan/issues/8503), [#6265](https://togithub.com/phpstan/phpstan/issues/6265)
- Remove unnecessary method call to already known value ([#2092](https://togithub.com/phpstan/phpstan-src/pull/2092)), thanks [@staabm](https://togithub.com/staabm)!
# Bugfixes π
- Improve conditionalExpressionTypes ([#1950](https://togithub.com/phpstan/phpstan-src/pull/1950)), [#3677](https://togithub.com/phpstan/phpstan/issues/3677), [#5623](https://togithub.com/phpstan/phpstan/issues/5623), [#5401](https://togithub.com/phpstan/phpstan/issues/5401), [#7292](https://togithub.com/phpstan/phpstan/issues/7292), [#8212](https://togithub.com/phpstan/phpstan/issues/8212), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix conditional variable types in global scope ([#1995](https://togithub.com/phpstan/phpstan-src/pull/1995)), thanks [@rajyan](https://togithub.com/rajyan)!
- Do not invalidate related expressions in ensureNonNullability ([#2004](https://togithub.com/phpstan/phpstan-src/pull/2004)), [#8361](https://togithub.com/phpstan/phpstan/issues/8361), thanks [@rajyan](https://togithub.com/rajyan)!
- Improve create conditional expressions to handle all expressions ([#2007](https://togithub.com/phpstan/phpstan-src/pull/2007)), thanks [@rajyan](https://togithub.com/rajyan)!
- Improve conditional type resolving performance ([#2030](https://togithub.com/phpstan/phpstan-src/pull/2030)), [#8397](https://togithub.com/phpstan/phpstan/issues/8397), [#5805](https://togithub.com/phpstan/phpstan/issues/5805), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix false positive of access to static private property of parent class ([#1989](https://togithub.com/phpstan/phpstan-src/pull/1989)), [#8333](https://togithub.com/phpstan/phpstan/issues/8333), thanks [@staabm](https://togithub.com/staabm)!
- Fix intersecting array shapes with different optional keys ([#2002](https://togithub.com/phpstan/phpstan-src/pull/2002)), [#8373](https://togithub.com/phpstan/phpstan/issues/8373), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Support PHPDoc asserts on variadic parameters ([#2009](https://togithub.com/phpstan/phpstan-src/pull/2009)), [#8389](https://togithub.com/phpstan/phpstan/issues/8389), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Fix `@param-out` on methods ([#2028](https://togithub.com/phpstan/phpstan-src/pull/2028)), [#8421](https://togithub.com/phpstan/phpstan/issues/8421), thanks [@staabm](https://togithub.com/staabm)!
- Do not set native type to `mixed` on annotation assignment ([#2017](https://togithub.com/phpstan/phpstan-src/pull/2017)), thanks [@herndlm](https://togithub.com/herndlm)!
- Consistently pass `$nativeExpressionTypes` in MutatingScope ([#2021](https://togithub.com/phpstan/phpstan-src/pull/2021)), thanks [@herndlm](https://togithub.com/herndlm)!
- Fix infinite loop when fully qualified callback is supplied ([#2005](https://togithub.com/phpstan/phpstan-src/pull/2005)), [#8376](https://togithub.com/phpstan/phpstan/issues/8376), thanks [@cs278](https://togithub.com/cs278)!
- Non-static method DOMDocument::loadHTML() can be called statically ([#2042](https://togithub.com/phpstan/phpstan-src/pull/2042)), [#2759](https://togithub.com/phpstan/phpstan/issues/2759), thanks [@staabm](https://togithub.com/staabm)!
- Fix FuzzyRelativePathHelper for directories ending in `.php` (https://github.com/phpstan/phpstan-src/commit/bff85e27cd486b7ea5c065575a71de66b83b1cf2), [#8480](https://togithub.com/phpstan/phpstan/issues/8480)
# Function signature fixes π€
- ImagickPixel::getColor() normalized param accepts int instead of bool ([#2020](https://togithub.com/phpstan/phpstan-src/pull/2020)), thanks [@blankse](https://togithub.com/blankse)!
- Declare more PDOStatement method types ([#2096](https://togithub.com/phpstan/phpstan-src/pull/2096)), thanks [@staabm](https://togithub.com/staabm)!
# Internals π
- Fix non-working type assertions in `NodeScopeResolverTest` cases ([#1992](https://togithub.com/phpstan/phpstan-src/pull/1992)), thanks [@herndlm](https://togithub.com/herndlm)!
- Use ExpressionTypeHolders for conditional expression type ([#1998](https://togithub.com/phpstan/phpstan-src/pull/1998)), thanks [@rajyan](https://togithub.com/rajyan)!
- Simplify array collections in `UnionTypeHelper` ([#1988](https://togithub.com/phpstan/phpstan-src/pull/1988)), thanks [@herndlm](https://togithub.com/herndlm)!
- Avoid specifying scalar types and delete string casts ([#1999](https://togithub.com/phpstan/phpstan-src/pull/1999)), thanks [@rajyan](https://togithub.com/rajyan)!
- Add filename and line of the error of assertVariableCertainty ([#2008](https://togithub.com/phpstan/phpstan-src/pull/2008)), thanks [@rajyan](https://togithub.com/rajyan)!
- README: how to composer install ([#2025](https://togithub.com/phpstan/phpstan-src/pull/2025)), thanks [@janedbal](https://togithub.com/janedbal)!
- Group `$expressionTypes` and `$nativeExpressionTypes` in Scope creation methods ([#2022](https://togithub.com/phpstan/phpstan-src/pull/2022)), thanks [@herndlm](https://togithub.com/herndlm)!
- Use ExpressionTypeHolder when comparing conditionals ([#2048](https://togithub.com/phpstan/phpstan-src/pull/2048)), thanks [@rajyan](https://togithub.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` ([#2082](https://togithub.com/phpstan/phpstan-src/pull/2082)), thanks [@herndlm](https://togithub.com/herndlm)!
- Get rid of `TypeTraverser` in `ArraySliceFunctionReturnTypeExtension` ([#2085](https://togithub.com/phpstan/phpstan-src/pull/2085)), thanks [@herndlm](https://togithub.com/herndlm)!
- Get rid of `TypeTraverser` in `ArrayReverseFunctionReturnTypeExtension` ([#2084](https://togithub.com/phpstan/phpstan-src/pull/2084)), thanks [@herndlm](https://togithub.com/herndlm)!
- Get rid of `TypeTraverser` in `StrSplitFunctionReturnTypeExtension` ([#2087](https://togithub.com/phpstan/phpstan-src/pull/2087)), thanks [@herndlm](https://togithub.com/herndlm)!
### [`v1.9.2`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.2)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.1...1.9.2)
# Bugfixes π
- Fix array and iterable type action methods on `NeverType` ([#1968](https://togithub.com/phpstan/phpstan-src/pull/1968)), [#8277](https://togithub.com/phpstan/phpstan/issues/8277), thanks [@herndlm](https://togithub.com/herndlm)!
- Support 'HasMethodType' on StaticCall ([#1969](https://togithub.com/phpstan/phpstan-src/pull/1969)), [#1267](https://togithub.com/phpstan/phpstan/issues/1267), thanks [@staabm](https://togithub.com/staabm)!
- Addition operation on MixedType without ArrayType cannot result in ArrayType ([#1949](https://togithub.com/phpstan/phpstan-src/pull/1949)), thanks [@staabm](https://togithub.com/staabm)!
- Remove DateInterval stub ([#1974](https://togithub.com/phpstan/phpstan-src/pull/1974)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Fix invalidate static expressions in closures ([#1983](https://togithub.com/phpstan/phpstan-src/pull/1983)), [#8292](https://togithub.com/phpstan/phpstan/issues/8292), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix false positive of access to private property of parent class ([#1953](https://togithub.com/phpstan/phpstan-src/pull/1953)), [#2435](https://togithub.com/phpstan/phpstan/issues/2435), thanks [@tyabu12](https://togithub.com/tyabu12)!
- Fix unset on nested array ([#1987](https://togithub.com/phpstan/phpstan-src/pull/1987)), [#8113](https://togithub.com/phpstan/phpstan/issues/8113), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
# Function signature fixes π€
- Update DateTimeZone::listAbbreviations signature ([#1962](https://togithub.com/phpstan/phpstan-src/pull/1962)), thanks [@franmomu](https://togithub.com/franmomu)!
- Making `json_encode()` always produce a `non-empty-string`, when successful ([#1980](https://togithub.com/phpstan/phpstan-src/pull/1980)), thanks [@Slamdunk](https://togithub.com/Slamdunk)!
- `sodium_crypto_generichash*` always produce a `non-empty-string` ([#1981](https://togithub.com/phpstan/phpstan-src/pull/1981)), thanks [@Slamdunk](https://togithub.com/Slamdunk)!
- `sodium_crypto_sign*` always produce `non-empty-string` ([#1985](https://togithub.com/phpstan/phpstan-src/pull/1985)), thanks [@Slamdunk](https://togithub.com/Slamdunk)!
# Internals π
- Implement isClassStringType() on Type ([#1970](https://togithub.com/phpstan/phpstan-src/pull/1970)), [#6147](https://togithub.com/phpstan/phpstan/issues/6147), thanks [@staabm](https://togithub.com/staabm)!
- Implement isInteger() on Type ([#1971](https://togithub.com/phpstan/phpstan-src/pull/1971)), thanks [@staabm](https://togithub.com/staabm)!
- Implement isBoolean() on Type ([#1973](https://togithub.com/phpstan/phpstan-src/pull/1973)), thanks [@staabm](https://togithub.com/staabm)!
- Implement isFloat() on Type ([#1977](https://togithub.com/phpstan/phpstan-src/pull/1977)), thanks [@staabm](https://togithub.com/staabm)!
- Implement isNull() on Type ([#1978](https://togithub.com/phpstan/phpstan-src/pull/1978)), thanks [@staabm](https://togithub.com/staabm)!
- Add `Type::isVoid()` ([#1982](https://togithub.com/phpstan/phpstan-src/pull/1982)), thanks [@herndlm](https://togithub.com/herndlm)!
### [`v1.9.1`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.1)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.0...1.9.1)
# Improvements π§
- `AccessoryArrayListType` is part of BC promise ([#1967](https://togithub.com/phpstan/phpstan-src/pull/1967)), thanks [@enumag](https://togithub.com/enumag)!
- Specify types from true/false asserts ([#1957](https://togithub.com/phpstan/phpstan-src/pull/1957)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Support conditional types in phpdoc asserts ([#1964](https://togithub.com/phpstan/phpstan-src/pull/1964)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Let casting `object` to `string` result in an error ([#1948](https://togithub.com/phpstan/phpstan-src/pull/1948)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Add more support for `checkBenevolentUnionTypes` config ([#1940](https://togithub.com/phpstan/phpstan-src/pull/1940)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Error on unknown parameter name in parameter conditional type ([#1966](https://togithub.com/phpstan/phpstan-src/pull/1966)), [#8284](https://togithub.com/phpstan/phpstan/issues/8284), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
# Bugfixes π
- List type cast to array is still a list ([#1958](https://togithub.com/phpstan/phpstan-src/pull/1958), [#1959](https://togithub.com/phpstan/phpstan-src/pull/1959)), [#8280](https://togithub.com/phpstan/phpstan/issues/8280), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix `mt_rand` return type ([#1956](https://togithub.com/phpstan/phpstan-src/pull/1956)), [#8272](https://togithub.com/phpstan/phpstan/issues/8272), thanks [@enumag](https://togithub.com/enumag)!
- `strtr` returns `non-empty-string` ([#1963](https://togithub.com/phpstan/phpstan-src/pull/1963)), thanks [@staabm](https://togithub.com/staabm)!
### [`v1.9.0`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.0)
[Compare Source](https://togithub.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` ([#1317](https://togithub.com/phpstan/phpstan-src/pull/1317)), [#7110](https://togithub.com/phpstan/phpstan/issues/7110), [#8186](https://togithub.com/phpstan/phpstan/issues/8186), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- [Documentation](https://phpstan.org/writing-php-code/narrowing-types#custom-type-checking-functions-and-methods)
- `@phpstan-self-out`/`@phpstan-this-out` support ([#1799](https://togithub.com/phpstan/phpstan-src/pull/1799)), thanks [@rvanvelzen](https://togithub.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 ([#1804](https://togithub.com/phpstan/phpstan-src/pull/1804)), [#7231](https://togithub.com/phpstan/phpstan/issues/7231), [#6871](https://togithub.com/phpstan/phpstan/issues/6871), [#6186](https://togithub.com/phpstan/phpstan/issues/6186), [#4372](https://togithub.com/phpstan/phpstan/issues/4372), [#5785](https://togithub.com/phpstan/phpstan/issues/5785), thanks [@staabm](https://togithub.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()` ([#1477](https://togithub.com/phpstan/phpstan-src/pull/1477)), thanks [@jiripudil](https://togithub.com/jiripudil)!
- [Documentation](https://phpstan.org/developing-extensions/allowed-subtypes)
- Add config parameter `checkBenevolentUnionTypes` to strictly check BenevolentUnionType ([#1930](https://togithub.com/phpstan/phpstan-src/pull/1930)), [#8223](https://togithub.com/phpstan/phpstan/issues/8223), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- [Documentation](https://phpstan.org/config-reference#checkbenevolentuniontypes)
# Bleeding edge πͺ
- **Array `list` type** ([#1751](https://togithub.com/phpstan/phpstan-src/pull/1751)), [#3311](https://togithub.com/phpstan/phpstan/issues/3311), [#8185](https://togithub.com/phpstan/phpstan/issues/8185), [#6243](https://togithub.com/phpstan/phpstan/issues/6243), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Lists are arrays with sequential integer keys starting at 0
- Improve error wording of the NonexistentOffset, BooleanAndConstantConditionRule, and BooleanOrConstantConditionRule ([#1882](https://togithub.com/phpstan/phpstan-src/pull/1882)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- MissingMagicSerializationMethodsRule ([#1711](https://togithub.com/phpstan/phpstan-src/pull/1711)), [#7482](https://togithub.com/phpstan/phpstan/issues/7482), thanks [@staabm](https://togithub.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` ([#1803](https://togithub.com/phpstan/phpstan-src/pull/1803)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Optimize `NonexistentOffsetInArrayDimFetchCheck` ([#1801](https://togithub.com/phpstan/phpstan-src/pull/1801)), thanks [@herndlm](https://togithub.com/herndlm)!
- Modify the built-in `@method` extension to look at `@throws` in \__call ([#1842](https://togithub.com/phpstan/phpstan-src/pull/1842)), [#8163](https://togithub.com/phpstan/phpstan/issues/8163), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Improve impossible type checker for void-returning functions ([#1857](https://togithub.com/phpstan/phpstan-src/pull/1857)), [#8169](https://togithub.com/phpstan/phpstan/issues/8169), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Allow using `$this`/`static` in conditional return types ([#1863](https://togithub.com/phpstan/phpstan-src/pull/1863)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Emit warnings when Xdebug is not used according to CLI flags ([#1878](https://togithub.com/phpstan/phpstan-src/pull/1878)), thanks [@staabm](https://togithub.com/staabm)!
- Improve array_fill return type extension ([#1879](https://togithub.com/phpstan/phpstan-src/pull/1879)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Add support for `mb_convert_case()` and `mb_convert_kana()` ([#1866](https://togithub.com/phpstan/phpstan-src/pull/1866)), thanks [@zonuexe](https://togithub.com/zonuexe)!
- Accept and describe `callable-object` and `callable-string` ([#1906](https://togithub.com/phpstan/phpstan-src/pull/1906)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Add colon as prefix of line number in table report, when running in VSCode terminal ([#1901](https://togithub.com/phpstan/phpstan-src/pull/1901)), [#8086](https://togithub.com/phpstan/phpstan/issues/8086), thanks [@LeoVie](https://togithub.com/LeoVie)!
- Cover ExtendedMethodReflection by BC promise (but not implementing it, only calling the methods) ([#1913](https://togithub.com/phpstan/phpstan-src/pull/1913)), thanks [@staabm](https://togithub.com/staabm)!
- Locate identifiers by type for OptimizedSingleFileSourceLocator ([#1114](https://togithub.com/phpstan/phpstan-src/pull/1114)), thanks [@tomasfejfar](https://togithub.com/tomasfejfar)!
- Implement `FunctionReflection`/`ExtendedMethodReflection::returnsByReference()` ([#1899](https://togithub.com/phpstan/phpstan-src/pull/1899)), [#6005](https://togithub.com/phpstan/phpstan/issues/6005), thanks [@staabm](https://togithub.com/staabm)!
- Add noreturn as PseudoTypeClass ([#1937](https://togithub.com/phpstan/phpstan-src/pull/1937)), [#8242](https://togithub.com/phpstan/phpstan/issues/8242), thanks [@zonuexe](https://togithub.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 ([#1752](https://togithub.com/phpstan/phpstan-src/pull/1752)), [#7996](https://togithub.com/phpstan/phpstan/issues/7996), thanks [@herndlm](https://togithub.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` ([#1796](https://togithub.com/phpstan/phpstan-src/pull/1796)), thanks [@herndlm](https://togithub.com/herndlm)!
- Fix list checking on level 7 vs. level 8 (https://github.com/phpstan/phpstan-src/commit/926058491578747d2f99ec6b02ad28c988f3c28d), [#8071](https://togithub.com/phpstan/phpstan/issues/8071)
- MixedType: support subtracted in array-type methods ([#1852](https://togithub.com/phpstan/phpstan-src/pull/1852)), [#3370](https://togithub.com/phpstan/phpstan/issues/3370), thanks [@staabm](https://togithub.com/staabm)!
- Allow compare SimpleXMLElement to number ([#1755](https://togithub.com/phpstan/phpstan-src/pull/1755)), [#1795](https://togithub.com/phpstan/phpstan/issues/1795), thanks [@muno92](https://togithub.com/muno92)!
- Fix min max call on array of union types ([#1795](https://togithub.com/phpstan/phpstan-src/pull/1795)), [#8088](https://togithub.com/phpstan/phpstan/issues/8088), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)!
- Support `Countable` in `count()` ([#1876](https://togithub.com/phpstan/phpstan-src/pull/1876)), thanks [@staabm](https://togithub.com/staabm)!
- Improve `RuleLevelHelper::accepts()` for constant arrays ([#1911](https://togithub.com/phpstan/phpstan-src/pull/1911)), [#8209](https://togithub.com/phpstan/phpstan/issues/8209), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Fix closure return type based on by-ref use ([#1914](https://togithub.com/phpstan/phpstan-src/pull/1914)), [#6806](https://togithub.com/phpstan/phpstan/issues/6806), [#4739](https://togithub.com/phpstan/phpstan/issues/4739), [#5753](https://togithub.com/phpstan/phpstan/issues/5753), [#6559](https://togithub.com/phpstan/phpstan/issues/6559), [#6902](https://togithub.com/phpstan/phpstan/issues/6902), [#7220](https://togithub.com/phpstan/phpstan/issues/7220), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Consider `get_object_var()` as private property read ([#1902](https://togithub.com/phpstan/phpstan-src/pull/1902)), [#3654](https://togithub.com/phpstan/phpstan/issues/3654), thanks [@vovochka404](https://togithub.com/vovochka404)!
- Temporary solution to handle "maybe" certainty types assign in nativeExpressionTypes ([#1932](https://togithub.com/phpstan/phpstan-src/pull/1932)), thanks [@rajyan](https://togithub.com/rajyan)!
- Refactor arrow function scope logic to make it consistent with anonymous functions ([#1935](https://togithub.com/phpstan/phpstan-src/pull/1935)), thanks [@rajyan](https://togithub.com/rajyan)!
- Fix static bleedingEdge toggles in tests ([#1928](https://togithub.com/phpstan/phpstan-src/pull/1928)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Improve unset on ConstantArrayType ([#1927](https://togithub.com/phpstan/phpstan-src/pull/1927)), [#8225](https://togithub.com/phpstan/phpstan/issues/8225), thanks [@VincentLanglet](https://togithub.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 ([#1915](https://togithub.com/phpstan/phpstan-src/pull/1915)), [#8179](https://togithub.com/phpstan/phpstan/issues/8179), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- `$this` in nativeExpressionTypes ([#1936](https://togithub.com/phpstan/phpstan-src/pull/1936)), thanks [@rajyan](https://togithub.com/rajyan)!
- Handle ClassConstFetch in Scope ([#1944](https://togithub.com/phpstan/phpstan-src/pull/1944)), [#7913](https://togithub.com/phpstan/phpstan/issues/7913), thanks [@rajyan](https://togithub.com/rajyan)!
- Retain non-variable expression types in closure ([#1929](https://togithub.com/phpstan/phpstan-src/pull/1929)), [#8205](https://togithub.com/phpstan/phpstan/issues/8205), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Fix stale result cache for asserts (https://github.com/phpstan/phpstan-src/commit/471265fc62f30504f4a0aecf79585bef42e69213)
- Fix stale result cache for `@phpstan-self-out` ([#1949](https://togithub.com/phpstan/phpstan-src/pull/1949)), thanks [@staabm](https://togithub.com/staabm)!
# Function signature fixes π€
- Fix class_implements return type ([#1797](https://togithub.com/phpstan/phpstan-src/pull/1797)), thanks [@enumag](https://togithub.com/enumag)!
- `mb_check_encoding()` accepts `array` in PHP 7.2+ ([#1867](https://togithub.com/phpstan/phpstan-src/pull/1867)), thanks [@zonuexe](https://togithub.com/zonuexe)!
# Internals π
- Introduce ArrayType traits ([#1715](https://togithub.com/phpstan/phpstan-src/pull/1715)), thanks [@herndlm](https://togithub.com/herndlm)!
- Introduce `Type::getConstantArrays` as successor for `TypeUtils::getOldConstantArrays` ([#1684](https://togithub.com/phpstan/phpstan-src/pull/1684)), thanks [@herndlm](https://togithub.com/herndlm)!
- Deprecate `TypeUtils::getArrays()` and `TypeUtils::getAnyArrays()` ([#1687](https://togithub.com/phpstan/phpstan-src/pull/1687)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::getLastIterableValueType()` ([#1811](https://togithub.com/phpstan/phpstan-src/pull/1811)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::getFirstIterableValueType()` ([#1811](https://togithub.com/phpstan/phpstan-src/pull/1811)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::getFirstIterableKeyType()` and `Type::getLastIterableKeyType()` ([#1812](https://togithub.com/phpstan/phpstan-src/pull/1812)), [#8152](https://togithub.com/phpstan/phpstan/issues/8152), thanks [@herndlm](https://togithub.com/herndlm)!
- Preparation for native types ([#1823](https://togithub.com/phpstan/phpstan-src/pull/1823)), [#5333](https://togithub.com/phpstan/phpstan/issues/5333), thanks [@rajyan](https://togithub.com/rajyan)!
- Move iterable methods from array to iterable traits ([#1821](https://togithub.com/phpstan/phpstan-src/pull/1821)), thanks [@herndlm](https://togithub.com/herndlm)!
- Do not use other traits in `JustNullableTypeTrait` ([#1821](https://togithub.com/phpstan/phpstan-src/pull/1821)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::isConstantArray()` ([#1822](https://togithub.com/phpstan/phpstan-src/pull/1822)), thanks [@herndlm](https://togithub.com/herndlm)!
- Replace single `getConstantArrays()` usage with `isConstantArray()` ([#1827](https://togithub.com/phpstan/phpstan-src/pull/1827)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::getArraySize()` ([#1828](https://togithub.com/phpstan/phpstan-src/pull/1828)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::flipArray()` ([#1832](https://togithub.com/phpstan/phpstan-src/pull/1832)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::getKeysArray()` and `Type::getValuesArray()` ([#1851](https://togithub.com/phpstan/phpstan-src/pull/1851)), thanks [@herndlm](https://togithub.com/herndlm)!
- Implement `FunctionReflection::getDocComment()` ([#1834](https://togithub.com/phpstan/phpstan-src/pull/1834)), thanks [@staabm](https://togithub.com/staabm)!
- Add `Type::popArray()` and `Type::shiftArray()` ([#1847](https://togithub.com/phpstan/phpstan-src/pull/1847)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::shuffleArray()` ([#1853](https://togithub.com/phpstan/phpstan-src/pull/1853)), thanks [@herndlm](https://togithub.com/herndlm)!
- Deprecate `ConstantArrayType::generalizeToArray()` ([#1856](https://togithub.com/phpstan/phpstan-src/pull/1856)), thanks [@herndlm](https://togithub.com/herndlm)!
- Explicitly specify native type for `array_pop`/`array_shift` arg ([#1864](https://togithub.com/phpstan/phpstan-src/pull/1864)), thanks [@herndlm](https://togithub.com/herndlm)!
- Replace `ArrayType::castToArrayKey()` with `Type::toArrayKey()` ([#1841](https://togithub.com/phpstan/phpstan-src/pull/1841)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- remove IsFloatFunctionTypeSpecifyingExtension ([#1880](https://togithub.com/phpstan/phpstan-src/pull/1880)), thanks [@staabm](https://togithub.com/staabm)!
- remove IsNumericFunctionTypeSpecifyingExtension ([#1880](https://togithub.com/phpstan/phpstan-src/pull/1880)), thanks [@staabm](https://togithub.com/staabm)!
- Remove is_bool, is_countable and is_null type specifying extensions ([#1881](https://togithub.com/phpstan/phpstan-src/pull/1881)), thanks [@mad-briller](https://togithub.com/mad-briller)!
- Add `Type::fillKeysArray()` ([#1869](https://togithub.com/phpstan/phpstan-src/pull/1869)), thanks [@herndlm](https://togithub.com/herndlm)!
- Consistently return `ErrorType` for invalid keys ([#1869](https://togithub.com/phpstan/phpstan-src/pull/1869)), thanks [@herndlm](https://togithub.com/herndlm)!
- Replace `is_(int,object,resource,scalar)` extensions with stubs ([#1884](https://togithub.com/phpstan/phpstan-src/pull/1884)), thanks [@BackEndTea](https://togithub.com/BackEndTea)!
- Refactor `pow()` return type extension to re-use `BinaryOp\Pow` type inference ([#1900](https://togithub.com/phpstan/phpstan-src/pull/1900)), thanks [@staabm](https://togithub.com/staabm)!
- Get rid of of `Type::getArrays()` usage in `InvalidKeyInArrayDimFetchRule` ([#1872](https://togithub.com/phpstan/phpstan-src/pull/1872)), thanks [@herndlm](https://togithub.com/herndlm)!
- Add `Type::searchArray()` ([#1874](https://togithub.com/phpstan/phpstan-src/pull/1874)), thanks [@herndlm](https://togithub.com/herndlm)!
- MutatingScope: change `variableTypes` to save by `exprString` ([#1909](https://togithub.com/phpstan/phpstan-src/pull/1909)), thanks [@rajyan](https://togithub.com/rajyan)!
- MutatingScope: merge `variableTypes` and `moreSpecificTypes` ([#1919](https://togithub.com/phpstan/phpstan-src/pull/1919)), thanks [@rajyan](https://togithub.com/rajyan)!
- Upgrade deprecated `::set-*` in GitHub Actions ([#1917](https://togithub.com/phpstan/phpstan-src/pull/1917)), thanks [@rez1dent3](https://togithub.com/rez1dent3)!
- Improve non-array specification for recently cleaned-up array functions ([#1907](https://togithub.com/phpstan/phpstan-src/pull/1907)), thanks [@herndlm](https://togithub.com/herndlm)!
- Retain sort order in intersection type ([#1906](https://togithub.com/phpstan/phpstan-src/pull/1906)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)!
- Add `Type::intersectKeyArray()` ([#1916](https://togithub.com/phpstan/phpstan-src/pull/1916)), thanks [@herndlm](https://togithub.com/herndlm)!
- Changelog generator - allow excluding branch (https://github.com/phpstan/phpstan-src/commit/aaf4b7df4493d44e7ca21e2b52daa2ec2c7c5033)
- MutatingScope refactoring and regression test ([#1934](https://togithub.com/phpstan/phpstan-src/pull/1934)), thanks [@rajyan](https://togithub.com/rajyan)!
- Refactor to save nativeTypeExpressions by ExpressionTypeHolder ([#1936](https://togithub.com/phpstan/phpstan-src/pull/1936)), thanks [@rajyan](https://togithub.com/rajyan)!
- Merge constantTypes with expressionTypes ([#1938](https://togithub.com/phpstan/phpstan-src/pull/1938)), thanks [@rajyan](https://togithub.com/rajyan)!
### [`v1.8.11`](https://togithub.com/phpstan/phpstan/releases/tag/1.8.11)
[Compare Source](https://togithub.com/phpstan/phpstan/compare/1.8.10...1.8.11)
# Improvements π§
- MatchExpressionArmBody virtual node ([#1726](https://togithub.com/phpstan/phpstan-src/pull/1726)), thanks [@janedbal](https://togithub.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), [#7831](https://togithub.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)
- F
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 Mend Renovate. View repository job log here.
This PR contains the following updates:
0.12.90
->1.9.13
Release Notes
phpstan/phpstan
### [`v1.9.13`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.13) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.12...1.9.13) # Bugfixes π - ctype_digit - support type narrowing with cast parameters ([#2186](https://togithub.com/phpstan/phpstan-src/pull/2186)), [#8714](https://togithub.com/phpstan/phpstan/issues/8714), thanks [@staabm](https://togithub.com/staabm)! - PHP 8.2: Non-final classes without `#[AllowDynamicProperties]` might still have dynamic properties (https://github.com/phpstan/phpstan-src/commit/051b06ea5b36ce2f6131d07fbfcb4b065bd83ef5), [#8727](https://togithub.com/phpstan/phpstan/issues/8727), [#8474](https://togithub.com/phpstan/phpstan/issues/8474) ### [`v1.9.12`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.12) [Compare Source](https://togithub.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()` ([#1904](https://togithub.com/phpstan/phpstan-src/pull/1904)), [#5614](https://togithub.com/phpstan/phpstan/issues/5614), thanks [@staabm](https://togithub.com/staabm)! - Revert for performance reasons: Improve expression type resolving of superglobals (https://github.com/phpstan/phpstan-src/commit/02e1a14b4ca631c80b3eec6696b7483a5534bff7), ([#2012](https://togithub.com/phpstan/phpstan-src/pull/2012)) - Update PhpStorm stubs ([#2185](https://togithub.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 ([#1941](https://togithub.com/phpstan/phpstan-src/pull/1941)), [#2970](https://togithub.com/phpstan/phpstan/issues/2970), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! # Internals π - Fix bash escaping: Replacing "output" with ENV "INPUT_LOG" ([#2180](https://togithub.com/phpstan/phpstan-src/pull/2180)), thanks [@rez1dent3](https://togithub.com/rez1dent3)! ### [`v1.9.11`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.11) [Compare Source](https://togithub.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 ([#2177](https://togithub.com/phpstan/phpstan-src/pull/2177)), [#8697](https://togithub.com/phpstan/phpstan/issues/8697), thanks [@zonuexe](https://togithub.com/zonuexe)! ### [`v1.9.10`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.10) [Compare Source](https://togithub.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](https://togithub.com/phpstan/phpstan-doctrine/issues/413) ### [`v1.9.9`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.9) [Compare Source](https://togithub.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), [#7547](https://togithub.com/phpstan/phpstan/issues/7547) - Fix resolving of `__CLASS__`, `__NAMESPACE__` in traits ([#2043](https://togithub.com/phpstan/phpstan-src/pull/2043)), [#3019](https://togithub.com/phpstan/phpstan/issues/3019), thanks [@staabm](https://togithub.com/staabm)! - `class_implements` dynamic return type extension ([#2023](https://togithub.com/phpstan/phpstan-src/pull/2023)), [#4335](https://togithub.com/phpstan/phpstan/issues/4335), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! # Function signature fixes π€ - `ReflectionClass::newInstanceArgs()` type fix for named arguments ([#2176](https://togithub.com/phpstan/phpstan-src/pull/2176)), [#8679](https://togithub.com/phpstan/phpstan/issues/8679), thanks [@s3b4stian](https://togithub.com/s3b4stian)! # Internals π - Exit early in `TrinaryLogic::lazyAnd()` and `lazyOr()` if current instance allows it ([#2173](https://togithub.com/phpstan/phpstan-src/pull/2173)), thanks [@herndlm](https://togithub.com/herndlm)! - Remove unused iterable check in `MissingTypehintCheck` ([#2174](https://togithub.com/phpstan/phpstan-src/pull/2174)), thanks [@herndlm](https://togithub.com/herndlm)! ### [`v1.9.8`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.8) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.7...1.9.8) # Improvements π§ - Improve constant string support in DateTime return type extensions ([#2152](https://togithub.com/phpstan/phpstan-src/pull/2152)), thanks [@herndlm](https://togithub.com/herndlm)! - Improve expression type resolving of superglobals ([#2012](https://togithub.com/phpstan/phpstan-src/pull/2012)), thanks [@herndlm](https://togithub.com/herndlm)! - Improve integer range multiplication and division ([#1961](https://togithub.com/phpstan/phpstan-src/pull/1961)), thanks [@VincentLanglet](https://togithub.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](https://togithub.com/phpstan/phpstan/discussions/8502) - Supports functions whose side effects are flipped by parameters ([#2037](https://togithub.com/phpstan/phpstan-src/pull/2037)), [#8440](https://togithub.com/phpstan/phpstan/issues/8440), thanks [@zonuexe](https://togithub.com/zonuexe)! - `array_shift` et al. have side effects (https://github.com/phpstan/phpstan-src/commit/6276ce1c3e86e18d43989310dbd277e8ea9845f6), [#8084](https://togithub.com/phpstan/phpstan/issues/8084) - Fix comparison with `get_class()` in traits always evaluate to true ([#2044](https://togithub.com/phpstan/phpstan-src/pull/2044)), [#3633](https://togithub.com/phpstan/phpstan/issues/3633), thanks [@staabm](https://togithub.com/staabm)! ### [`v1.9.7`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.7) [Compare Source](https://togithub.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), [#8643](https://togithub.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 ([#2161](https://togithub.com/phpstan/phpstan-src/pull/2161)), thanks [@staabm](https://togithub.com/staabm)! - Fix a few MongoDB definitions ([#2140](https://togithub.com/phpstan/phpstan-src/pull/2140)), thanks [@UCIS](https://togithub.com/UCIS)! # Internals π - Added missing namespaces in tests ([#2156](https://togithub.com/phpstan/phpstan-src/pull/2156)), thanks [@staabm](https://togithub.com/staabm)! ### [`v1.9.6`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.6) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.5...1.9.6) # Improvements π§ - Show combined memory usage in parallel mode ([#2027](https://togithub.com/phpstan/phpstan-src/pull/2027)), [#4683](https://togithub.com/phpstan/phpstan/issues/4683), thanks [@janedbal](https://togithub.com/janedbal)! # Bugfixes π - One-part encapsed string is correctly converted to string (https://github.com/phpstan/phpstan-src/commit/dc77608ee9ab22e352cd3df60ce2bc2d8d135abc), [#8635](https://togithub.com/phpstan/phpstan/issues/8635) - Conditional expressions - do not take conclusions about identical variable in assignment (https://github.com/phpstan/phpstan-src/commit/cde53d19e9b4edf81f4c469b7f2a2c3634004d86), [#8625](https://togithub.com/phpstan/phpstan/issues/8625), [#8621](https://togithub.com/phpstan/phpstan/issues/8621) ### [`v1.9.5`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.5) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.4...1.9.5) # Improvements π§ - Improve constant string union handling for concat and encapsed string ([#2057](https://togithub.com/phpstan/phpstan-src/pull/2057)), thanks [@schlndh](https://togithub.com/schlndh)! - PhpVersion: supportsDisjunctiveNormalForm ([#2130](https://togithub.com/phpstan/phpstan-src/pull/2130)), thanks [@janedbal](https://togithub.com/janedbal)! - Constant scalar types might accept general type from the same family ([#2131](https://togithub.com/phpstan/phpstan-src/pull/2131)) - this moves some errors from earlier levels to level 7 - Implement OversizedArrayBuilder to improve huge constant array performance ([#2116](https://togithub.com/phpstan/phpstan-src/pull/2116)), [#8215](https://togithub.com/phpstan/phpstan/issues/8215), thanks [@staabm](https://togithub.com/staabm)! - Improve performance again by dumbing down nested arrays ([#2077](https://togithub.com/phpstan/phpstan-src/pull/2077)) - Result cache should not be invalidated by changes to editorUrl, editorUrlTitle and errorFormat parameters ([#2136](https://togithub.com/phpstan/phpstan-src/pull/2136)), thanks [@bendavies](https://togithub.com/bendavies)! - Faster `MutatingScope::shouldInvalidateExpression()` ([#2139](https://togithub.com/phpstan/phpstan-src/pull/2139)), thanks [@staabm](https://togithub.com/staabm)! - Add `ReturnStatementsNode::hasNativeReturnTypehint()` ([#2141](https://togithub.com/phpstan/phpstan-src/pull/2141)), thanks [@janedbal](https://togithub.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 ([#2126](https://togithub.com/phpstan/phpstan-src/pull/2126)), thanks [@staabm](https://togithub.com/staabm)! - Fix `pathinfo($s, PATHINFO_ALL)` return type ([#2014](https://togithub.com/phpstan/phpstan-src/pull/2014)), thanks [@staabm](https://togithub.com/staabm)! - Bump fidry/cpu-core-counter version ([#2133](https://togithub.com/phpstan/phpstan-src/pull/2133)), thanks [@czukowski](https://togithub.com/czukowski)! - Fix `MixedType::hasOffsetValueType()` for subtracted types ([#2135](https://togithub.com/phpstan/phpstan-src/pull/2135)), [#6705](https://togithub.com/phpstan/phpstan/issues/6705), thanks [@herndlm](https://togithub.com/herndlm)! - Fix dumbed down arrays ([#2137](https://togithub.com/phpstan/phpstan-src/pull/2137)), [#8004](https://togithub.com/phpstan/phpstan/issues/8004) - Return type of `parent::__set_state()` method is only object ([#2138](https://togithub.com/phpstan/phpstan-src/pull/2138)), thanks [@blankse](https://togithub.com/blankse)! - Fix fatal error when autoloader opens directories ([#2154](https://togithub.com/phpstan/phpstan-src/pull/2154)), thanks [@staabm](https://togithub.com/staabm)! - Fix returntype for DateInterval::createFromDateString ([#2038](https://togithub.com/phpstan/phpstan-src/pull/2038)), thanks [@verfriemelt-dot-org](https://togithub.com/verfriemelt-dot-org)! - Fix hasSideEffects for AnnotationMethodReflection ([#2155](https://togithub.com/phpstan/phpstan-src/pull/2155)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - Fix constant-string handling in union-types ([#2134](https://togithub.com/phpstan/phpstan-src/pull/2134)), [#8568](https://togithub.com/phpstan/phpstan/issues/8568), [#8562](https://togithub.com/phpstan/phpstan/issues/8562), thanks [@staabm](https://togithub.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 ([#2118](https://togithub.com/phpstan/phpstan-src/pull/2118)), thanks [@rajyan](https://togithub.com/rajyan)! - Fix typo ([#2127](https://togithub.com/phpstan/phpstan-src/pull/2127)), thanks [@rajyan](https://togithub.com/rajyan)! - AnalyserIntegrationTest - run with bleedingEdge (https://github.com/phpstan/phpstan-src/commit/db2de6f17469e9bc0d078e09c895d64a39fe14ca) - Refactor options handling in `FilterVarDynamicReturnTypeExtension` ([#2120](https://togithub.com/phpstan/phpstan-src/pull/2120)), thanks [@herndlm](https://togithub.com/herndlm)! - Add `Type::isScalar()` ([#2149](https://togithub.com/phpstan/phpstan-src/pull/2149)), thanks [@herndlm](https://togithub.com/herndlm)! - Removed unused fileName in FetchedNode ([#2150](https://togithub.com/phpstan/phpstan-src/pull/2150)), thanks [@staabm](https://togithub.com/staabm)! - Removed unused NodeList class ([#2151](https://togithub.com/phpstan/phpstan-src/pull/2151)), thanks [@staabm](https://togithub.com/staabm)! - Add namespace to bug-8573.php / fix `GenericsIntegrationTest` ([#2147](https://togithub.com/phpstan/phpstan-src/pull/2147)), thanks [@herndlm](https://togithub.com/herndlm)! ### [`v1.9.4`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.4) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.3...1.9.4) # Improvements π§ - Various performance optimizations from [@staabm](https://togithub.com/staabm) ([#2098](https://togithub.com/phpstan/phpstan-src/pull/2098), [#2099](https://togithub.com/phpstan/phpstan-src/pull/2099), [#2100](https://togithub.com/phpstan/phpstan-src/pull/2100), [#2101](https://togithub.com/phpstan/phpstan-src/pull/2101), [#2103](https://togithub.com/phpstan/phpstan-src/pull/2103), [#2104](https://togithub.com/phpstan/phpstan-src/pull/2104)) - Resolve parameter types only when `checkArgumentTypes=true` ([#2106](https://togithub.com/phpstan/phpstan-src/pull/2106)), thanks [@staabm](https://togithub.com/staabm)! - Keep NeverType isExplicit flag in `TypeCombinator::intersect()` ([#2112](https://togithub.com/phpstan/phpstan-src/pull/2112)), thanks [@staabm](https://togithub.com/staabm)! - Keep NeverType isExplicit flag in `InitializerExprTypeResolver` ([#2114](https://togithub.com/phpstan/phpstan-src/pull/2114)), thanks [@staabm](https://togithub.com/staabm)! - Add `TypeCombinator::removeFalsey()` ([#2003](https://togithub.com/phpstan/phpstan-src/pull/2003)), thanks [@axlon](https://togithub.com/axlon)! - Option `usePathConstantsAsConstantString` ([#2050](https://togithub.com/phpstan/phpstan-src/pull/2050)), thanks [@MartinMystikJonas](https://togithub.com/MartinMystikJonas)! # Bugfixes π - Fix native type on `unset` ([#2107](https://togithub.com/phpstan/phpstan-src/pull/2107)), [#7805](https://togithub.com/phpstan/phpstan/issues/7805), thanks [@rajyan](https://togithub.com/rajyan)! - Fix return type of `array_search()` with constant array type haystack ([#1806](https://togithub.com/phpstan/phpstan-src/pull/1806)), [#3789](https://togithub.com/phpstan/phpstan/issues/3789), thanks [@takaram](https://togithub.com/takaram)! - `parse_str()` might return nested arrays by-ref ([#1994](https://togithub.com/phpstan/phpstan-src/pull/1994)), [#8356](https://togithub.com/phpstan/phpstan/issues/8356), thanks [@staabm](https://togithub.com/staabm)! - Fix regression in `for` loop (https://github.com/phpstan/phpstan-src/commit/a8975b1800d6c5cb88a6af02e132b4e44e093fc3), [#8520](https://togithub.com/phpstan/phpstan/issues/8520) - Fix readonly properties bugs and infinite recursion (https://github.com/phpstan/phpstan-src/commit/a7fed03bbf1bef545c8afcbf6c906ac93b34c876), [#8543](https://togithub.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), [#8537](https://togithub.com/phpstan/phpstan/issues/8537) # Internals π - Implement `getConstantStrings()` on Type ([#1979](https://togithub.com/phpstan/phpstan-src/pull/1979)), thanks [@staabm](https://togithub.com/staabm)! - Fix node PHPDoc type hints ([#2053](https://togithub.com/phpstan/phpstan-src/pull/2053)), thanks [@herndlm](https://togithub.com/herndlm)! - Refactor FilterVarDynamicReturnTypeExtension to pass around Types instead of Args and the Scope ([#2109](https://togithub.com/phpstan/phpstan-src/pull/2109)), thanks [@herndlm](https://togithub.com/herndlm)! ### [`v1.9.3`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.3) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.2...1.9.3) # Bleeding edge πͺ - Fix invariance composition ([#2054](https://togithub.com/phpstan/phpstan-src/pull/2054)), thanks [@jiripudil](https://togithub.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 ([#1992](https://togithub.com/phpstan/phpstan-src/pull/1992)), [#8346](https://togithub.com/phpstan/phpstan/issues/8346), [#8094](https://togithub.com/phpstan/phpstan/issues/8094), thanks [@herndlm](https://togithub.com/herndlm)! - `DateTimeZone::__construct` throw type extension ([#2034](https://togithub.com/phpstan/phpstan-src/pull/2034)) - TableErrorFormatter: allow editor url title configuration ([#2035](https://togithub.com/phpstan/phpstan-src/pull/2035)), [#7796](https://togithub.com/phpstan/phpstan/issues/7796), thanks [@janedbal](https://togithub.com/janedbal)! - Various generics variance fixes ([#2051](https://togithub.com/phpstan/phpstan-src/pull/2051), [#2064](https://togithub.com/phpstan/phpstan-src/pull/2064)), [#3960](https://togithub.com/phpstan/phpstan/issues/3960), thanks [@jiripudil](https://togithub.com/jiripudil)! - Add `deprecationRulesInstalled` configuration ([#2062](https://togithub.com/phpstan/phpstan-src/pull/2062)), thanks [@villfa](https://togithub.com/villfa)! - To be used in phpstan-deprecation-rules and phpstan-phpunit extensions soon! - ArrayFilterRule should care about `treatPhpDocTypesAsCertain` ([#2065](https://togithub.com/phpstan/phpstan-src/pull/2065)), thanks [@VincentLanglet](https://togithub.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), [#8499](https://togithub.com/phpstan/phpstan/issues/8499), [#8497](https://togithub.com/phpstan/phpstan/issues/8497) - Remove unnecessary file IO ([#2069](https://togithub.com/phpstan/phpstan-src/pull/2069), [#2094](https://togithub.com/phpstan/phpstan-src/pull/2094)), thanks [@staabm](https://togithub.com/staabm)! - Reduce calls to `Scope::getType()`. Cheap checks first. ([#2071](https://togithub.com/phpstan/phpstan-src/pull/2071)), thanks [@staabm](https://togithub.com/staabm)! - Cache resolved phpdoc in ClassReflection ([#2072](https://togithub.com/phpstan/phpstan-src/pull/2072)), thanks [@staabm](https://togithub.com/staabm)! - Don't re-calculate node-key over and over again ([#2073](https://togithub.com/phpstan/phpstan-src/pull/2073)), thanks [@staabm](https://togithub.com/staabm)! - Improve the CPU core count detection ([#2047](https://togithub.com/phpstan/phpstan-src/pull/2047)), thanks [@theofidry](https://togithub.com/theofidry)! - Optimize path related utils on windows ([#2068](https://togithub.com/phpstan/phpstan-src/pull/2068)), thanks [@staabm](https://togithub.com/staabm)! - Don't re-calculate node-key over and over again - part 2 ([#2074](https://togithub.com/phpstan/phpstan-src/pull/2074)), [#8503](https://togithub.com/phpstan/phpstan/issues/8503), thanks [@staabm](https://togithub.com/staabm)! - Faster ConstantStringType->toArrayKey() ([#2081](https://togithub.com/phpstan/phpstan-src/pull/2081)), thanks [@staabm](https://togithub.com/staabm)! - Faster ConstantFloatType->isSuperTypeOf(ConstantFloatType) ([#2080](https://togithub.com/phpstan/phpstan-src/pull/2080)), thanks [@staabm](https://togithub.com/staabm)! - TypeSpecifier micro-optimization (https://github.com/phpstan/phpstan-src/commit/30e6d19496adb16b6bfd9be1cd1bf767f6ce8713) - Faster TrinaryLogic->lazyExtremeIdentity() ([#2083](https://togithub.com/phpstan/phpstan-src/pull/2083)), thanks [@staabm](https://togithub.com/staabm)! - Faster ConstantArrayType->isSuperTypeOf() ([#2086](https://togithub.com/phpstan/phpstan-src/pull/2086)), thanks [@staabm](https://togithub.com/staabm)! - Loops analysed in linear time instead of exponential time ([#2088](https://togithub.com/phpstan/phpstan-src/pull/2088), [#2091](https://togithub.com/phpstan/phpstan-src/pull/2091)), [#8503](https://togithub.com/phpstan/phpstan/issues/8503), [#6265](https://togithub.com/phpstan/phpstan/issues/6265) - Remove unnecessary method call to already known value ([#2092](https://togithub.com/phpstan/phpstan-src/pull/2092)), thanks [@staabm](https://togithub.com/staabm)! # Bugfixes π - Improve conditionalExpressionTypes ([#1950](https://togithub.com/phpstan/phpstan-src/pull/1950)), [#3677](https://togithub.com/phpstan/phpstan/issues/3677), [#5623](https://togithub.com/phpstan/phpstan/issues/5623), [#5401](https://togithub.com/phpstan/phpstan/issues/5401), [#7292](https://togithub.com/phpstan/phpstan/issues/7292), [#8212](https://togithub.com/phpstan/phpstan/issues/8212), thanks [@rajyan](https://togithub.com/rajyan)! - Fix conditional variable types in global scope ([#1995](https://togithub.com/phpstan/phpstan-src/pull/1995)), thanks [@rajyan](https://togithub.com/rajyan)! - Do not invalidate related expressions in ensureNonNullability ([#2004](https://togithub.com/phpstan/phpstan-src/pull/2004)), [#8361](https://togithub.com/phpstan/phpstan/issues/8361), thanks [@rajyan](https://togithub.com/rajyan)! - Improve create conditional expressions to handle all expressions ([#2007](https://togithub.com/phpstan/phpstan-src/pull/2007)), thanks [@rajyan](https://togithub.com/rajyan)! - Improve conditional type resolving performance ([#2030](https://togithub.com/phpstan/phpstan-src/pull/2030)), [#8397](https://togithub.com/phpstan/phpstan/issues/8397), [#5805](https://togithub.com/phpstan/phpstan/issues/5805), thanks [@rajyan](https://togithub.com/rajyan)! - Fix false positive of access to static private property of parent class ([#1989](https://togithub.com/phpstan/phpstan-src/pull/1989)), [#8333](https://togithub.com/phpstan/phpstan/issues/8333), thanks [@staabm](https://togithub.com/staabm)! - Fix intersecting array shapes with different optional keys ([#2002](https://togithub.com/phpstan/phpstan-src/pull/2002)), [#8373](https://togithub.com/phpstan/phpstan/issues/8373), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Support PHPDoc asserts on variadic parameters ([#2009](https://togithub.com/phpstan/phpstan-src/pull/2009)), [#8389](https://togithub.com/phpstan/phpstan/issues/8389), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Fix `@param-out` on methods ([#2028](https://togithub.com/phpstan/phpstan-src/pull/2028)), [#8421](https://togithub.com/phpstan/phpstan/issues/8421), thanks [@staabm](https://togithub.com/staabm)! - Do not set native type to `mixed` on annotation assignment ([#2017](https://togithub.com/phpstan/phpstan-src/pull/2017)), thanks [@herndlm](https://togithub.com/herndlm)! - Consistently pass `$nativeExpressionTypes` in MutatingScope ([#2021](https://togithub.com/phpstan/phpstan-src/pull/2021)), thanks [@herndlm](https://togithub.com/herndlm)! - Fix infinite loop when fully qualified callback is supplied ([#2005](https://togithub.com/phpstan/phpstan-src/pull/2005)), [#8376](https://togithub.com/phpstan/phpstan/issues/8376), thanks [@cs278](https://togithub.com/cs278)! - Non-static method DOMDocument::loadHTML() can be called statically ([#2042](https://togithub.com/phpstan/phpstan-src/pull/2042)), [#2759](https://togithub.com/phpstan/phpstan/issues/2759), thanks [@staabm](https://togithub.com/staabm)! - Fix FuzzyRelativePathHelper for directories ending in `.php` (https://github.com/phpstan/phpstan-src/commit/bff85e27cd486b7ea5c065575a71de66b83b1cf2), [#8480](https://togithub.com/phpstan/phpstan/issues/8480) # Function signature fixes π€ - ImagickPixel::getColor() normalized param accepts int instead of bool ([#2020](https://togithub.com/phpstan/phpstan-src/pull/2020)), thanks [@blankse](https://togithub.com/blankse)! - Declare more PDOStatement method types ([#2096](https://togithub.com/phpstan/phpstan-src/pull/2096)), thanks [@staabm](https://togithub.com/staabm)! # Internals π - Fix non-working type assertions in `NodeScopeResolverTest` cases ([#1992](https://togithub.com/phpstan/phpstan-src/pull/1992)), thanks [@herndlm](https://togithub.com/herndlm)! - Use ExpressionTypeHolders for conditional expression type ([#1998](https://togithub.com/phpstan/phpstan-src/pull/1998)), thanks [@rajyan](https://togithub.com/rajyan)! - Simplify array collections in `UnionTypeHelper` ([#1988](https://togithub.com/phpstan/phpstan-src/pull/1988)), thanks [@herndlm](https://togithub.com/herndlm)! - Avoid specifying scalar types and delete string casts ([#1999](https://togithub.com/phpstan/phpstan-src/pull/1999)), thanks [@rajyan](https://togithub.com/rajyan)! - Add filename and line of the error of assertVariableCertainty ([#2008](https://togithub.com/phpstan/phpstan-src/pull/2008)), thanks [@rajyan](https://togithub.com/rajyan)! - README: how to composer install ([#2025](https://togithub.com/phpstan/phpstan-src/pull/2025)), thanks [@janedbal](https://togithub.com/janedbal)! - Group `$expressionTypes` and `$nativeExpressionTypes` in Scope creation methods ([#2022](https://togithub.com/phpstan/phpstan-src/pull/2022)), thanks [@herndlm](https://togithub.com/herndlm)! - Use ExpressionTypeHolder when comparing conditionals ([#2048](https://togithub.com/phpstan/phpstan-src/pull/2048)), thanks [@rajyan](https://togithub.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` ([#2082](https://togithub.com/phpstan/phpstan-src/pull/2082)), thanks [@herndlm](https://togithub.com/herndlm)! - Get rid of `TypeTraverser` in `ArraySliceFunctionReturnTypeExtension` ([#2085](https://togithub.com/phpstan/phpstan-src/pull/2085)), thanks [@herndlm](https://togithub.com/herndlm)! - Get rid of `TypeTraverser` in `ArrayReverseFunctionReturnTypeExtension` ([#2084](https://togithub.com/phpstan/phpstan-src/pull/2084)), thanks [@herndlm](https://togithub.com/herndlm)! - Get rid of `TypeTraverser` in `StrSplitFunctionReturnTypeExtension` ([#2087](https://togithub.com/phpstan/phpstan-src/pull/2087)), thanks [@herndlm](https://togithub.com/herndlm)! ### [`v1.9.2`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.2) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.1...1.9.2) # Bugfixes π - Fix array and iterable type action methods on `NeverType` ([#1968](https://togithub.com/phpstan/phpstan-src/pull/1968)), [#8277](https://togithub.com/phpstan/phpstan/issues/8277), thanks [@herndlm](https://togithub.com/herndlm)! - Support 'HasMethodType' on StaticCall ([#1969](https://togithub.com/phpstan/phpstan-src/pull/1969)), [#1267](https://togithub.com/phpstan/phpstan/issues/1267), thanks [@staabm](https://togithub.com/staabm)! - Addition operation on MixedType without ArrayType cannot result in ArrayType ([#1949](https://togithub.com/phpstan/phpstan-src/pull/1949)), thanks [@staabm](https://togithub.com/staabm)! - Remove DateInterval stub ([#1974](https://togithub.com/phpstan/phpstan-src/pull/1974)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - Fix invalidate static expressions in closures ([#1983](https://togithub.com/phpstan/phpstan-src/pull/1983)), [#8292](https://togithub.com/phpstan/phpstan/issues/8292), thanks [@rajyan](https://togithub.com/rajyan)! - Fix false positive of access to private property of parent class ([#1953](https://togithub.com/phpstan/phpstan-src/pull/1953)), [#2435](https://togithub.com/phpstan/phpstan/issues/2435), thanks [@tyabu12](https://togithub.com/tyabu12)! - Fix unset on nested array ([#1987](https://togithub.com/phpstan/phpstan-src/pull/1987)), [#8113](https://togithub.com/phpstan/phpstan/issues/8113), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! # Function signature fixes π€ - Update DateTimeZone::listAbbreviations signature ([#1962](https://togithub.com/phpstan/phpstan-src/pull/1962)), thanks [@franmomu](https://togithub.com/franmomu)! - Making `json_encode()` always produce a `non-empty-string`, when successful ([#1980](https://togithub.com/phpstan/phpstan-src/pull/1980)), thanks [@Slamdunk](https://togithub.com/Slamdunk)! - `sodium_crypto_generichash*` always produce a `non-empty-string` ([#1981](https://togithub.com/phpstan/phpstan-src/pull/1981)), thanks [@Slamdunk](https://togithub.com/Slamdunk)! - `sodium_crypto_sign*` always produce `non-empty-string` ([#1985](https://togithub.com/phpstan/phpstan-src/pull/1985)), thanks [@Slamdunk](https://togithub.com/Slamdunk)! # Internals π - Implement isClassStringType() on Type ([#1970](https://togithub.com/phpstan/phpstan-src/pull/1970)), [#6147](https://togithub.com/phpstan/phpstan/issues/6147), thanks [@staabm](https://togithub.com/staabm)! - Implement isInteger() on Type ([#1971](https://togithub.com/phpstan/phpstan-src/pull/1971)), thanks [@staabm](https://togithub.com/staabm)! - Implement isBoolean() on Type ([#1973](https://togithub.com/phpstan/phpstan-src/pull/1973)), thanks [@staabm](https://togithub.com/staabm)! - Implement isFloat() on Type ([#1977](https://togithub.com/phpstan/phpstan-src/pull/1977)), thanks [@staabm](https://togithub.com/staabm)! - Implement isNull() on Type ([#1978](https://togithub.com/phpstan/phpstan-src/pull/1978)), thanks [@staabm](https://togithub.com/staabm)! - Add `Type::isVoid()` ([#1982](https://togithub.com/phpstan/phpstan-src/pull/1982)), thanks [@herndlm](https://togithub.com/herndlm)! ### [`v1.9.1`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.1) [Compare Source](https://togithub.com/phpstan/phpstan/compare/1.9.0...1.9.1) # Improvements π§ - `AccessoryArrayListType` is part of BC promise ([#1967](https://togithub.com/phpstan/phpstan-src/pull/1967)), thanks [@enumag](https://togithub.com/enumag)! - Specify types from true/false asserts ([#1957](https://togithub.com/phpstan/phpstan-src/pull/1957)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Support conditional types in phpdoc asserts ([#1964](https://togithub.com/phpstan/phpstan-src/pull/1964)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Let casting `object` to `string` result in an error ([#1948](https://togithub.com/phpstan/phpstan-src/pull/1948)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Add more support for `checkBenevolentUnionTypes` config ([#1940](https://togithub.com/phpstan/phpstan-src/pull/1940)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - Error on unknown parameter name in parameter conditional type ([#1966](https://togithub.com/phpstan/phpstan-src/pull/1966)), [#8284](https://togithub.com/phpstan/phpstan/issues/8284), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! # Bugfixes π - List type cast to array is still a list ([#1958](https://togithub.com/phpstan/phpstan-src/pull/1958), [#1959](https://togithub.com/phpstan/phpstan-src/pull/1959)), [#8280](https://togithub.com/phpstan/phpstan/issues/8280), thanks [@rajyan](https://togithub.com/rajyan)! - Fix `mt_rand` return type ([#1956](https://togithub.com/phpstan/phpstan-src/pull/1956)), [#8272](https://togithub.com/phpstan/phpstan/issues/8272), thanks [@enumag](https://togithub.com/enumag)! - `strtr` returns `non-empty-string` ([#1963](https://togithub.com/phpstan/phpstan-src/pull/1963)), thanks [@staabm](https://togithub.com/staabm)! ### [`v1.9.0`](https://togithub.com/phpstan/phpstan/releases/tag/1.9.0) [Compare Source](https://togithub.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` ([#1317](https://togithub.com/phpstan/phpstan-src/pull/1317)), [#7110](https://togithub.com/phpstan/phpstan/issues/7110), [#8186](https://togithub.com/phpstan/phpstan/issues/8186), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - [Documentation](https://phpstan.org/writing-php-code/narrowing-types#custom-type-checking-functions-and-methods) - `@phpstan-self-out`/`@phpstan-this-out` support ([#1799](https://togithub.com/phpstan/phpstan-src/pull/1799)), thanks [@rvanvelzen](https://togithub.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 ([#1804](https://togithub.com/phpstan/phpstan-src/pull/1804)), [#7231](https://togithub.com/phpstan/phpstan/issues/7231), [#6871](https://togithub.com/phpstan/phpstan/issues/6871), [#6186](https://togithub.com/phpstan/phpstan/issues/6186), [#4372](https://togithub.com/phpstan/phpstan/issues/4372), [#5785](https://togithub.com/phpstan/phpstan/issues/5785), thanks [@staabm](https://togithub.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()` ([#1477](https://togithub.com/phpstan/phpstan-src/pull/1477)), thanks [@jiripudil](https://togithub.com/jiripudil)! - [Documentation](https://phpstan.org/developing-extensions/allowed-subtypes) - Add config parameter `checkBenevolentUnionTypes` to strictly check BenevolentUnionType ([#1930](https://togithub.com/phpstan/phpstan-src/pull/1930)), [#8223](https://togithub.com/phpstan/phpstan/issues/8223), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - [Documentation](https://phpstan.org/config-reference#checkbenevolentuniontypes) # Bleeding edge πͺ - **Array `list` type** ([#1751](https://togithub.com/phpstan/phpstan-src/pull/1751)), [#3311](https://togithub.com/phpstan/phpstan/issues/3311), [#8185](https://togithub.com/phpstan/phpstan/issues/8185), [#6243](https://togithub.com/phpstan/phpstan/issues/6243), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Lists are arrays with sequential integer keys starting at 0 - Improve error wording of the NonexistentOffset, BooleanAndConstantConditionRule, and BooleanOrConstantConditionRule ([#1882](https://togithub.com/phpstan/phpstan-src/pull/1882)), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - MissingMagicSerializationMethodsRule ([#1711](https://togithub.com/phpstan/phpstan-src/pull/1711)), [#7482](https://togithub.com/phpstan/phpstan/issues/7482), thanks [@staabm](https://togithub.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` ([#1803](https://togithub.com/phpstan/phpstan-src/pull/1803)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Optimize `NonexistentOffsetInArrayDimFetchCheck` ([#1801](https://togithub.com/phpstan/phpstan-src/pull/1801)), thanks [@herndlm](https://togithub.com/herndlm)! - Modify the built-in `@method` extension to look at `@throws` in \__call ([#1842](https://togithub.com/phpstan/phpstan-src/pull/1842)), [#8163](https://togithub.com/phpstan/phpstan/issues/8163), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - Improve impossible type checker for void-returning functions ([#1857](https://togithub.com/phpstan/phpstan-src/pull/1857)), [#8169](https://togithub.com/phpstan/phpstan/issues/8169), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Allow using `$this`/`static` in conditional return types ([#1863](https://togithub.com/phpstan/phpstan-src/pull/1863)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Emit warnings when Xdebug is not used according to CLI flags ([#1878](https://togithub.com/phpstan/phpstan-src/pull/1878)), thanks [@staabm](https://togithub.com/staabm)! - Improve array_fill return type extension ([#1879](https://togithub.com/phpstan/phpstan-src/pull/1879)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Add support for `mb_convert_case()` and `mb_convert_kana()` ([#1866](https://togithub.com/phpstan/phpstan-src/pull/1866)), thanks [@zonuexe](https://togithub.com/zonuexe)! - Accept and describe `callable-object` and `callable-string` ([#1906](https://togithub.com/phpstan/phpstan-src/pull/1906)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Add colon as prefix of line number in table report, when running in VSCode terminal ([#1901](https://togithub.com/phpstan/phpstan-src/pull/1901)), [#8086](https://togithub.com/phpstan/phpstan/issues/8086), thanks [@LeoVie](https://togithub.com/LeoVie)! - Cover ExtendedMethodReflection by BC promise (but not implementing it, only calling the methods) ([#1913](https://togithub.com/phpstan/phpstan-src/pull/1913)), thanks [@staabm](https://togithub.com/staabm)! - Locate identifiers by type for OptimizedSingleFileSourceLocator ([#1114](https://togithub.com/phpstan/phpstan-src/pull/1114)), thanks [@tomasfejfar](https://togithub.com/tomasfejfar)! - Implement `FunctionReflection`/`ExtendedMethodReflection::returnsByReference()` ([#1899](https://togithub.com/phpstan/phpstan-src/pull/1899)), [#6005](https://togithub.com/phpstan/phpstan/issues/6005), thanks [@staabm](https://togithub.com/staabm)! - Add noreturn as PseudoTypeClass ([#1937](https://togithub.com/phpstan/phpstan-src/pull/1937)), [#8242](https://togithub.com/phpstan/phpstan/issues/8242), thanks [@zonuexe](https://togithub.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 ([#1752](https://togithub.com/phpstan/phpstan-src/pull/1752)), [#7996](https://togithub.com/phpstan/phpstan/issues/7996), thanks [@herndlm](https://togithub.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` ([#1796](https://togithub.com/phpstan/phpstan-src/pull/1796)), thanks [@herndlm](https://togithub.com/herndlm)! - Fix list checking on level 7 vs. level 8 (https://github.com/phpstan/phpstan-src/commit/926058491578747d2f99ec6b02ad28c988f3c28d), [#8071](https://togithub.com/phpstan/phpstan/issues/8071) - MixedType: support subtracted in array-type methods ([#1852](https://togithub.com/phpstan/phpstan-src/pull/1852)), [#3370](https://togithub.com/phpstan/phpstan/issues/3370), thanks [@staabm](https://togithub.com/staabm)! - Allow compare SimpleXMLElement to number ([#1755](https://togithub.com/phpstan/phpstan-src/pull/1755)), [#1795](https://togithub.com/phpstan/phpstan/issues/1795), thanks [@muno92](https://togithub.com/muno92)! - Fix min max call on array of union types ([#1795](https://togithub.com/phpstan/phpstan-src/pull/1795)), [#8088](https://togithub.com/phpstan/phpstan/issues/8088), thanks [@VincentLanglet](https://togithub.com/VincentLanglet)! - Support `Countable` in `count()` ([#1876](https://togithub.com/phpstan/phpstan-src/pull/1876)), thanks [@staabm](https://togithub.com/staabm)! - Improve `RuleLevelHelper::accepts()` for constant arrays ([#1911](https://togithub.com/phpstan/phpstan-src/pull/1911)), [#8209](https://togithub.com/phpstan/phpstan/issues/8209), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Fix closure return type based on by-ref use ([#1914](https://togithub.com/phpstan/phpstan-src/pull/1914)), [#6806](https://togithub.com/phpstan/phpstan/issues/6806), [#4739](https://togithub.com/phpstan/phpstan/issues/4739), [#5753](https://togithub.com/phpstan/phpstan/issues/5753), [#6559](https://togithub.com/phpstan/phpstan/issues/6559), [#6902](https://togithub.com/phpstan/phpstan/issues/6902), [#7220](https://togithub.com/phpstan/phpstan/issues/7220), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Consider `get_object_var()` as private property read ([#1902](https://togithub.com/phpstan/phpstan-src/pull/1902)), [#3654](https://togithub.com/phpstan/phpstan/issues/3654), thanks [@vovochka404](https://togithub.com/vovochka404)! - Temporary solution to handle "maybe" certainty types assign in nativeExpressionTypes ([#1932](https://togithub.com/phpstan/phpstan-src/pull/1932)), thanks [@rajyan](https://togithub.com/rajyan)! - Refactor arrow function scope logic to make it consistent with anonymous functions ([#1935](https://togithub.com/phpstan/phpstan-src/pull/1935)), thanks [@rajyan](https://togithub.com/rajyan)! - Fix static bleedingEdge toggles in tests ([#1928](https://togithub.com/phpstan/phpstan-src/pull/1928)), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Improve unset on ConstantArrayType ([#1927](https://togithub.com/phpstan/phpstan-src/pull/1927)), [#8225](https://togithub.com/phpstan/phpstan/issues/8225), thanks [@VincentLanglet](https://togithub.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 ([#1915](https://togithub.com/phpstan/phpstan-src/pull/1915)), [#8179](https://togithub.com/phpstan/phpstan/issues/8179), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - `$this` in nativeExpressionTypes ([#1936](https://togithub.com/phpstan/phpstan-src/pull/1936)), thanks [@rajyan](https://togithub.com/rajyan)! - Handle ClassConstFetch in Scope ([#1944](https://togithub.com/phpstan/phpstan-src/pull/1944)), [#7913](https://togithub.com/phpstan/phpstan/issues/7913), thanks [@rajyan](https://togithub.com/rajyan)! - Retain non-variable expression types in closure ([#1929](https://togithub.com/phpstan/phpstan-src/pull/1929)), [#8205](https://togithub.com/phpstan/phpstan/issues/8205), thanks [@rvanvelzen](https://togithub.com/rvanvelzen)! - Fix stale result cache for asserts (https://github.com/phpstan/phpstan-src/commit/471265fc62f30504f4a0aecf79585bef42e69213) - Fix stale result cache for `@phpstan-self-out` ([#1949](https://togithub.com/phpstan/phpstan-src/pull/1949)), thanks [@staabm](https://togithub.com/staabm)! # Function signature fixes π€ - Fix class_implements return type ([#1797](https://togithub.com/phpstan/phpstan-src/pull/1797)), thanks [@enumag](https://togithub.com/enumag)! - `mb_check_encoding()` accepts `arrayConfiguration
π 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.
This PR has been generated by Mend Renovate. View repository job log here.