Skip to content

Commit

Permalink
CodeCoverage: process PHP report as first in list to avoid serializin…
Browse files Browse the repository at this point in the history
…g cache data
  • Loading branch information
Slamdunk authored and sebastianbergmann committed Sep 12, 2023
1 parent 11453a0 commit 7acceb3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Runner/CodeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,21 @@ public function generateReports(Printer $printer, Configuration $configuration):
return;
}

if ($configuration->hasCoveragePhp()) {
$this->codeCoverageGenerationStart($printer, 'PHP');

try {
$writer = new PhpReport;
$writer->process($this->codeCoverage(), $configuration->coveragePhp());

$this->codeCoverageGenerationSucceeded($printer);

unset($writer);
} catch (CodeCoverageException $e) {
$this->codeCoverageGenerationFailed($printer, $e);
}
}

if ($configuration->hasCoverageClover()) {
$this->codeCoverageGenerationStart($printer, 'Clover XML');

Expand Down Expand Up @@ -289,21 +304,6 @@ public function generateReports(Printer $printer, Configuration $configuration):
}
}

if ($configuration->hasCoveragePhp()) {
$this->codeCoverageGenerationStart($printer, 'PHP');

try {
$writer = new PhpReport;
$writer->process($this->codeCoverage(), $configuration->coveragePhp());

$this->codeCoverageGenerationSucceeded($printer);

unset($writer);
} catch (CodeCoverageException $e) {
$this->codeCoverageGenerationFailed($printer, $e);
}
}

if ($configuration->hasCoverageText()) {
$processor = new TextReport(
Thresholds::default(),
Expand Down

0 comments on commit 7acceb3

Please sign in to comment.