@@ -291,39 +291,37 @@ public function processMultiLineArray(File $phpcsFile, int $stackPtr, int $array
291291 continue ;
292292 }
293293
294- if ($ tokens [$ nextToken ]['code ' ] === T_DOUBLE_ARROW ) {
295- $ currentEntry ['arrow ' ] = $ nextToken ;
296- $ keyUsed = true ;
294+ $ currentEntry ['arrow ' ] = $ nextToken ;
295+ $ keyUsed = true ;
297296
298- // Find the start of index that uses this double arrow.
299- $ indexEnd = (int )$ phpcsFile ->findPrevious (T_WHITESPACE , ($ nextToken - 1 ), $ arrayStart , true );
300- $ indexStart = $ phpcsFile ->findStartOfStatement ($ indexEnd );
297+ // Find the start of index that uses this double arrow.
298+ $ indexEnd = (int )$ phpcsFile ->findPrevious (T_WHITESPACE , ($ nextToken - 1 ), $ arrayStart , true );
299+ $ indexStart = $ phpcsFile ->findStartOfStatement ($ indexEnd );
301300
302- if ($ indexStart === $ indexEnd ) {
303- $ currentEntry ['index ' ] = $ indexEnd ;
304- $ currentEntry ['index_content ' ] = $ tokens [$ indexEnd ]['content ' ];
305- } else {
306- $ currentEntry ['index ' ] = $ indexStart ;
307- $ currentEntry ['index_content ' ] = $ phpcsFile ->getTokensAsString ($ indexStart , ($ indexEnd - $ indexStart + 1 ));
308- }
309-
310- $ indexLength = strlen ($ currentEntry ['index_content ' ]);
311- if ($ maxLength < $ indexLength ) {
312- $ maxLength = $ indexLength ;
313- }
314-
315- // Find the value of this index.
316- $ nextContent = $ phpcsFile ->findNext (
317- Tokens::$ emptyTokens ,
318- ($ nextToken + 1 ),
319- $ arrayEnd ,
320- true ,
321- );
301+ if ($ indexStart === $ indexEnd ) {
302+ $ currentEntry ['index ' ] = $ indexEnd ;
303+ $ currentEntry ['index_content ' ] = $ tokens [$ indexEnd ]['content ' ];
304+ } else {
305+ $ currentEntry ['index ' ] = $ indexStart ;
306+ $ currentEntry ['index_content ' ] = $ phpcsFile ->getTokensAsString ($ indexStart , ($ indexEnd - $ indexStart + 1 ));
307+ }
322308
323- $ currentEntry ['value ' ] = $ nextContent ;
324- $ indices [] = $ currentEntry ;
325- $ lastToken = $ nextToken ;
309+ $ indexLength = strlen ( $ currentEntry ['index_content ' ]) ;
310+ if ( $ maxLength < $ indexLength ) {
311+ $ maxLength = $ indexLength ;
326312 }
313+
314+ // Find the value of this index.
315+ $ nextContent = $ phpcsFile ->findNext (
316+ Tokens::$ emptyTokens ,
317+ ($ nextToken + 1 ),
318+ $ arrayEnd ,
319+ true ,
320+ );
321+
322+ $ currentEntry ['value ' ] = $ nextContent ;
323+ $ indices [] = $ currentEntry ;
324+ $ lastToken = $ nextToken ;
327325 }
328326
329327 $ numValues = count ($ indices );
0 commit comments