summaryrefslogtreecommitdiff
path: root/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/phpunit/php-code-coverage/src/CodeCoverage.php')
-rw-r--r--vendor/phpunit/php-code-coverage/src/CodeCoverage.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
index c53d602c8..c35f27c8c 100644
--- a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
+++ b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
@@ -20,7 +20,6 @@ use function count;
use function explode;
use function get_class;
use function is_array;
-use function is_file;
use function sort;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\PhptTestCase;
@@ -77,7 +76,7 @@ final class CodeCoverage
private $ignoreDeprecatedCode = false;
/**
- * @var PhptTestCase|string|TestCase
+ * @var null|PhptTestCase|string|TestCase
*/
private $currentId;
@@ -486,9 +485,16 @@ final class CodeCoverage
continue;
}
+ $linesToBranchMap = $this->analyser()->executableLinesIn($filename);
+
$data->keepLineCoverageDataOnlyForLines(
$filename,
- $this->analyser()->executableLinesIn($filename)
+ array_keys($linesToBranchMap)
+ );
+
+ $data->markExecutableLineByBranch(
+ $filename,
+ $linesToBranchMap
);
}
}
@@ -518,7 +524,7 @@ final class CodeCoverage
);
foreach ($uncoveredFiles as $uncoveredFile) {
- if (is_file($uncoveredFile)) {
+ if ($this->filter->isFile($uncoveredFile)) {
$this->append(
RawCodeCoverageData::fromUncoveredFile(
$uncoveredFile,
@@ -543,7 +549,7 @@ final class CodeCoverage
$this->driver->start();
foreach ($uncoveredFiles as $uncoveredFile) {
- if (is_file($uncoveredFile)) {
+ if ($this->filter->isFile($uncoveredFile)) {
include_once $uncoveredFile;
}
}
@@ -644,7 +650,7 @@ final class CodeCoverage
} catch (\ReflectionException $e) {
throw new ReflectionException(
$e->getMessage(),
- (int) $e->getCode(),
+ $e->getCode(),
$e
);
}