@@ -56,7 +56,7 @@ public function processNode(Node $node, Scope $scope): array
5656 if (strtolower ($ methodName ) === '__clone ' ) {
5757 continue ;
5858 }
59- $ methods [$ methodName ] = $ method ;
59+ $ methods [strtolower ( $ methodName) ] = $ method ;
6060 }
6161
6262 $ arrayCalls = [];
@@ -105,7 +105,7 @@ public function processNode(Node $node, Scope $scope): array
105105 if ($ inMethod ->getName () === $ methodName ) {
106106 continue ;
107107 }
108- unset($ methods [$ methodName ]);
108+ unset($ methods [strtolower ( $ methodName) ]);
109109 }
110110 }
111111
@@ -144,19 +144,20 @@ public function processNode(Node $node, Scope $scope): array
144144 if ($ inMethod ->getName () === $ typeAndMethod ->getMethod ()) {
145145 continue ;
146146 }
147- unset($ methods [$ typeAndMethod ->getMethod ()]);
147+ unset($ methods [strtolower ( $ typeAndMethod ->getMethod () )]);
148148 }
149149 }
150150 }
151151 }
152152
153153 $ errors = [];
154- foreach ($ methods as $ methodName => $ method ) {
154+ foreach ($ methods as $ method ) {
155+ $ originalMethodName = $ method ->getNode ()->name ->toString ();
155156 $ methodType = 'Method ' ;
156157 if ($ method ->getNode ()->isStatic ()) {
157158 $ methodType = 'Static method ' ;
158159 }
159- $ errors [] = RuleErrorBuilder::message (sprintf ('%s %s::%s() is unused. ' , $ methodType , $ classReflection ->getDisplayName (), $ methodName ))
160+ $ errors [] = RuleErrorBuilder::message (sprintf ('%s %s::%s() is unused. ' , $ methodType , $ classReflection ->getDisplayName (), $ originalMethodName ))
160161 ->line ($ method ->getNode ()->getLine ())
161162 ->identifier ('method.unused ' )
162163 ->build ();
0 commit comments