@@ -478,31 +478,15 @@ public function getActualArrayKey(File $phpcsFile, $startPtr, $endPtr)
478
478
continue ;
479
479
}
480
480
481
- // Handle FQN true/false/null.
482
- if ($ this ->tokens [$ i ]['code ' ] === \T_NAME_FULLY_QUALIFIED ) {
483
- $ compareReadyKeyword = \strtolower ($ this ->tokens [$ i ]['content ' ]);
484
- if ($ compareReadyKeyword === '\true '
485
- || $ compareReadyKeyword === '\false '
486
- || $ compareReadyKeyword === '\null '
487
- ) {
488
- // FQN true/false/null on PHPCS 4.x. This can be handled.
489
- $ content .= $ this ->tokens [$ i ]['content ' ];
490
- continue ;
491
- }
492
- } elseif ($ this ->tokens [$ i ]['code ' ] === \T_NS_SEPARATOR ) {
493
- // PHPCS 3.x.
481
+ // Handle FQN true/false/null for PHPCS 3.x.
482
+ if ($ this ->tokens [$ i ]['code ' ] === \T_NS_SEPARATOR ) {
494
483
$ nextNonEmpty = $ phpcsFile ->findNext (Tokens::$ emptyTokens , ($ i + 1 ), null , true );
495
484
$ nextNonEmptyLC = \strtolower ($ this ->tokens [$ nextNonEmpty ]['content ' ]);
496
485
if ($ nextNonEmpty !== false
497
- // PHPCS 3.x with PHP < 8.0.
498
486
&& ($ this ->tokens [$ nextNonEmpty ]['code ' ] === \T_TRUE
499
487
|| $ this ->tokens [$ nextNonEmpty ]['code ' ] === \T_FALSE
500
- || $ this ->tokens [$ nextNonEmpty ]['code ' ] === \T_NULL
501
- // PHPCS 3.x with PHP >= 8.0 where the namespaced name tokenization has been undone.
502
- || ($ this ->tokens [$ nextNonEmpty ]['code ' ] === \T_STRING
503
- && ($ nextNonEmptyLC === 'true ' || $ nextNonEmptyLC === 'false ' || $ nextNonEmptyLC === 'null ' )))
488
+ || $ this ->tokens [$ nextNonEmpty ]['code ' ] === \T_NULL )
504
489
) {
505
- // FQN true/false/null on PHPCS 3.x. This can be handled.
506
490
$ content .= $ this ->tokens [$ nextNonEmpty ]['content ' ];
507
491
$ i = $ nextNonEmpty ;
508
492
continue ;
0 commit comments