Skip to content

Commit

Permalink
Allow passing of saveXML options (#235)
Browse files Browse the repository at this point in the history
* Allow passing of saveXML options

* Feedback
  • Loading branch information
VincentBean authored Dec 16, 2024
1 parent 4a5aa67 commit 7dcfc67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ArrayToXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7dcfc67

Please sign in to comment.