From c7b6500100e49f597a1b2560cf24e992d900670d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 30 Sep 2025 17:00:13 +0200 Subject: [PATCH 1/5] Configure PromoteParameterRule for issue-bot --- issue-bot/playground.neon | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/issue-bot/playground.neon b/issue-bot/playground.neon index a252e3bac8..cfab2e1fc7 100644 --- a/issue-bot/playground.neon +++ b/issue-bot/playground.neon @@ -12,3 +12,70 @@ conditionalTags: services: - class: PHPStan\Rules\Playground\StaticVarWithoutTypeRule + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @uninitializedPropertyRule + nodeType: PHPStan\Node\ClassPropertiesNode + parameterValue: %checkUninitializedProperties% + parameterName: checkUninitializedProperties + tags: + - phpstan.rules.rule + autowired: false + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @nonexistentOffsetInArrayDimFetchGeneralArrayRule + nodeType: PhpParser\Node\Expr\ArrayDimFetch + parameterValue: %reportPossiblyNonexistentGeneralArrayOffset% + parameterName: reportPossiblyNonexistentGeneralArrayOffset + tags: + - phpstan.rules.rule + autowired: false + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @nonexistentOffsetInArrayDimFetchConstantArrayRule + nodeType: PhpParser\Node\Expr\ArrayDimFetch + parameterValue: %reportPossiblyNonexistentConstantArrayOffset% + parameterName: reportPossiblyNonexistentConstantArrayOffset + tags: + - phpstan.rules.rule + autowired: false + + nonexistentOffsetInArrayDimFetchGeneralArrayRule: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule + arguments: + nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset + reportMaybes: %reportMaybes% + autowired: false + + nonexistentOffsetInArrayDimFetchConstantArrayRule: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule + arguments: + nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset + reportMaybes: %reportMaybes% + autowired: false + + nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck + arguments: + reportMaybes: %reportMaybes% + reportPossiblyNonexistentGeneralArrayOffset: true + reportPossiblyNonexistentConstantArrayOffset: false + autowired: false + + nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck + arguments: + reportMaybes: %reportMaybes% + reportPossiblyNonexistentGeneralArrayOffset: false + reportPossiblyNonexistentConstantArrayOffset: true + autowired: false + + uninitializedPropertyRule: + class: PHPStan\Rules\Properties\UninitializedPropertyRule + autowired: false From 842c192a5da78788687759f42e337c831b61b6f7 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 30 Sep 2025 17:05:55 +0200 Subject: [PATCH 2/5] Update playground.neon --- issue-bot/playground.neon | 71 +++------------------------------------ 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/issue-bot/playground.neon b/issue-bot/playground.neon index cfab2e1fc7..836df5f8d1 100644 --- a/issue-bot/playground.neon +++ b/issue-bot/playground.neon @@ -9,73 +9,10 @@ conditionalTags: PHPStan\Rules\Playground\StaticVarWithoutTypeRule: phpstan.rules.rule: %checkImplicitMixed% +parameters: + reportPossiblyNonexistentGeneralArrayOffset: true + reportPossiblyNonexistentConstantArrayOffset: true + services: - class: PHPStan\Rules\Playground\StaticVarWithoutTypeRule - - - - class: PHPStan\Rules\Playground\PromoteParameterRule - arguments: - rule: @uninitializedPropertyRule - nodeType: PHPStan\Node\ClassPropertiesNode - parameterValue: %checkUninitializedProperties% - parameterName: checkUninitializedProperties - tags: - - phpstan.rules.rule - autowired: false - - - - class: PHPStan\Rules\Playground\PromoteParameterRule - arguments: - rule: @nonexistentOffsetInArrayDimFetchGeneralArrayRule - nodeType: PhpParser\Node\Expr\ArrayDimFetch - parameterValue: %reportPossiblyNonexistentGeneralArrayOffset% - parameterName: reportPossiblyNonexistentGeneralArrayOffset - tags: - - phpstan.rules.rule - autowired: false - - - - class: PHPStan\Rules\Playground\PromoteParameterRule - arguments: - rule: @nonexistentOffsetInArrayDimFetchConstantArrayRule - nodeType: PhpParser\Node\Expr\ArrayDimFetch - parameterValue: %reportPossiblyNonexistentConstantArrayOffset% - parameterName: reportPossiblyNonexistentConstantArrayOffset - tags: - - phpstan.rules.rule - autowired: false - - nonexistentOffsetInArrayDimFetchGeneralArrayRule: - class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule - arguments: - nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset - reportMaybes: %reportMaybes% - autowired: false - - nonexistentOffsetInArrayDimFetchConstantArrayRule: - class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule - arguments: - nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset - reportMaybes: %reportMaybes% - autowired: false - - nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset: - class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck - arguments: - reportMaybes: %reportMaybes% - reportPossiblyNonexistentGeneralArrayOffset: true - reportPossiblyNonexistentConstantArrayOffset: false - autowired: false - - nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset: - class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck - arguments: - reportMaybes: %reportMaybes% - reportPossiblyNonexistentGeneralArrayOffset: false - reportPossiblyNonexistentConstantArrayOffset: true - autowired: false - - uninitializedPropertyRule: - class: PHPStan\Rules\Properties\UninitializedPropertyRule - autowired: false From 6b63d93a225f3529996e0dac0cc0873625b36f01 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 30 Sep 2025 17:06:52 +0200 Subject: [PATCH 3/5] Update playground.neon --- issue-bot/playground.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/issue-bot/playground.neon b/issue-bot/playground.neon index 836df5f8d1..260847b936 100644 --- a/issue-bot/playground.neon +++ b/issue-bot/playground.neon @@ -12,6 +12,7 @@ conditionalTags: parameters: reportPossiblyNonexistentGeneralArrayOffset: true reportPossiblyNonexistentConstantArrayOffset: true + checkUninitializedProperties: true services: - From 3e8bb65b497248570ab4bc915a3cea242016c4a5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 30 Sep 2025 17:34:22 +0200 Subject: [PATCH 4/5] Revert "Update playground.neon" This reverts commit 6b63d93a225f3529996e0dac0cc0873625b36f01. --- issue-bot/playground.neon | 1 - 1 file changed, 1 deletion(-) diff --git a/issue-bot/playground.neon b/issue-bot/playground.neon index 260847b936..836df5f8d1 100644 --- a/issue-bot/playground.neon +++ b/issue-bot/playground.neon @@ -12,7 +12,6 @@ conditionalTags: parameters: reportPossiblyNonexistentGeneralArrayOffset: true reportPossiblyNonexistentConstantArrayOffset: true - checkUninitializedProperties: true services: - From 6363bd49c435d7b31f05fedd685546fa9fd36e58 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 30 Sep 2025 17:34:24 +0200 Subject: [PATCH 5/5] Revert "Update playground.neon" This reverts commit 842c192a5da78788687759f42e337c831b61b6f7. --- issue-bot/playground.neon | 71 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/issue-bot/playground.neon b/issue-bot/playground.neon index 836df5f8d1..cfab2e1fc7 100644 --- a/issue-bot/playground.neon +++ b/issue-bot/playground.neon @@ -9,10 +9,73 @@ conditionalTags: PHPStan\Rules\Playground\StaticVarWithoutTypeRule: phpstan.rules.rule: %checkImplicitMixed% -parameters: - reportPossiblyNonexistentGeneralArrayOffset: true - reportPossiblyNonexistentConstantArrayOffset: true - services: - class: PHPStan\Rules\Playground\StaticVarWithoutTypeRule + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @uninitializedPropertyRule + nodeType: PHPStan\Node\ClassPropertiesNode + parameterValue: %checkUninitializedProperties% + parameterName: checkUninitializedProperties + tags: + - phpstan.rules.rule + autowired: false + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @nonexistentOffsetInArrayDimFetchGeneralArrayRule + nodeType: PhpParser\Node\Expr\ArrayDimFetch + parameterValue: %reportPossiblyNonexistentGeneralArrayOffset% + parameterName: reportPossiblyNonexistentGeneralArrayOffset + tags: + - phpstan.rules.rule + autowired: false + + - + class: PHPStan\Rules\Playground\PromoteParameterRule + arguments: + rule: @nonexistentOffsetInArrayDimFetchConstantArrayRule + nodeType: PhpParser\Node\Expr\ArrayDimFetch + parameterValue: %reportPossiblyNonexistentConstantArrayOffset% + parameterName: reportPossiblyNonexistentConstantArrayOffset + tags: + - phpstan.rules.rule + autowired: false + + nonexistentOffsetInArrayDimFetchGeneralArrayRule: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule + arguments: + nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset + reportMaybes: %reportMaybes% + autowired: false + + nonexistentOffsetInArrayDimFetchConstantArrayRule: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchRule + arguments: + nonexistentOffsetInArrayDimFetchCheck: @nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset + reportMaybes: %reportMaybes% + autowired: false + + nonexistentOffsetInArrayDimFetchCheckGeneralArrayOffset: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck + arguments: + reportMaybes: %reportMaybes% + reportPossiblyNonexistentGeneralArrayOffset: true + reportPossiblyNonexistentConstantArrayOffset: false + autowired: false + + nonexistentOffsetInArrayDimFetchCheckConstantArrayOffset: + class: PHPStan\Rules\Arrays\NonexistentOffsetInArrayDimFetchCheck + arguments: + reportMaybes: %reportMaybes% + reportPossiblyNonexistentGeneralArrayOffset: false + reportPossiblyNonexistentConstantArrayOffset: true + autowired: false + + uninitializedPropertyRule: + class: PHPStan\Rules\Properties\UninitializedPropertyRule + autowired: false