Skip to content

Commit 6ce1743

Browse files
committed
[BE] IncompatibleDefaultParameterTypeRule for closures
1 parent f3b7190 commit 6ce1743

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

changelog-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Major new features 🚀
2323
* ArrayUnpackingRule (level 3) ([#856](https://github.com/phpstan/phpstan-src/pull/856)), thanks @canvural!
2424
* Check unresolvable parameters (level 5) ([#1319](https://github.com/phpstan/phpstan-src/pull/1319)), thanks @rvanvelzen!
2525
* Enforce `@no-named-arguments` (level 5) (https://github.com/phpstan/phpstan-src/commit/74ba8c23696948f2647d880df72f375346f41010), #5968
26+
* IncompatibleDefaultParameterTypeRule for closures (level 2) (https://github.com/phpstan/phpstan-src/commit/0264f5bc48448c7e02a23b82eef4177d0617a82f)
2627
* Added previously absent type checks (level 0)
2728
* Check existing classes in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9)
2829
* Check nonexistent classes in local type aliases (https://github.com/phpstan/phpstan-src/commit/2485b2e9c129e789ec3b2d7db81ca30f87c63911)
@@ -62,7 +63,6 @@ Bleeding edge (TODO move to other sections)
6263
* Always report always true conditions, except for last elseif and match arm ([#2105](https://github.com/phpstan/phpstan-src/pull/2105)), thanks @staabm!
6364
* Disable "unreachable branches" rules: UnreachableIfBranchesRule, UnreachableTernaryElseBranchRule, unreachable arm error in MatchExpressionRule
6465
* Because "always true" is always reported, these are no longer needed
65-
* IncompatibleDefaultParameterTypeRule for closures (https://github.com/phpstan/phpstan-src/commit/0264f5bc48448c7e02a23b82eef4177d0617a82f)
6666
* Check variance of template types in properties ([#2314](https://github.com/phpstan/phpstan-src/pull/2314)), thanks @jiripudil!
6767
* Report narrowing `PHPStan\Type\Type` interface via `@var` (https://github.com/phpstan/phpstan-src/commit/713b98fb107213c28e3d8c8b4b43c5f5fc47c144), https://github.com/nunomaduro/larastan/issues/1567#issuecomment-1460445389
6868
* Check invalid PHPDocs in previously unchecked statement types (https://github.com/phpstan/phpstan-src/commit/9780d352f3264aac09ac7954f691de1877db8e01)

conf/bleedingEdge.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ parameters:
1414
alwaysCheckTooWideReturnTypeFinalMethods: true
1515
alwaysTrueAlwaysReported: true
1616
disableUnreachableBranchesRules: true
17-
closureDefaultParameterTypeRule: true
1817
propertyVariance: true
1918
magicConstantOutOfContext: true
2019
pure: true

conf/config.level2.neon

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ rules:
2323
- PHPStan\Rules\Comparison\UsageOfVoidMatchExpressionRule
2424
- PHPStan\Rules\Constants\ValueAssignedToClassConstantRule
2525
- PHPStan\Rules\Functions\IncompatibleDefaultParameterTypeRule
26+
- PHPStan\Rules\Functions\IncompatibleArrowFunctionDefaultParameterTypeRule
27+
- PHPStan\Rules\Functions\IncompatibleClosureDefaultParameterTypeRule
2628
- PHPStan\Rules\Generics\ClassAncestorsRule
2729
- PHPStan\Rules\Generics\ClassTemplateTypeRule
2830
- PHPStan\Rules\Generics\EnumAncestorsRule
@@ -62,10 +64,6 @@ rules:
6264
- PHPStan\Rules\PhpDoc\RequireExtendsDefinitionTraitRule
6365

6466
conditionalTags:
65-
PHPStan\Rules\Functions\IncompatibleArrowFunctionDefaultParameterTypeRule:
66-
phpstan.rules.rule: %featureToggles.closureDefaultParameterTypeRule%
67-
PHPStan\Rules\Functions\IncompatibleClosureDefaultParameterTypeRule:
68-
phpstan.rules.rule: %featureToggles.closureDefaultParameterTypeRule%
6967
PHPStan\Rules\Methods\IllegalConstructorMethodCallRule:
7068
phpstan.rules.rule: %featureToggles.illegalConstructorMethodCall%
7169
PHPStan\Rules\Methods\IllegalConstructorStaticCallRule:
@@ -95,10 +93,6 @@ services:
9593
tags:
9694
- phpstan.rules.rule
9795

98-
-
99-
class: PHPStan\Rules\Functions\IncompatibleArrowFunctionDefaultParameterTypeRule
100-
-
101-
class: PHPStan\Rules\Functions\IncompatibleClosureDefaultParameterTypeRule
10296
-
10397
class: PHPStan\Rules\Functions\CallCallablesRule
10498
arguments:

conf/config.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ parameters:
3535
alwaysCheckTooWideReturnTypeFinalMethods: false
3636
alwaysTrueAlwaysReported: false
3737
disableUnreachableBranchesRules: false
38-
closureDefaultParameterTypeRule: false
3938
propertyVariance: false
4039
stricterFunctionMap: false
4140
magicConstantOutOfContext: false

conf/parametersSchema.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ parametersSchema:
4141
alwaysCheckTooWideReturnTypeFinalMethods: bool()
4242
alwaysTrueAlwaysReported: bool()
4343
disableUnreachableBranchesRules: bool()
44-
closureDefaultParameterTypeRule: bool()
4544
propertyVariance: bool()
4645
stricterFunctionMap: bool()
4746
magicConstantOutOfContext: bool()

0 commit comments

Comments
 (0)