From 02d40422eab478b2991bb5d39d6da80ac8843db6 Mon Sep 17 00:00:00 2001 From: milos-pejanovic-devtech Date: Wed, 26 Oct 2016 10:46:19 +0200 Subject: [PATCH] Arrays with single values shouldnt have a null value --- src/Mapper/XmlModelMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mapper/XmlModelMapper.php b/src/Mapper/XmlModelMapper.php index 7df5401..80bdec9 100644 --- a/src/Mapper/XmlModelMapper.php +++ b/src/Mapper/XmlModelMapper.php @@ -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]; }