@@ -140,9 +140,11 @@ try {
140140}
141141
142142
143- function render_line ( $ filename , $ line , $ column , $ message , $ source ) {
143+ function render_line ( $ filename , $ line , $ column , $ message , $ source, $ issue_number ) {
144144 global $ colour_primary , $ colour_secondary ;
145- return OUTPUT_BOLD . $ colour_primary . "* " . $ filename . ": " . $ line . ': ' . $ column . OUTPUT_UNBOLD . PHP_EOL
145+ return OUTPUT_BOLD . $ colour_primary . "* "
146+ . $ colour_secondary . OUTPUT_REVERSE . $ issue_number . OUTPUT_UNREVERSE . " "
147+ . $ colour_primary . $ filename . ": " . $ line . ': ' . $ column . OUTPUT_UNBOLD . PHP_EOL
146148 . "\t" . $ source . ": " . PHP_EOL
147149 . "\t" . $ colour_secondary . $ message . OUTPUT_RESET ;
148150}
@@ -151,14 +153,14 @@ $blockers = $warnings = $notes = [];
151153foreach ( $ found_issues as $ filename => $ issues ) {
152154 foreach ( $ issues as $ line => $ line_issues ) {
153155 foreach ( $ line_issues as $ issue ) {
154- $ output = render_line ( $ filename , $ line , $ issue ['column ' ], $ issue ['message ' ], $ issue ['source ' ] ) ;
156+ $ line_args = [ $ filename , $ line , $ issue ['column ' ], $ issue ['message ' ], $ issue ['source ' ] ] ;
155157
156158 if ( 'ERROR ' === $ issue ['level ' ] ) {
157- $ blockers [] = $ output ;
159+ $ blockers [] = $ line_args ;
158160 } else if ( 'WARNING ' === $ issue ['level ' ] ) {
159- $ warnings [] = $ output ;
161+ $ warnings [] = $ line_args ;
160162 } else if ( 'NOTE ' === $ issue ['level ' ] ) {
161- $ notes [] = $ output ;
163+ $ notes [] = $ line_args ;
162164 }
163165 }
164166 }
@@ -172,8 +174,11 @@ function echo_chapter( $title, $items ) {
172174 }
173175
174176 echo OUTPUT_REVERSE . OUTPUT_BOLD . $ colour_primary . "### " . $ title . OUTPUT_RESET . PHP_EOL . PHP_EOL ;
175- foreach ( $ items as $ item ) {
176- echo $ item . PHP_EOL ;
177+
178+ $ issue_number = 1 ;
179+ foreach ( $ items as $ line_args ) {
180+ $ line_args [] = $ issue_number ++;
181+ echo call_user_func_array ( '\PHPCSDiff\render_line ' , $ line_args ) . PHP_EOL ;
177182 }
178183
179184 echo PHP_EOL ;
@@ -201,4 +206,4 @@ if( 'blockers' === $tolerance ) {
201206 }
202207}
203208
204- exit (1 );
209+ exit (1 );
0 commit comments