diff --git a/helpers/presento.php b/helpers/presento.php index 408569d..626d199 100644 --- a/helpers/presento.php +++ b/helpers/presento.php @@ -53,19 +53,14 @@ function get_from_array($map, string $node) /** * Check given value is multidimensional array * - * @param mixed $arr + * @param mixed $array * @return bool */ - function is_collection($arr) : bool + function is_collection($array) : bool { - if (!is_array($arr)) { - return false; - } - - $first = reset($arr); - //$key = key($first); + if (!is_array($array)) return false; - return isset($first) && is_array($first); + return array_keys($array) === range(0, count($array) - 1); } }