@@ -126,11 +126,11 @@ private function isParamAccessedArrayDimFetch(Param $param, $functionLike): bool
126126 }
127127 $ paramName = $ this ->getName ($ param );
128128 $ isParamAccessedArrayDimFetch = \false;
129- $ this ->traverseNodesWithCallable ($ functionLike ->stmts , function (Node $ node ) use ($ param , $ paramName , &$ isParamAccessedArrayDimFetch ): ?int {
129+ $ this ->traverseNodesWithCallable ($ functionLike ->stmts , function (Node $ node ) use ($ paramName , &$ isParamAccessedArrayDimFetch ): ?int {
130130 if ($ node instanceof Class_ || $ node instanceof FunctionLike) {
131131 return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN ;
132132 }
133- if ($ this ->shouldStop ($ node , $ param , $ paramName )) {
133+ if ($ this ->shouldStop ($ node , $ paramName )) {
134134 // force set to false to avoid too early replaced
135135 $ isParamAccessedArrayDimFetch = \false;
136136 return NodeVisitor::STOP_TRAVERSAL ;
@@ -185,12 +185,9 @@ private function isEchoed(Node $node, string $paramName): bool
185185 }
186186 return \false;
187187 }
188- private function shouldStop (Node $ node , Param $ param , string $ paramName ): bool
188+ private function shouldStop (Node $ node , string $ paramName ): bool
189189 {
190190 $ nodeToCheck = null ;
191- if (!$ param ->default instanceof Expr && ($ node instanceof Empty_ && $ node ->expr instanceof ArrayDimFetch && $ node ->expr ->var instanceof Variable && $ node ->expr ->var ->name === $ paramName )) {
192- return \true;
193- }
194191 if ($ node instanceof FuncCall && !$ node ->isFirstClassCallable () && $ this ->isNames ($ node , ['is_array ' , 'is_string ' , 'is_int ' , 'is_bool ' , 'is_float ' ])) {
195192 $ firstArg = $ node ->getArgs ()[0 ];
196193 $ nodeToCheck = $ firstArg ->value ;
0 commit comments