diff --git a/src/Driver/XdebugFileDriver.php b/src/Driver/XdebugFileDriver.php new file mode 100644 index 000000000..7e3cfa14b --- /dev/null +++ b/src/Driver/XdebugFileDriver.php @@ -0,0 +1,45 @@ +data = array(); + + foreach(json_decode(file_get_contents($fileName), true) as $key => $value) { + $this->data[str_replace($mapFrom, $mapTo, $key)] = $value; + } + } + + public function canCollectBranchAndPathCoverage(): bool + { + return true; + } + + public function canDetectDeadCode(): bool + { + return true; + } + + public function start(): void + { + } + + public function stop(): RawCodeCoverageData + { + if ($this->collectsBranchAndPathCoverage()) { + return RawCodeCoverageData::fromXdebugWithPathCoverage($this->data); + } + + return RawCodeCoverageData::fromXdebugWithoutPathCoverage($this->data); + } + + public function nameAndVersion(): string + { + return 'Xdebug file driver'; + } +}