Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function getCoverage(): float |
||
17 | { |
||
18 | $regexp = '/(Classes|Methods|Lines)\:\s+[\d]+\.[\d]+%\s+\(([\d]+)\/([\d]+)\)/m'; |
||
19 | preg_match_all($regexp, $this->report, $matches); |
||
20 | |||
21 | $totals = 0; |
||
22 | foreach ($matches[2] as $index => $metrics) { |
||
23 | $totals += $metrics / $matches[3][$index]; |
||
24 | } |
||
25 | |||
26 | return $totals / count($matches[2]) * 100; |
||
27 | } |
||
36 |