| Conditions | 4 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function output($coverage, $percent, $minimumPercent) |
||
| 10 | { |
||
| 11 | $violations = []; |
||
| 12 | foreach ($coverage as $file => $lines) { |
||
| 13 | foreach ($lines as $line => $error) { |
||
| 14 | $violations[$file][] = (object) [ |
||
| 15 | 'lineNumber' => $line, |
||
| 16 | 'message' => $error |
||
| 17 | ]; |
||
| 18 | } |
||
| 19 | } |
||
| 20 | $output = (object) [ |
||
| 21 | 'coverage' => number_format($percent, 2), |
||
| 22 | 'status' => $percent > $minimumPercent ? |
||
| 23 | 'Passed': |
||
| 24 | 'Failed', |
||
| 25 | 'violations' => $violations |
||
| 26 | ]; |
||
| 27 | echo json_encode($output); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |