File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,12 @@ public function process_token( $stackPtr ) {
103103 */
104104 if ( true === $ single_line && $ item_index === $ array_item_count ) {
105105
106+ $ this ->phpcsFile ->recordMetric (
107+ $ stackPtr ,
108+ 'Single line array - comma after last item ' ,
109+ ( true === $ is_comma ? 'yes ' : 'no ' )
110+ );
111+
106112 if ( true === $ is_comma ) {
107113 $ fix = $ this ->phpcsFile ->addFixableError (
108114 'Comma not allowed after last value in single-line array declaration ' ,
@@ -153,6 +159,14 @@ public function process_token( $stackPtr ) {
153159 }
154160 }
155161
162+ if ( false === $ single_line && $ item_index === $ array_item_count ) {
163+ $ this ->phpcsFile ->recordMetric (
164+ $ stackPtr ,
165+ 'Multi-line array - comma after last item ' ,
166+ ( true === $ is_comma ? 'yes ' : 'no ' )
167+ );
168+ }
169+
156170 if ( false === $ is_comma ) {
157171 // Can't check spacing around the comma if there is no comma.
158172 continue ;
You can’t perform that action at this time.
0 commit comments