From 7f98c3028109c361ca68e445690b4f05be3cedf1 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sat, 24 Dec 2022 13:11:38 -0400 Subject: [PATCH] Backport changes from spatie/array-to-xml#204 --- src/ArrayToXml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArrayToXml.php b/src/ArrayToXml.php index 8eba571..4a0a457 100644 --- a/src/ArrayToXml.php +++ b/src/ArrayToXml.php @@ -241,7 +241,7 @@ protected function isArrayAllKeySequential($value) protected function addAttributes(DOMElement $element, array $data) { foreach ($data as $attrKey => $attrVal) { - $element->setAttribute($attrKey, $attrVal); + $element->setAttribute($attrKey, $attrVal ?? ''); } }