diff --git a/packages/NodeCollector/NodeCollector/NodeRepository.php b/packages/NodeCollector/NodeCollector/NodeRepository.php index d5f05a95c30..82cf68fcf67 100644 --- a/packages/NodeCollector/NodeCollector/NodeRepository.php +++ b/packages/NodeCollector/NodeCollector/NodeRepository.php @@ -471,7 +471,7 @@ private function collectArray(Array_ $array): void return; } - $this->arrayCallablesByTypeAndMethod[$arrayCallable->getClass()][$arrayCallable->getMethod()][] = $arrayCallable; + $this->arrayCallablesByTypeAndMethod[$arrayCallable->getClass()][strtolower($arrayCallable->getMethod())][] = $arrayCallable; } private function addMethod(ClassMethod $classMethod): void diff --git a/rules-tests/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector/Fixture/skip_array_callables_this_case_insensitive_method_name.php.inc b/rules-tests/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector/Fixture/skip_array_callables_this_case_insensitive_method_name.php.inc new file mode 100644 index 00000000000..5222b048533 --- /dev/null +++ b/rules-tests/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector/Fixture/skip_array_callables_this_case_insensitive_method_name.php.inc @@ -0,0 +1,26 @@ + $b; + } + + private function SOrtCAseINSENsitivEMEthodnaME($a, $b) + { + return $a <=> $b; + } +}