Skip to content

Commit

Permalink
Arrays with single values shouldnt have a null value
Browse files Browse the repository at this point in the history
  • Loading branch information
milos-pejanovic-devtech committed Oct 26, 2016
1 parent 7209ed1 commit 02d4042
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mapper/XmlModelMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ protected function createDomNode(\DOMDocument $domDocument, string $name, $value
*/
protected function mapPropertyByType(ModelPropertyType $propertyType, $value) {
$value = Iteration::typeFilter($value);
if($propertyType->getActualType() === TypeEnum::ARRAY && !is_array($value) ) {
if($propertyType->getActualType() === TypeEnum::ARRAY && !is_array($value) && !is_null($value)) {
$value = [$value];
}

Expand Down

0 comments on commit 02d4042

Please sign in to comment.