Stripe\Util\Util::isList PHP Method

isList() public static method

Whether the provided array (or other) is a list rather than a dictionary.
public static isList ( array | mixed $array ) : boolean
$array array | mixed
return boolean True if the given object is a list.
    public static function isList($array)
    {
        if (!is_array($array)) {
            return false;
        }
        // TODO: generally incorrect, but it's correct given Stripe's response
        foreach (array_keys($array) as $k) {
            if (!is_numeric($k)) {
                return false;
            }
        }
        return true;
    }