Skip to content

Commit 7acceb3

Browse files
Slamdunksebastianbergmann
authored andcommitted
CodeCoverage: process PHP report as first in list to avoid serializing cache data
1 parent 11453a0 commit 7acceb3

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/Runner/CodeCoverage.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,21 @@ public function generateReports(Printer $printer, Configuration $configuration):
205205
return;
206206
}
207207

208+
if ($configuration->hasCoveragePhp()) {
209+
$this->codeCoverageGenerationStart($printer, 'PHP');
210+
211+
try {
212+
$writer = new PhpReport;
213+
$writer->process($this->codeCoverage(), $configuration->coveragePhp());
214+
215+
$this->codeCoverageGenerationSucceeded($printer);
216+
217+
unset($writer);
218+
} catch (CodeCoverageException $e) {
219+
$this->codeCoverageGenerationFailed($printer, $e);
220+
}
221+
}
222+
208223
if ($configuration->hasCoverageClover()) {
209224
$this->codeCoverageGenerationStart($printer, 'Clover XML');
210225

@@ -289,21 +304,6 @@ public function generateReports(Printer $printer, Configuration $configuration):
289304
}
290305
}
291306

292-
if ($configuration->hasCoveragePhp()) {
293-
$this->codeCoverageGenerationStart($printer, 'PHP');
294-
295-
try {
296-
$writer = new PhpReport;
297-
$writer->process($this->codeCoverage(), $configuration->coveragePhp());
298-
299-
$this->codeCoverageGenerationSucceeded($printer);
300-
301-
unset($writer);
302-
} catch (CodeCoverageException $e) {
303-
$this->codeCoverageGenerationFailed($printer, $e);
304-
}
305-
}
306-
307307
if ($configuration->hasCoverageText()) {
308308
$processor = new TextReport(
309309
Thresholds::default(),

0 commit comments

Comments
 (0)