@@ -25,10 +25,11 @@ class Code implements Report
25
25
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
26
26
* its data should be counted in the grand totals.
27
27
*
28
- * @param array $report Prepared report data.
29
- * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
30
- * @param bool $showSources Show sources?
31
- * @param int $width Maximum allowed line width.
28
+ * @param array<string, string|int|array> $report Prepared report data.
29
+ * See the {@see Report} interface for a detailed specification.
30
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
31
+ * @param bool $showSources Show sources?
32
+ * @param int $width Maximum allowed line width.
32
33
*
33
34
* @return bool
34
35
*/
@@ -121,8 +122,8 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
121
122
122
123
// Determine the longest error message we will be showing.
123
124
$ maxErrorLength = 0 ;
124
- foreach ($ report ['messages ' ] as $ line => $ lineErrors ) {
125
- foreach ($ lineErrors as $ column => $ colErrors ) {
125
+ foreach ($ report ['messages ' ] as $ lineErrors ) {
126
+ foreach ($ lineErrors as $ colErrors ) {
126
127
foreach ($ colErrors as $ error ) {
127
128
$ length = strlen ($ error ['message ' ]);
128
129
if ($ showSources === true ) {
@@ -264,7 +265,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
264
265
265
266
echo str_repeat ('- ' , $ width ).PHP_EOL ;
266
267
267
- foreach ($ lineErrors as $ column => $ colErrors ) {
268
+ foreach ($ lineErrors as $ colErrors ) {
268
269
foreach ($ colErrors as $ error ) {
269
270
$ padding = ($ maxLineNumLength - strlen ($ line ));
270
271
echo 'LINE ' .str_repeat (' ' , $ padding ).$ line .': ' ;
0 commit comments