From 7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67 Mon Sep 17 00:00:00 2001 From: Vincent Boon Date: Mon, 16 Dec 2024 13:45:15 +0100 Subject: [PATCH] Allow passing of saveXML options (#235) * Allow passing of saveXML options * Feedback --- src/ArrayToXml.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ArrayToXml.php b/src/ArrayToXml.php index 3c016a4..7853eef 100644 --- a/src/ArrayToXml.php +++ b/src/ArrayToXml.php @@ -90,11 +90,11 @@ public static function convert( return $converter->toXml(); } - public function toXml(): string + public function toXml($options = 0): string { return $this->addXmlDeclaration - ? $this->document->saveXML() - : $this->document->saveXML($this->document->documentElement); + ? $this->document->saveXML(options: $options) + : $this->document->saveXML($this->document->documentElement, $options); } public function toDom(): DOMDocument