diff --git a/plugin/codecov/src/Internal/Driver/PcovDriver.php b/plugin/codecov/src/Internal/Driver/PcovDriver.php index 6cb67685..9b304320 100644 --- a/plugin/codecov/src/Internal/Driver/PcovDriver.php +++ b/plugin/codecov/src/Internal/Driver/PcovDriver.php @@ -79,7 +79,7 @@ public function collect(): CoverageResult \pcov\clear(); - return CoverageResult::fromRawData($data); + return CoverageResult::fromRawData(PseudoFile::remove($data)); } #[\Override] diff --git a/plugin/codecov/src/Internal/Driver/PseudoFile.php b/plugin/codecov/src/Internal/Driver/PseudoFile.php new file mode 100644 index 00000000..426d3e69 --- /dev/null +++ b/plugin/codecov/src/Internal/Driver/PseudoFile.php @@ -0,0 +1,62 @@ + $data Raw coverage keyed by file path. + * @return array + */ + public static function remove(array $data): array + { + return \array_filter($data, static fn(string $path): bool => !self::is($path), \ARRAY_FILTER_USE_KEY); + } +} diff --git a/plugin/codecov/src/Internal/Driver/XdebugDriver.php b/plugin/codecov/src/Internal/Driver/XdebugDriver.php index 92174248..b43b7192 100644 --- a/plugin/codecov/src/Internal/Driver/XdebugDriver.php +++ b/plugin/codecov/src/Internal/Driver/XdebugDriver.php @@ -106,7 +106,7 @@ public function collect(): CoverageResult } } - return CoverageResult::fromRawData($data); + return CoverageResult::fromRawData(PseudoFile::remove($data)); } #[\Override]