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

Breadcrumb

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

function RawCodeCoverageData::removeCoverageDataForLines

Parameters

int[] $lines:

File

vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php, line 214

Class

RawCodeCoverageData
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage

Namespace

SebastianBergmann\CodeCoverage\Data

Code

public function removeCoverageDataForLines(string $filename, array $lines) : void {
    if (empty($lines)) {
        return;
    }
    if (!isset($this->lineCoverage[$filename])) {
        return;
    }
    $this->lineCoverage[$filename] = array_diff_key($this->lineCoverage[$filename], array_flip($lines));
    if (isset($this->functionCoverage[$filename])) {
        foreach ($this->functionCoverage[$filename] as $functionName => $functionData) {
            foreach ($functionData['branches'] as $branchId => $branch) {
                if (count(array_intersect($lines, range($branch['line_start'], $branch['line_end']))) > 0) {
                    unset($this->functionCoverage[$filename][$functionName]['branches'][$branchId]);
                    foreach ($functionData['paths'] as $pathId => $path) {
                        if (in_array($branchId, $path['path'], true)) {
                            unset($this->functionCoverage[$filename][$functionName]['paths'][$pathId]);
                        }
                    }
                }
            }
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal