Skip to content

Commit 52c891a

Browse files
jrfnlklausi
andcommitted
CS/QA: remove unused foreach keys from report code
As the array format is now documented, these unused variables are no longer needed for documentation purposes. Co-authored-by: Klaus Purer <[email protected]>
1 parent 3107205 commit 52c891a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Reports/Code.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
122122

123123
// Determine the longest error message we will be showing.
124124
$maxErrorLength = 0;
125-
foreach ($report['messages'] as $line => $lineErrors) {
126-
foreach ($lineErrors as $column => $colErrors) {
125+
foreach ($report['messages'] as $lineErrors) {
126+
foreach ($lineErrors as $colErrors) {
127127
foreach ($colErrors as $error) {
128128
$length = strlen($error['message']);
129129
if ($showSources === true) {
@@ -265,7 +265,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
265265

266266
echo str_repeat('-', $width).PHP_EOL;
267267

268-
foreach ($lineErrors as $column => $colErrors) {
268+
foreach ($lineErrors as $colErrors) {
269269
foreach ($colErrors as $error) {
270270
$padding = ($maxLineNumLength - strlen($line));
271271
echo 'LINE '.str_repeat(' ', $padding).$line.': ';

src/Reports/Full.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
6262

6363
// Make sure the report width isn't too big.
6464
$maxErrorLength = 0;
65-
foreach ($report['messages'] as $line => $lineErrors) {
66-
foreach ($lineErrors as $column => $colErrors) {
65+
foreach ($report['messages'] as $lineErrors) {
66+
foreach ($lineErrors as $colErrors) {
6767
foreach ($colErrors as $error) {
6868
// Start with the presumption of a single line error message.
6969
$length = strlen($error['message']);
@@ -139,7 +139,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
139139
$beforeAfterLength = strlen($beforeMsg.$afterMsg);
140140

141141
foreach ($report['messages'] as $line => $lineErrors) {
142-
foreach ($lineErrors as $column => $colErrors) {
142+
foreach ($lineErrors as $colErrors) {
143143
foreach ($colErrors as $error) {
144144
$errorMsg = wordwrap(
145145
$error['message'],

src/Reports/Source.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
4040

4141
$sources = [];
4242

43-
foreach ($report['messages'] as $line => $lineErrors) {
44-
foreach ($lineErrors as $column => $colErrors) {
43+
foreach ($report['messages'] as $lineErrors) {
44+
foreach ($lineErrors as $colErrors) {
4545
foreach ($colErrors as $error) {
4646
$src = $error['source'];
4747
if (isset($sources[$src]) === false) {

src/Reports/VersionControl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
6666

6767
$praiseCache[$author]['bad']++;
6868

69-
foreach ($lineErrors as $column => $colErrors) {
69+
foreach ($lineErrors as $colErrors) {
7070
foreach ($colErrors as $error) {
7171
$authorCache[$author]++;
7272

0 commit comments

Comments
 (0)