[BUGFIX] ArrayUrility: Return empty object if array is empty

This commit is contained in:
Philipp Dieter 2021-12-17 20:25:09 +01:00
parent 47415deeac
commit a9a3ad38d4

View File

@ -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;
}
/**
*
*/