[BUGFIX] ArrayUrility: Return empty object if array is empty
This commit is contained in:
parent
47415deeac
commit
a9a3ad38d4
@ -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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user