Skip to content

Commit df584ec

Browse files
committed
fix
1 parent 04c9f44 commit df584ec

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/Report/Xml/Facade.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,9 @@ final class Facade
4848
private Project $project;
4949
private readonly string $phpUnitVersion;
5050

51-
protected readonly XMLWriter $xmlWriter;
52-
5351
public function __construct(string $version)
5452
{
5553
$this->phpUnitVersion = $version;
56-
$this->xmlWriter = new XMLWriter();
5754
}
5855

5956
/**
@@ -70,9 +67,10 @@ public function process(CodeCoverage $coverage, string $target): void
7067

7168
$report = $coverage->getReport();
7269

73-
$this->xmlWriter->openUri($this->targetFilePath('index'));
70+
$writer = new XMLWriter();
71+
$writer->openUri($this->targetFilePath('index'));
7472
$this->project = new Project(
75-
$this->xmlWriter,
73+
$writer,
7674
$coverage->getReport()->name(),
7775
);
7876

@@ -159,8 +157,9 @@ private function processFile(FileNode $file, Directory $context): void
159157
strlen($this->project->projectSourceDirectory()),
160158
);
161159

162-
$this->xmlWriter->openUri($this->targetFilePath($file->id()));
163-
$fileReport = new Report($this->xmlWriter, $path);
160+
$writer = new XMLWriter();
161+
$writer->openUri($this->targetFilePath($file->id()));
162+
$fileReport = new Report($writer, $path);
164163

165164
$this->setTotals($file, $fileReport->totals());
166165

src/Report/Xml/Project.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public function tests(): Tests
6060
return new Tests($this->xmlWriter);
6161
}
6262

63+
public function getWriter(): XMLWriter {
64+
return $this->xmlWriter;
65+
}
66+
6367
public function finalize(): void
6468
{
6569
$this->xmlWriter->endElement();

0 commit comments

Comments
 (0)