public function PHP_CodeCoverage::merge

Merges the data from another instance of PHP_CodeCoverage.

Parameters

PHP_CodeCoverage $that:

File

drupal/core/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php, line 323

Class

PHP_CodeCoverage
Provides collection functionality for PHP code coverage information.

Code

public function merge(PHP_CodeCoverage $that) {
  foreach ($that->data as $file => $lines) {
    if (!isset($this->data[$file])) {
      if (!$this->filter
        ->isFiltered($file)) {
        $this->data[$file] = $lines;
      }
      continue;
    }
    foreach ($lines as $line => $data) {
      if ($data !== NULL) {
        if (!isset($this->data[$file][$line])) {
          $this->data[$file][$line] = $data;
        }
        else {
          $this->data[$file][$line] = array_unique(array_merge($this->data[$file][$line], $data));
        }
      }
    }
  }
  $this->tests = array_merge($this->tests, $that
    ->getTests());
}