Skip to content

Commit 2649769

Browse files
staabmsebastianbergmann
authored andcommitted
Refactor: extract targetFilePath() method
1 parent 1be4361 commit 2649769

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Report/Xml/Facade.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,20 @@ private function targetDirectory(): string
277277
return $this->target;
278278
}
279279

280-
/**
281-
* @throws XmlException
282-
*/
283-
private function saveDocument(DOMDocument $document, string $name): void
280+
private function targetFilePath(string $name): string
284281
{
285282
$filename = sprintf('%s/%s.xml', $this->targetDirectory(), $name);
286283

287284
$this->initTargetDirectory(dirname($filename));
288285

289-
Filesystem::write($filename, Xml::asString($document));
286+
return $filename;
287+
}
288+
289+
/**
290+
* @throws XmlException
291+
*/
292+
private function saveDocument(DOMDocument $document, string $name): void
293+
{
294+
Filesystem::write($this->targetFilePath($name), Xml::asString($document));
290295
}
291296
}

0 commit comments

Comments
 (0)