| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 3 | public function getCoverage(): float |
|
| 53 | 3 | { |
|
| 54 | 3 | $processor = new Processor(); |
|
| 55 | 3 | $result = $processor->run($this->phpUnit . ' --coverage-text|grep Classes|cut -d " " -f 4|cut -d "%" -f 1'); |
|
| 56 | 1 | $output = $result->getStdOut(); |
|
| 57 | if (!$result->isSuccessful() || empty($output)) { |
||
| 58 | 2 | throw new RuntimeException('Error while executing PHPUnit: ' . $result->getStdErr()); |
|
| 59 | } |
||
| 60 | return (float) $output; |
||
| 61 | } |
||
| 63 |