chore(deps): update dependency phpstan/phpstan to v1.10.3 - autoclosed
-
Review changes -
-
Download -
Patches
-
Plain diff
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
phpstan/phpstan | require-dev | minor |
1.9.18 -> 1.10.3
|
Release Notes
phpstan/phpstan
v1.10.3
Improvements 

- Add support for
@not-deprecated
annotation (#2255), https://github.com/phpstan/phpstan/discussions/7422, thanks @stof!
Bugfixes 

- Fix arithmetic operations with BenevolentUnionType (https://github.com/phpstan/phpstan-src/commit/f882eff78af3647b28a4663f467ae78346e89db3), #8938
- Fix native return type of
array_chunk()
(https://github.com/phpstan/phpstan-src/commit/e4a6d2026ef1218d2629e55991972058b80fef73), #8956 - Support for property fetch in initializers (https://github.com/phpstan/phpstan-src/commit/53c643de1366f185c9f21ff12908a7b1458b9ed0), #8957
- ObjectType - fix enum property with subtracted type (https://github.com/phpstan/phpstan-src/commit/eb00fd21ccc834c13624c32b6db0c1700ab32a8a), #8828, #8486
v1.10.2
Improvements 

- Allow generating baseline in .php format (https://github.com/phpstan/phpstan-src/commit/8260032bc6b3641ec80a4b11526869b53d250ac6), #8870
- See documentation: https://phpstan.org/user-guide/baseline#php-baseline-format-instead-of-neon
Function signature fixes 

- Instances of
object
returned bydb2_*()
functions are always instances ofstdClass
(#2249), thanks @phansys!
v1.10.1
Bugfixes 

- Fix match expression and
treatPhpDocTypesAsCertain: false
(#2248), #8932, thanks @VincentLanglet! - Fix calling dynamic return type extensions on nullable types (https://github.com/phpstan/phpstan-src/commit/7331bc51411943dba14880434df6d7c85a744dcf)
- Fix edge case with
in_array
and enums (https://github.com/phpstan/phpstan-src/commit/7d6f0f6a4c8eac67cfb2d810681043f9863f04a7)
v1.10.0
Read the article about this release: PHPStan 1.10 Comes With a Lie Detector
Major new features 

- "Always true" conditions in the last
elseif
branch and last match expression arm are not reported by default (#2105), #8042, #8485, #7721, #4242, #8240, thanks @staabm!- Set
reportAlwaysTrueInLastCondition
totrue
to have them reported again - Note: "Always true" conditions in PHPStan 1.x are reported with Bleeding Edge enabled, or with phpstan-strict-rules installed, or with relevant options enabled separately. In PHPStan 2.0 they're going to be always reported, except for the last
elseif
branch and last match expression arm.
- Set
- Deprecate various
instanceof *Type
in favour of new methods onType
interface, (https://github.com/phpstan/phpstan-src/commit/436e6d3015cbeba4645d38bc7a6a865b9c6d7c74), learn more: Why Is instanceof *Type Wrong and Getting Deprecated?- Deprecations in your custom rules and extensions will be reported in Bleeding Edge, or with
phpstan-deprecation-rules
installed
- Deprecations in your custom rules and extensions will be reported in Bleeding Edge, or with
- Explain why type isn't accepted by another type in less intuitive scenarios, #3281, #6787
- Some examples: https://phpstan.org/r/61cfbb65-1a04-471a-a5c5-d61f0540ae1d, https://phpstan.org/r/839f1fd2-d66a-4356-af21-3fe171d83fd1, https://phpstan.org/r/2bea7ece-6b26-4dc9-a1cf-d2f0e7fbb9d6, https://phpstan.org/r/fed1c275-46d0-434f-b9c4-3212f4df6d1c, https://phpstan.org/r/24a23b74-af27-4443-986c-04af61427d50
Bleeding edge 

- Validate inline PHPDoc
@var
tag type against native type (https://github.com/phpstan/phpstan-src/commit/a69e3bc2f1e87f6da1e65d7935f1cc36bd5c42fe)- Set
reportWrongPhpDocTypeInVarTag
totrue
to have all types validated, not just native ones
- Set
- Always report always true conditions, except for last elseif and match arm (#2105), thanks @staabm!
- Disable "unreachable branches" rules: UnreachableIfBranchesRule, UnreachableTernaryElseBranchRule, unreachable arm error in MatchExpressionRule
- Because "always true" is always reported, these are no longer needed
- IncompatibleDefaultParameterTypeRule for closures (https://github.com/phpstan/phpstan-src/commit/0264f5bc48448c7e02a23b82eef4177d0617a82f)
- New
RuleLevelHelper::accepts()
behaviour (https://github.com/phpstan/phpstan-src/commit/941fc815db49315b8783dc466cf593e0d8a85d23) - Check template type variance in
@param-out
(https://github.com/phpstan/phpstan-src/commit/7ceb19d3b42cf4632d10c2babb0fc5a21b6c8352), https://github.com/phpstan/phpstan/issues/8880#issuecomment-1426971473
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon
:
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Improvements 

- Implement identical/equal comparisons on EnumCaseObjectType (#2105), thanks @staabm!
- MatchExpressionRule - use ConstantConditionRuleHelper to remove some duplicate errors (https://github.com/phpstan/phpstan-src/commit/7380ed0e48fea16eab205996ab911f765548e0ff)
- Improvements of
MutatingScope::getNativeType()
(#1943), #4689, #7578, #6260 - Allow default values for allow-private-mutation properties (#2178), #8701, thanks @zonuexe!
- Support
treatPhpDocTypesAsCertain
in NumberComparisonOperatorsConstantConditionRule (https://github.com/phpstan/phpstan-src/commit/649eb70ba3c5a2321c5305522b46b49ba3dacc77), #6776, #7075 - JsonErrorFormatter - strip console-specific characters from tip (https://github.com/phpstan/phpstan-src/commit/6419da745ae460b481e8172e2b5191c898eab43d)
-
InClassMethodNode
- addgetClassReflection()
(https://github.com/phpstan/phpstan-src/commit/c4ee0b8449df6bcd7e9c4500c7055657515253d8) - PhpFunctionFromParserNodeReflection and PhpMethodFromParserNodeReflection are part of BC promise (https://github.com/phpstan/phpstan-src/commit/810717968171bed5a7250ea09de03c5ef7f60ee9)
- AttributesCheck - detect deprecated attributes (https://github.com/phpstan/phpstan-src/commit/e46b0b4aaf34a199f50b8dd589832b52e74baf85)
- Introduce
Type::getTemplateType()
and deprecateGenericTypeVariableResolver
(https://github.com/phpstan/phpstan-src/commit/b73a8aacc1636e1f512ad3850a7126c280b67036, https://github.com/phpstan/phpstan-src/commit/01b4d4e9b89a7f454c77a6f4d4d525ae8bf4ee53) - Implement PHP version dependent loose const comparison (#2220, #2225), thanks @staabm!
Bugfixes 

- Fix LateResolvableTypeTrait (https://github.com/phpstan/phpstan-src/commit/bc2828669fbc93ca81a6b442c528fc56acbb79a1)
- StrCaseFunctionsReturnTypeExtension - do not throw ShouldNotHappenException, it might happen if mbstring is not enabled and the polyfill is not implemented (https://github.com/phpstan/phpstan-src/commit/c015e47f40bdc72c19ce92457dd00d194f365da3), #8925
Function signature fixes 

- Fix
PDO::sqliteCreateFunction
(#2208), #8802, thanks @VincentLanglet! - Use "numeric-string" type for some MySQLi functions (#2223, #2224), thanks @phansys!
- Update param and return type for
db2_autocommit()
(#2239), thanks @phansys!
Internals 

- Deprecate
TypeUtils::getDirectClassNames()
andinstanceof TypeWithClassName
, useType::getObjectClassNames()
instead (#1924), thanks @herndlm! - Remove dead code in UnionType (#2194), thanks @staabm!
- Use
isSuperTypeOf()
instead ofaccepts()
in the right places (https://github.com/phpstan/phpstan-src/commit/ddb9dc5adc7a09dbe2f60d5cab60e5fd51a928fd) - Modernized
IncompatibleDefaultParameterTypeRule
(https://github.com/phpstan/phpstan-src/commit/a79ad038367ebd4c2722daaeaafd9aab24a421df) - InClassMethodNode always contains PhpMethodFromParserNodeReflection (https://github.com/phpstan/phpstan-src/commit/01a789713cd43ffd96c695dbcf85545459523c7e)
- InFunctionNode always contains PhpFunctionFromParserNodeReflection (https://github.com/phpstan/phpstan-src/commit/e864b24a854ac053b10d9ec95d3c12802a4e326a)
- Modernized InClassMethodNode rules (https://github.com/phpstan/phpstan-src/commit/c3da6a911a411652c27e905ee969980119a37d5d)
- Modernized InFunctionNode rules (https://github.com/phpstan/phpstan-src/commit/b736ddcecdb6506e17ebf227654755a4ac5b82e5)
- Introduce
Type::acceptsWithReason()
(https://github.com/phpstan/phpstan-src/commit/b763bd9631f7adfdf3feb8a111511b86a87389aa), #3281 - Fix invalid phpdocs missing null (#2213), thanks @janedbal!
- NodeScopeResolver::earlyTerminatingMethodNames remove useless default (#2214), #8830, thanks @janedbal!
- Skip
testEditorUrlWithRelativePath()
test on PhpStorm console (#2229), thanks @staabm! - VarianceCheck - accept only ParametersAcceptorWithPhpDocs (https://github.com/phpstan/phpstan-src/commit/7da13f7de02c06922a3550e7f037627f8bbc6a55)
- Remove duplicate method definition from ConstantType interface (https://github.com/phpstan/phpstan-src/commit/61fa3a14e22355a013e9d240d55c0d9a5f6609a6)
-
Type::isEnum()
(https://github.com/phpstan/phpstan-src/commit/93113cbca608a0c03073e322d58cd3d82597163f) -
Type::getObjectClassReflections()
(https://github.com/phpstan/phpstan-src/commit/4c7046ef681d05e81f5ad866230582a0009272b9)
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.
Merge request reports
Activity
- Approvals
- Assignees & reviewers
- Comments (from bots)
- Comments (from users)
- Commits & branches
- Edits
- Labels
- Lock status
- Mentions
- Merge request status
- Tracking