Skip to content

Commit fb05f1e

Browse files
staabmsebastianbergmann
authored andcommitted
Simplify applyFilter()
1 parent 493476e commit fb05f1e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/CodeCoverage.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,17 +414,14 @@ private function applyCoversAndUsesFilter(RawCodeCoverageData $rawData, array|fa
414414

415415
private function applyFilter(RawCodeCoverageData $data): void
416416
{
417-
if ($this->filter->isEmpty()) {
418-
$data->skipEmptyLines();
419-
420-
return;
421-
}
422-
423-
foreach (array_keys($data->lineCoverage()) as $filename) {
424-
if ($this->filter->isExcluded($filename)) {
425-
$data->removeCoverageDataForFile($filename);
417+
if (!$this->filter->isEmpty()) {
418+
foreach (array_keys($data->lineCoverage()) as $filename) {
419+
if ($this->filter->isExcluded($filename)) {
420+
$data->removeCoverageDataForFile($filename);
421+
}
426422
}
427423
}
424+
428425
$data->skipEmptyLines();
429426
}
430427

0 commit comments

Comments
 (0)