@@ -81,7 +81,7 @@ public function getNodeTypes() : array
8181 */
8282 public function refactor (Node $ node ) : ?StmtsAwareInterface
8383 {
84- return $ this ->processArrayKeyFirstLast ($ node, \false );
84+ return $ this ->processArrayKeyFirstLast ($ node );
8585 }
8686 public function provideMinPhpVersion () : int
8787 {
@@ -91,7 +91,7 @@ public function providePolyfillPackage() : string
9191 {
9292 return PolyfillPackage::PHP_73 ;
9393 }
94- private function processArrayKeyFirstLast (StmtsAwareInterface $ stmtsAware , bool $ hasChanged , int $ jumpToKey = 0 ) : ?StmtsAwareInterface
94+ private function processArrayKeyFirstLast (StmtsAwareInterface $ stmtsAware , int $ jumpToKey = 0 ) : ?StmtsAwareInterface
9595 {
9696 if ($ stmtsAware ->stmts === null ) {
9797 return null ;
@@ -124,10 +124,6 @@ private function processArrayKeyFirstLast(StmtsAwareInterface $stmtsAware, bool
124124 $ keyFuncCall ->name = new Name ($ newName );
125125 $ this ->changeNextKeyCall ($ stmtsAware , $ key + 2 , $ resetOrEndFuncCall , $ keyFuncCall ->name );
126126 unset($ stmtsAware ->stmts [$ key ]);
127- $ hasChanged = \true;
128- return $ this ->processArrayKeyFirstLast ($ stmtsAware , $ hasChanged , $ key + 2 );
129- }
130- if ($ hasChanged ) {
131127 return $ stmtsAware ;
132128 }
133129 return null ;
@@ -140,7 +136,7 @@ private function changeNextKeyCall(StmtsAwareInterface $stmtsAware, int $key, Fu
140136 break ;
141137 }
142138 if ($ stmtsAware ->stmts [$ nextKey ] instanceof Expression && !$ this ->shouldSkip ($ stmtsAware ->stmts [$ nextKey ])) {
143- $ this ->processArrayKeyFirstLast ($ stmtsAware , \true, $ nextKey );
139+ $ this ->processArrayKeyFirstLast ($ stmtsAware , $ nextKey );
144140 break ;
145141 }
146142 $ keyFuncCall = $ this ->resolveKeyFuncCall ($ stmtsAware ->stmts [$ nextKey ], $ resetOrEndFuncCall );
0 commit comments