/** * @param AbstractParaunitProcess $process * @return CodeCoverage */ public function fetch(AbstractParaunitProcess $process) { $tempFilename = $this->tempFilenameFactory->getFilenameForCoverage($process->getUniqueId()); $codeCoverage = null; if ($this->coverageFileIsValid($tempFilename)) { $codeCoverage = (require $tempFilename); unlink($tempFilename); } if ($codeCoverage instanceof CodeCoverage) { return $codeCoverage; } return new CodeCoverage(); }
/** * @param AbstractParaunitProcess $process * @throws \RuntimeException */ protected function markProcessCompleted(AbstractParaunitProcess $process) { $pHash = $process->getUniqueId(); if (array_key_exists($pHash, $this->processRunning)) { unset($this->processRunning[$pHash]); } else { throw new \RuntimeException('Trying to remove a non-existing process from running stack\\! ID: ' . $pHash); } if ($process->isToBeRetried()) { $process->reset(); $process->increaseRetryCount(); $this->processStack[$pHash] = $process; } else { $this->processCompleted[$pHash] = $process; } }