From a9a3ad38d44f2336206c91b18360f66614b57337 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Fri, 17 Dec 2021 20:25:09 +0100 Subject: [PATCH] [BUGFIX] ArrayUrility: Return empty object if array is empty --- Classes/Utility/ArrayUtility.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Utility/ArrayUtility.php b/Classes/Utility/ArrayUtility.php index f43c961..26fd0da 100644 --- a/Classes/Utility/ArrayUtility.php +++ b/Classes/Utility/ArrayUtility.php @@ -21,6 +21,9 @@ class ArrayUtility * function arrayTobject */ public static function toObject($array) { + if ($array === []) { + return (object)$array; + } if (is_array($array)) { if (self::isAssoc($array)) { return (object) array_map([__CLASS__, __METHOD__], $array); @@ -50,7 +53,6 @@ class ArrayUtility return $array; } - /** * */