function WarmCodeCoverageCacheCommand::execute
Throws
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\CommandCode
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();
}