Permalink
Browse files

AbstractGenerator: filter-out non existent files from coverage data

If $source was null, common folder search below resulted to '' and it was converted to CWD by realpath().
  • Loading branch information...
milo committed Sep 11, 2018
1 parent ca80e7b commit 8bd511b1e24f4b1463166016d325c1a978d4693c
Showing with 4 additions and 0 deletions.
  1. +4 βˆ’0 src/CodeCoverage/Generators/AbstractGenerator.php
@@ -51,6 +51,10 @@ public function __construct(string $file, string $source = null)
throw new \Exception("Content of file '$file' is invalid.");
}
$this->data = array_filter($this->data, function (string $path) {
return @is_file($path); // @ some files or wrappers may not exist, i.e. mock://
}, ARRAY_FILTER_USE_KEY);
if (!$source) {
$source = key($this->data);
for ($i = 0; $i < strlen($source); $i++) {

0 comments on commit 8bd511b

Please sign in to comment.