Skip to content

Commit 8866c89

Browse files
author
Rob Caiger
committed
Moved the check for ignored lines to initData
1 parent 71b3eae commit 8866c89

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

src/CodeCoverage.php

+4-19
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ public function append(array $data, $id = null, $append = true, $linesToBeCovere
280280
}
281281

282282
$this->applyListsFilter($data);
283-
$this->applyIgnoredLinesFilter($data);
284283
$this->initializeFilesThatAreSeenTheFirstTime($data);
285284

286285
if (!$append) {
@@ -535,24 +534,6 @@ private function applyListsFilter(array &$data)
535534
}
536535
}
537536

538-
/**
539-
* Applies the "ignored lines" filtering.
540-
*
541-
* @param array $data
542-
*/
543-
private function applyIgnoredLinesFilter(array &$data)
544-
{
545-
foreach (array_keys($data) as $filename) {
546-
if (!$this->filter->isFile($filename)) {
547-
continue;
548-
}
549-
550-
foreach ($this->getLinesToBeIgnored($filename) as $line) {
551-
unset($data[$filename][$line]);
552-
}
553-
}
554-
}
555-
556537
/**
557538
* @param array $data
558539
* @since Method available since Release 1.1.0
@@ -869,6 +850,10 @@ private function initData()
869850
include_once($file);
870851
$data = $this->driver->stop();
871852

853+
foreach ($this->getLinesToBeIgnored($file) as $line) {
854+
unset($data[$file][$line]);
855+
}
856+
872857
$this->initializeFilesThatAreSeenTheFirstTime($data);
873858
}
874859

0 commit comments

Comments
 (0)