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

Breadcrumb

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

function Facade::process

Same name in this branch
  1. 11.1.x vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php \SebastianBergmann\CodeCoverage\Report\Xml\Facade::process()

File

vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php, line 42

Class

Facade

Namespace

SebastianBergmann\CodeCoverage\Report\Html

Code

public function process(CodeCoverage $coverage, string $target) : void {
    $target = $this->directory($target);
    $report = $coverage->getReport();
    $date = date('D M j G:i:s T Y');
    $dashboard = new Dashboard($this->templatePath, $this->generator, $date, $this->thresholds, $coverage->collectsBranchAndPathCoverage());
    $directory = new Directory($this->templatePath, $this->generator, $date, $this->thresholds, $coverage->collectsBranchAndPathCoverage());
    $file = new File($this->templatePath, $this->generator, $date, $this->thresholds, $coverage->collectsBranchAndPathCoverage());
    $directory->render($report, $target . 'index.html');
    $dashboard->render($report, $target . 'dashboard.html');
    foreach ($report as $node) {
        $id = $node->id();
        if ($node instanceof DirectoryNode) {
            Filesystem::createDirectory($target . $id);
            $directory->render($node, $target . $id . '/index.html');
            $dashboard->render($node, $target . $id . '/dashboard.html');
        }
        else {
            $dir = dirname($target . $id);
            Filesystem::createDirectory($dir);
            $file->render($node, $target . $id);
        }
    }
    $this->copyFiles($target);
    $this->renderCss($target);
}
RSS feed
Powered by Drupal