Skip to content

Commit e9fa52c

Browse files
Rename loop variables for clarity and consistency
Updated variable names in JsonPrinter to improve readability and better reflect their purpose. This change enhances the maintainability of the code without modifying functionality.
1 parent 6e3c3da commit e9fa52c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Printer/JsonPrinter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ public function print(array $violationsCollection): string
1616
* @var string $key
1717
* @var Violation[] $violationsByFqcn
1818
*/
19-
foreach ($violationsCollection as $key => $violationsByFqcn) {
19+
foreach ($violationsCollection as $class => $violationsByFqcn) {
2020
$violationForThisFqcn = \count($violationsByFqcn);
2121
$totalViolations += $violationForThisFqcn;
2222

23-
$details[$key] = [];
23+
$details[$class] = [];
2424

25-
foreach ($violationsByFqcn as $kv => $violation) {
26-
$details[$key][$kv]['error'] = $violation->getError();
25+
foreach ($violationsByFqcn as $key => $violation) {
26+
$details[$class][$key]['error'] = $violation->getError();
2727

2828
if (null !== $violation->getLine()) {
29-
$details[$key][$kv]['line'] = $violation->getLine();
29+
$details[$class][$key]['line'] = $violation->getLine();
3030
}
3131
}
3232
}

0 commit comments

Comments
 (0)