Skip to content

Commit

Permalink
Merge branch '9.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 30, 2020
2 parents 57a18f5 + a9f5c06 commit fab8e5c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Runner/PhptTestCase.php
Expand Up @@ -19,6 +19,7 @@
use function explode;
use function extension_loaded;
use function file;
use function file_exists;
use function file_get_contents;
use function file_put_contents;
use function is_array;
Expand Down Expand Up @@ -635,17 +636,19 @@ private function renderForCoverage(string &$job, bool $pathCoverage): void

private function cleanupForCoverage(): RawCodeCoverageData
{
$files = $this->getCoverageFiles();
$buffer = @file_get_contents($files['coverage']);
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
$files = $this->getCoverageFiles();

if ($buffer === false) {
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
} else {
$coverage = @unserialize($buffer);
}
if (file_exists($files['coverage'])) {
$buffer = @file_get_contents($files['coverage']);

if ($buffer !== false) {
$coverage = @unserialize($buffer);

if ($coverage === false) {
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
if ($coverage === false) {
$coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
}
}
}

foreach ($files as $file) {
Expand Down

0 comments on commit fab8e5c

Please sign in to comment.