@@ -36,16 +36,8 @@ public function process(File $phpcsFile, $stackPtr): void
3636 $ tokens = $ phpcsFile ->getTokens ();
3737
3838 if (T_ARRAY === $ tokens [$ stackPtr ]['code ' ]) {
39- $ phpcsFile ->recordMetric ($ stackPtr , 'Short array syntax used ' , 'no ' );
40-
4139 // Array keyword should be lower case.
4240 if (strtolower ($ tokens [$ stackPtr ]['content ' ]) !== $ tokens [$ stackPtr ]['content ' ]) {
43- if (strtoupper ($ tokens [$ stackPtr ]['content ' ]) === $ tokens [$ stackPtr ]['content ' ]) {
44- $ phpcsFile ->recordMetric ($ stackPtr , 'Array keyword case ' , 'upper ' );
45- } else {
46- $ phpcsFile ->recordMetric ($ stackPtr , 'Array keyword case ' , 'mixed ' );
47- }
48-
4941 $ fix = $ phpcsFile ->addFixableError (
5042 'Array keyword should be lower case; expected "array" but found "%s" ' ,
5143 $ stackPtr ,
@@ -56,8 +48,6 @@ public function process(File $phpcsFile, $stackPtr): void
5648 if ($ fix ) {
5749 $ phpcsFile ->fixer ->replaceToken ($ stackPtr , 'array ' );
5850 }
59- } else {
60- $ phpcsFile ->recordMetric ($ stackPtr , 'Array keyword case ' , 'lower ' );
6151 }
6252
6353 $ arrayStart = $ tokens [$ stackPtr ]['parenthesis_opener ' ];
@@ -79,7 +69,6 @@ public function process(File $phpcsFile, $stackPtr): void
7969 }
8070 }
8171 } else {
82- $ phpcsFile ->recordMetric ($ stackPtr , 'Short array syntax used ' , 'yes ' );
8372 $ arrayStart = $ stackPtr ;
8473 $ arrayEnd = $ tokens [$ stackPtr ]['bracket_closer ' ];
8574 }
@@ -449,17 +438,15 @@ public function processMultiLineArray(File $phpcsFile, int $stackPtr, int $start
449438 );
450439
451440 if (T_COMMA !== $ tokens [$ trailingContent ]['code ' ]) {
452- $ phpcsFile ->recordMetric ($ stackPtr , 'Array end comma ' , 'no ' );
453441 $ fix = $ phpcsFile ->addFixableError (
454442 'Comma required after last value in array declaration ' ,
455443 $ trailingContent ,
456444 'NoCommaAfterLast '
457445 );
446+
458447 if ($ fix ) {
459448 $ phpcsFile ->fixer ->addContent ($ trailingContent , ', ' );
460449 }
461- } else {
462- $ phpcsFile ->recordMetric ($ stackPtr , 'Array end comma ' , 'yes ' );
463450 }
464451
465452 $ lastValueLine = $ stackPtr ;
0 commit comments