You are here

private function PHP_CodeCoverage_Driver_PHPDBG::detectExecutedLines in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/PHPDBG.php \PHP_CodeCoverage_Driver_PHPDBG::detectExecutedLines()

Convert phpdbg based data into the format CodeCoverage expects

Parameters

array $sourceLines:

array $dbgData:

Return value

array

1 call to PHP_CodeCoverage_Driver_PHPDBG::detectExecutedLines()
PHP_CodeCoverage_Driver_PHPDBG::stop in vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/PHPDBG.php
Stop collection of code coverage information.

File

vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/PHPDBG.php, line 91

Class

PHP_CodeCoverage_Driver_PHPDBG
Driver for PHPDBG's code coverage functionality.

Code

private function detectExecutedLines(array $sourceLines, array $dbgData) {
  foreach ($dbgData as $file => $coveredLines) {
    foreach ($coveredLines as $lineNo => $numExecuted) {

      // phpdbg also reports $lineNo=0 when e.g. exceptions get thrown.
      // make sure we only mark lines executed which are actually executable.
      if (isset($sourceLines[$file][$lineNo])) {
        $sourceLines[$file][$lineNo] = self::LINE_EXECUTED;
      }
    }
  }
  return $sourceLines;
}