function CodeCoverage::performUnintentionallyCoveredCodeCheck
Throws
UnintentionallyCoveredCodeException
1 call to CodeCoverage::performUnintentionallyCoveredCodeCheck()
- CodeCoverage::applyCoversAndUsesFilter in vendor/
phpunit/ php-code-coverage/ src/ CodeCoverage.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ CodeCoverage.php, line 501
Class
- CodeCoverage
- Provides collection functionality for PHP code coverage information.
Namespace
SebastianBergmann\CodeCoverageCode
private function performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $data, array $linesToBeCovered, array $linesToBeUsed) : void {
$allowedLines = $this->getAllowedLines($linesToBeCovered, $linesToBeUsed);
$unintentionallyCoveredUnits = [];
foreach ($data->lineCoverage() as $file => $_data) {
foreach ($_data as $line => $flag) {
if ($flag === 1 && !isset($allowedLines[$file][$line])) {
$unintentionallyCoveredUnits[] = $this->wizard
->lookup($file, $line);
}
}
}
$unintentionallyCoveredUnits = $this->processUnintentionallyCoveredUnits($unintentionallyCoveredUnits);
if (!empty($unintentionallyCoveredUnits)) {
throw new UnintentionallyCoveredCodeException($unintentionallyCoveredUnits);
}
}