Skip to content

Commit b45fa0f

Browse files
pepovoker1
authored andcommitted
skip phar archives, to avoid mysterious empty reports
1 parent b62faf9 commit b45fa0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PHP/CodeCoverage.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ public function getSummary()
351351

352352
foreach ($this->data as $test => $coverage) {
353353
foreach ($coverage['filtered'] as $file => $lines) {
354+
if (strncmp($file, 'phar://', 7) === 0) {
355+
continue;
356+
}
354357
foreach ($lines as $line => $flag) {
355358
if ($flag == 1) {
356359
if (!isset($this->summary[$file][$line][0])) {
@@ -371,6 +374,9 @@ public function getSummary()
371374
}
372375

373376
foreach ($coverage['raw'] as $file => $lines) {
377+
if (strncmp($file, 'phar://', 7) === 0) {
378+
continue;
379+
}
374380
foreach ($lines as $line => $flag) {
375381
if ($flag != 1 &&
376382
!isset($this->summary[$file][$line][0])) {

0 commit comments

Comments
 (0)