Skip to content

Commit 0eaf246

Browse files
processUncoveredFilesFromWhitelist only if source file will not couse fatals;
1 parent 8e762f2 commit 0eaf246

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

PHP/CodeCoverage.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,13 @@ protected function addUncoveredFilesFromWhitelist()
523523
if (!file_exists($uncoveredFile)) {
524524
continue;
525525
}
526-
527-
if ($this->processUncoveredFilesFromWhitelist) {
526+
$error = false;
527+
$classes = array();
528+
$canIncludeFile = PHP_CodeCoverage_Util::canIncludeFile($uncoveredFile, array(
529+
'define',
530+
'includeOnce',
531+
), $classes, $error);
532+
if ($canIncludeFile && $this->processUncoveredFilesFromWhitelist) {
528533
$this->processUncoveredFileFromWhitelist(
529534
$uncoveredFile, $data, $uncoveredFiles
530535
);

0 commit comments

Comments
 (0)