Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CodeCoverage.php

function CodeCoverage::performUnintentionallyCoveredCodeCheck

Throws

ReflectionException

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\CodeCoverage

Code

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);
    }
}
RSS feed
Powered by Drupal