| Total Complexity | 9 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 16 | final class Collector |
||
| 17 | { |
||
| 18 | /** @var ICodeCoverageEngine[] */ |
||
| 19 | private array $engines = []; |
||
| 20 | private ?ICodeCoverageEngine $currentEngine = null; |
||
| 21 | |||
| 22 | 1 | public function registerEngine(ICodeCoverageEngine $engine): void |
|
| 23 | { |
||
| 24 | 1 | $this->engines[] = $engine; |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @throws Exception |
||
| 29 | */ |
||
| 30 | 1 | public function start(): void |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @throws Exception |
||
| 38 | */ |
||
| 39 | 1 | public function finish(): array |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @throws Exception |
||
| 49 | */ |
||
| 50 | 1 | public function getEngineName(): string |
|
| 51 | { |
||
| 52 | 1 | $engine = $this->selectEngine(); |
|
| 53 | 1 | return $engine->getName(); |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @throws Exception |
||
| 58 | */ |
||
| 59 | 1 | private function selectEngine(): ICodeCoverageEngine |
|
| 71 | } |
||
| 72 | } |
||
| 73 |