Skip to content

Commit

Permalink
Merge pull request #112 from abashurov/master
Browse files Browse the repository at this point in the history
BUGFIX EXTREST-143 Extend already set properties instead of overwriting them
  • Loading branch information
rybalov authored Mar 28, 2022
2 parents 4bef1cd + 0120437 commit 8d45944
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Api/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ private function arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = nul
$el = is_int($key) && $parentEl ? $parentEl : $key;
if (is_array($value)) {
$this->arrayToXml($value, $this->isAssocArray($value) ? $xml->addChild($el) : $xml, $el);
} else {
} elseif(!isset($xml->{$el})) {
$xml->{$el} = (string) $value;
} else {
$xml->{$el}[] = (string) $value;
}
}

Expand Down

0 comments on commit 8d45944

Please sign in to comment.