Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 24, 2012
1 parent d6c3466 commit 50d63fe
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions PHP/CodeCoverage.php
Expand Up @@ -491,30 +491,27 @@ protected function applyCoversAnnotationFilter(&$data, $id)

if ($this->checkForUnintentionallyCoveredCode &&
$count != count($data)) {
$unintentionallyCoveredCode = TRUE;
throw new PHP_CodeCoverage_Exception_UnintentionallyCoveredCode;
}

foreach (array_keys($data) as $filename) {
$count = count($data[$filename]);


$data[$filename] = array_intersect_key(
$data[$filename], array_flip($linesToBeCovered[$filename])
);

if ($this->checkForUnintentionallyCoveredCode &&
$count != count($data[$filename])) {
$unintentionallyCoveredCode = TRUE;
throw new PHP_CodeCoverage_Exception_UnintentionallyCoveredCode;
}
}
}

else if ($this->forceCoversAnnotation) {
$data = array();
}

if ($unintentionallyCoveredCode) {
throw new PHP_CodeCoverage_Exception_UnintentionallyCoveredCode;
}
}

/**
Expand Down

0 comments on commit 50d63fe

Please sign in to comment.