Skip to content

Commit

Permalink
Merge pull request #17 from adrienbrault/fix-cov-format
Browse files Browse the repository at this point in the history
Fix .cov file format
  • Loading branch information
matthiasnoback authored Oct 14, 2020
2 parents 001add5 + 83cc353 commit 315fe66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LiveCodeCoverage/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use DirectoryIterator;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Report\PHP;
use Webmozart\Assert\Assert;

final class Storage
Expand All @@ -25,9 +26,10 @@ public static function storeCodeCoverage(CodeCoverage $coverage, $storageDirecto
}
}

$cov = '<?php return unserialize(' . var_export(serialize($coverage), true) . ');';
$filePath = $storageDirectory . '/' . $name . '.cov';
file_put_contents($filePath, $cov);

$php = new PHP();
$php->process($coverage, $filePath);
}

/**
Expand Down

0 comments on commit 315fe66

Please sign in to comment.