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

Breadcrumb

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

function PHP::process

File

vendor/phpunit/php-code-coverage/src/Report/PHP.php, line 22

Class

PHP

Namespace

SebastianBergmann\CodeCoverage\Report

Code

public function process(CodeCoverage $coverage, ?string $target = null) : string {
    $coverage->clearCache();
    $buffer = "<?php\nreturn \\unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'" . PHP_EOL . serialize($coverage) . PHP_EOL . 'END_OF_COVERAGE_SERIALIZATION' . PHP_EOL . ');';
    if ($target !== null) {
        if (!str_contains($target, '://')) {
            Filesystem::createDirectory(dirname($target));
        }
        if (@file_put_contents($target, $buffer) === false) {
            throw new WriteOperationFailedException($target);
        }
    }
    return $buffer;
}
RSS feed
Powered by Drupal