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

Breadcrumb

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

function WarmCodeCoverageCacheCommand::execute

Throws

NoActiveTimerException

NoCoverageCacheDirectoryException

Overrides Command::execute

File

vendor/phpunit/phpunit/src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php, line 43

Class

WarmCodeCoverageCacheCommand
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\TextUI\Command

Code

public function execute() : Result {
    if (!$this->configuration
        ->hasCoverageCacheDirectory()) {
        return Result::from('Cache for static analysis has not been configured' . PHP_EOL, Result::FAILURE);
    }
    $this->codeCoverageFilterRegistry
        ->init($this->configuration, true);
    if (!$this->codeCoverageFilterRegistry
        ->configured()) {
        return Result::from('Filter for code coverage has not been configured' . PHP_EOL, Result::FAILURE);
    }
    $timer = new Timer();
    $timer->start();
    print 'Warming cache for static analysis ... ';
    (new CacheWarmer())->warmCache($this->configuration
        ->coverageCacheDirectory(), !$this->configuration
        ->disableCodeCoverageIgnore(), $this->configuration
        ->ignoreDeprecatedCodeUnitsFromCodeCoverage(), $this->codeCoverageFilterRegistry
        ->get());
    printf('[%s]%s', $timer->stop()
        ->asString(), PHP_EOL);
    return Result::from();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal