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

Breadcrumb

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

function Facade::processFile

Throws

XmlException

1 call to Facade::processFile()
Facade::processDirectory in vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php

File

vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php, line 131

Class

Facade

Namespace

SebastianBergmann\CodeCoverage\Report\Xml

Code

private function processFile(FileNode $file, Directory $context) : void {
    $fileObject = $context->addFile($file->name(), $file->id() . '.xml');
    $this->setTotals($file, $fileObject->totals());
    $path = substr($file->pathAsString(), strlen($this->project
        ->projectSourceDirectory()));
    $fileReport = new Report($path);
    $this->setTotals($file, $fileReport->totals());
    foreach ($file->classesAndTraits() as $unit) {
        $this->processUnit($unit, $fileReport);
    }
    foreach ($file->functions() as $function) {
        $this->processFunction($function, $fileReport);
    }
    foreach ($file->lineCoverageData() as $line => $tests) {
        if (!is_array($tests) || count($tests) === 0) {
            continue;
        }
        $coverage = $fileReport->lineCoverage((string) $line);
        foreach ($tests as $test) {
            $coverage->addTest($test);
        }
        $coverage->finalize();
    }
    $fileReport->source()
        ->setSourceCode(file_get_contents($file->pathAsString()));
    $this->saveDocument($fileReport->asDom(), $file->id());
}
RSS feed
Powered by Drupal