private function PHP_CodeCoverage::performUnintentionallyCoveredCodeCheck in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/php-code-coverage/src/CodeCoverage.php \PHP_CodeCoverage::performUnintentionallyCoveredCodeCheck()
@since Method available since Release 2.0.0
Parameters
array $data:
array $linesToBeCovered:
array $linesToBeUsed:
Throws
PHP_CodeCoverage_Exception_UnintentionallyCoveredCode
1 call to PHP_CodeCoverage::performUnintentionallyCoveredCodeCheck()
- PHP_CodeCoverage::applyCoversAnnotationFilter in vendor/
phpunit/ php-code-coverage/ src/ CodeCoverage.php - Applies the @covers annotation filtering.
File
- vendor/
phpunit/ php-code-coverage/ src/ CodeCoverage.php, line 829
Class
- PHP_CodeCoverage
- Provides collection functionality for PHP code coverage information.
Code
private function performUnintentionallyCoveredCodeCheck(array &$data, array $linesToBeCovered, array $linesToBeUsed) {
$allowedLines = $this
->getAllowedLines($linesToBeCovered, $linesToBeUsed);
$message = '';
foreach ($data as $file => $_data) {
foreach ($_data as $line => $flag) {
if ($flag == 1 && (!isset($allowedLines[$file]) || !isset($allowedLines[$file][$line]))) {
$message .= sprintf('- %s:%d' . PHP_EOL, $file, $line);
}
}
}
if (!empty($message)) {
throw new PHP_CodeCoverage_Exception_UnintentionallyCoveredCode($message);
}
}