diff --git a/src/Report/Xml/Facade.php b/src/Report/Xml/Facade.php index 857423922..c3767088e 100644 --- a/src/Report/Xml/Facade.php +++ b/src/Report/Xml/Facade.php @@ -277,15 +277,20 @@ private function targetDirectory(): string return $this->target; } - /** - * @throws XmlException - */ - private function saveDocument(DOMDocument $document, string $name): void + private function targetFilePath(string $name): string { $filename = sprintf('%s/%s.xml', $this->targetDirectory(), $name); $this->initTargetDirectory(dirname($filename)); - Filesystem::write($filename, Xml::asString($document)); + return $filename; + } + + /** + * @throws XmlException + */ + private function saveDocument(DOMDocument $document, string $name): void + { + Filesystem::write($this->targetFilePath($name), Xml::asString($document)); } }