Bump phpstan/phpstan from 1.9.17 to 1.10.1
Bumps phpstan/phpstan from 1.9.17 to 1.10.1.
Release notes
Sourced from phpstan/phpstan's releases.
1.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)1.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.- 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- 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- 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), phpstan/phpstan#8880If 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
!
... (truncated)
Commits
-
1cd5fc5
PHPStan 1.10.1 -
7d6f0f6
Updated PHPStan to commit 7d6f0f6a4c8eac67cfb2d810681043f9863f04a7 -
7331bc5
Updated PHPStan to commit 7331bc51411943dba14880434df6d7c85a744dcf -
75ad7bf
Update dependencies in playground-runner -
c36f45d
PHPStan 1.10 Comes With a Lie Detector -
71b28a6
PHPStan 1.10.0 -
6a4b30c
Updated PHPStan to commit 6a4b30c9adbda073d27fc3845a23dcdccee07bce -
3198be7
Update config-reference.md -
9dd5b64
Updated PHPStan to commit 9dd5b640fbd4b17cfbefa7cc09e1330a01b26bc9 -
c015e47
Updated PHPStan to commit c015e47f40bdc72c19ce92457dd00d194f365da3 - Additional commits viewable in compare view
Dependabot commands
You can trigger Dependabot actions by commenting on this MR
-
$dependabot rebase
will rebase this MR -
$dependabot recreate
will recreate this MR rewriting all the manual changes and resolving conflicts