public function writeMergedResult($output_file) { if (empty($this->files)) { throw new \LogicException('Cannot write merge results, no files given'); } $collector = new CloverXmlCoverageCollector(); foreach ($this->files as $xmlfile) { $collector->collect(simplexml_load_file($xmlfile), '.'); } $this->jsonFile = $collector->getJsonFile(); $this->jsonFile->sortSourceFiles(); return file_put_contents($output_file, $this->jsonFile); }
public function collectCloverXml() { $rootDir = $this->config->getRootDir(); $cloverXmlPaths = $this->config->getCloverXmlPaths(); $xmlCollector = new CloverXmlCoverageCollector(); foreach ($cloverXmlPaths as $cloverXmlPath) { $xml = simplexml_load_file($cloverXmlPath); $xmlCollector->collect($xml, $rootDir); } $this->jsonFile = $xmlCollector->getJsonFile(); if ($this->config->isExcludeNoStatements()) { $this->jsonFile->excludeNoStatementsFiles(); } $this->jsonFile->sortSourceFiles(); return $this; }
protected function collectJsonFileWithoutSourceFiles() { $xml = $this->createNoSourceCloverXml(); $collector = new CloverXmlCoverageCollector(); return $collector->collect($xml, $this->srcDir); }