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

Breadcrumb

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

function RawCodeCoverageData::keepFunctionCoverageDataOnlyForLines

Parameters

int[] $lines:

File

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

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 keepFunctionCoverageDataOnlyForLines(string $filename, array $lines) : void {
    if (!isset($this->functionCoverage[$filename])) {
        return;
    }
    foreach ($this->functionCoverage[$filename] as $functionName => $functionData) {
        foreach ($functionData['branches'] as $branchId => $branch) {
            if (count(array_diff(range($branch['line_start'], $branch['line_end']), $lines)) > 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