From 4f002b29a5b97e415723431c92f37ba7a5bb0427 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 27 Sep 2025 11:05:58 +0200 Subject: [PATCH] Simplify *StatementWithoutImpurePointsRule --- .../DeadCode/CallToMethodStatementWithoutImpurePointsRule.php | 4 ---- .../CallToStaticMethodStatementWithoutImpurePointsRule.php | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/Rules/DeadCode/CallToMethodStatementWithoutImpurePointsRule.php b/src/Rules/DeadCode/CallToMethodStatementWithoutImpurePointsRule.php index e51c232112..a04d151ad9 100644 --- a/src/Rules/DeadCode/CallToMethodStatementWithoutImpurePointsRule.php +++ b/src/Rules/DeadCode/CallToMethodStatementWithoutImpurePointsRule.php @@ -30,10 +30,6 @@ public function processNode(Node $node, Scope $scope): array foreach ($node->get(MethodWithoutImpurePointsCollector::class) as $collected) { foreach ($collected as [$className, $methodName, $classDisplayName]) { $className = strtolower($className); - - if (!array_key_exists($className, $methods)) { - $methods[$className] = []; - } $methods[$className][strtolower($methodName)] = $classDisplayName . '::' . $methodName; } } diff --git a/src/Rules/DeadCode/CallToStaticMethodStatementWithoutImpurePointsRule.php b/src/Rules/DeadCode/CallToStaticMethodStatementWithoutImpurePointsRule.php index 8979b774b6..f8938547b5 100644 --- a/src/Rules/DeadCode/CallToStaticMethodStatementWithoutImpurePointsRule.php +++ b/src/Rules/DeadCode/CallToStaticMethodStatementWithoutImpurePointsRule.php @@ -30,10 +30,6 @@ public function processNode(Node $node, Scope $scope): array foreach ($node->get(MethodWithoutImpurePointsCollector::class) as $collected) { foreach ($collected as [$className, $methodName, $classDisplayName]) { $lowerClassName = strtolower($className); - - if (!array_key_exists($lowerClassName, $methods)) { - $methods[$lowerClassName] = []; - } $methods[$lowerClassName][strtolower($methodName)] = $classDisplayName . '::' . $methodName; } }