We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76a39b commit 49429f1Copy full SHA for 49429f1
CodeSniffer/Reports/Full.php
@@ -77,15 +77,8 @@ public function generateFileReport(
77
echo 'AFFECTING '.count($report['messages']).' LINE(S)'.PHP_EOL;
78
echo str_repeat('-', $width).PHP_EOL;
79
80
- // Work out the max line number for formatting.
81
- $maxLine = 0;
82
- foreach ($report['messages'] as $line => $lineErrors) {
83
- if ($line > $maxLine) {
84
- $maxLine = $line;
85
- }
86
87
-
88
- $maxLineLength = strlen($maxLine);
+ // Work out the max line number length for formatting.
+ $maxLineLength = max(array_map('strlen', array_keys($report['messages'])));
89
90
// The length of the word ERROR or WARNING; used for padding.
91
if ($report['warnings'] > 0) {
0 commit comments