summaryrefslogtreecommitdiff
path: root/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-12-02 17:45:25 +0300
committerAndrew Dolgov <[email protected]>2023-12-02 18:03:06 +0300
commit09898ccbc87b5e297bcfab4527a3705bd3b4d5a4 (patch)
treeebb1e6ebe21782f4c1a757a00af1316ca645b69e /vendor/phpunit/php-code-coverage/src/CodeCoverage.php
parent2b8e34453234b8b31ebc9e7020f8677bf3889898 (diff)
add phpunit code coverage driver
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
);
}