Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update dependency phpstan/phpstan to ~1.9.0 (#25)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [phpstan/phpstan](https://togithub.com/phpstan/phpstan) | require-dev | minor | `~1.8.0` -> `~1.9.0` | --- ### Release Notes <details> <summary>phpstan/phpstan</summary> ### [`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 (phpstan/phpstan-src@a8975b1), [#​8520](https://togithub.com/phpstan/phpstan/issues/8520) - Fix readonly properties bugs and infinite recursion (phpstan/phpstan-src@a7fed03), [#​8543](https://togithub.com/phpstan/phpstan/issues/8543) - Fix internal error for dynamic properties defined on interface on PHP 8.2 (phpstan/phpstan-src@4025209), [#​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 (phpstan/phpstan-src@c760b1f) - Performance optimizations: - Cache descriptions in ObjectType and UnionType (phpstan/phpstan-src@da8413c), [#​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 (phpstan/phpstan-src@30e6d19) - 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` (phpstan/phpstan-src@bff85e2), [#​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 (phpstan/phpstan-src@96e4443) - VerbosityLevel offers `getLevelValue()` (phpstan/phpstan-src@4f7e20b) - 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 (phpstan/phpstan-src@97786ed) - Stub files validation - detect duplicate classes and functions (phpstan/phpstan-src@ddf8d5c, phpstan/phpstan-src@17e4b74) *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 (phpstan/phpstan-src@1cc337a) - `MutatingScope::enterNamespace()` is part of BC promise (phpstan/phpstan-src@92732ca) # 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 (phpstan/phpstan-src@2796f8d) - `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 (phpstan/phpstan-src@9260584), [#​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` (phpstan/phpstan-src@cf40007) - Fix stale result cache for arrow functions (phpstan/phpstan-src@2969057) - 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 (phpstan/phpstan-src@471265f) - 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<string>` 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 (phpstan/phpstan-src@aaf4b7d) - 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)! </details> --- ### Configuration π **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/open-feature/php-sdk). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC42My4yIiwidXBkYXRlZEluVmVyIjoiMzQuNjMuMiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information