Composer updates
This commit is contained in:
13
vendor/spatie/array-to-xml/src/ArrayToXml.php
vendored
13
vendor/spatie/array-to-xml/src/ArrayToXml.php
vendored
@@ -24,7 +24,8 @@ class ArrayToXml
|
||||
string | null $xmlEncoding = null,
|
||||
string $xmlVersion = '1.0',
|
||||
array $domProperties = [],
|
||||
bool | null $xmlStandalone = null
|
||||
bool | null $xmlStandalone = null,
|
||||
bool $addXmlDeclaration = true
|
||||
) {
|
||||
$this->document = new DOMDocument($xmlVersion, $xmlEncoding ?? '');
|
||||
|
||||
@@ -36,6 +37,8 @@ class ArrayToXml
|
||||
$this->setDomProperties($domProperties);
|
||||
}
|
||||
|
||||
$this->addXmlDeclaration = $addXmlDeclaration;
|
||||
|
||||
$this->replaceSpacesByUnderScoresInKeyNames = $replaceSpacesByUnderScoresInKeyNames;
|
||||
|
||||
if (! empty($array) && $this->isArrayAllKeySequential($array)) {
|
||||
@@ -61,7 +64,8 @@ class ArrayToXml
|
||||
string $xmlEncoding = null,
|
||||
string $xmlVersion = '1.0',
|
||||
array $domProperties = [],
|
||||
bool $xmlStandalone = null
|
||||
bool $xmlStandalone = null,
|
||||
bool $addXmlDeclaration = true,
|
||||
): string {
|
||||
$converter = new static(
|
||||
$array,
|
||||
@@ -70,7 +74,8 @@ class ArrayToXml
|
||||
$xmlEncoding,
|
||||
$xmlVersion,
|
||||
$domProperties,
|
||||
$xmlStandalone
|
||||
$xmlStandalone,
|
||||
$addXmlDeclaration
|
||||
);
|
||||
|
||||
return $converter->toXml();
|
||||
@@ -80,7 +85,7 @@ class ArrayToXml
|
||||
{
|
||||
return $this->addXmlDeclaration
|
||||
? $this->document->saveXML()
|
||||
: $this->document->saveXml($this->document->documentElement);
|
||||
: $this->document->saveXML($this->document->documentElement);
|
||||
}
|
||||
|
||||
public function toDom(): DOMDocument
|
||||
|
||||
Reference in New Issue
Block a user