Skip to content

Commit 838533f

Browse files
Merge branch 'master' into report-refactoring
2 parents feb7b00 + 5b52d75 commit 838533f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

PHP/CodeCoverage.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,36 @@ protected function processUncoveredFilesFromWhitelist()
534534
);
535535

536536
foreach ($uncoveredFiles as $uncoveredFile) {
537+
$tokens = PHP_Token_Stream_CachingFactory::get($uncoveredFile);
538+
$classes = $tokens->getClasses();
539+
$interfaces = $tokens->getInterfaces();
540+
$functions = $tokens->getFunctions();
541+
unset($tokens);
542+
543+
foreach (array_keys($classes) as $class) {
544+
if (class_exists($class, FALSE)) {
545+
continue 2;
546+
}
547+
}
548+
549+
unset($classes);
550+
551+
foreach (array_keys($interfaces) as $interface) {
552+
if (interface_exists($interface, FALSE)) {
553+
continue 2;
554+
}
555+
}
556+
557+
unset($interfaces);
558+
559+
foreach (array_keys($functions) as $function) {
560+
if (function_exists($function)) {
561+
continue 2;
562+
}
563+
}
564+
565+
unset($functions);
566+
537567
$this->driver->start();
538568
include_once $uncoveredFile;
539569
$coverage = $this->driver->stop();

0 commit comments

Comments
 (0)