src/Cloudinary.php
private static function build_array_of_assoc_arrays($value)
    {
        if (is_string($value)) {
            $value = Cloudinary::json_decode_cb($value, 'Cloudinary::ensure_assoc');
            if (is_null($value)) {
                throw new InvalidArgumentException("Failed parsing JSON string value");
            }
        }
        $value = Cloudinary::build_array($value);
        if (!self::is_array_of_assoc($value)) {
            throw new InvalidArgumentException("Expected an array of associative arrays");
        }
        return $value;
    }
private static function build_array_of_assoc_arrays($value)
    {
        if (is_string($value)) {
            $value = Cloudinary::json_decode_cb($value, 'Cloudinary::ensure_assoc');
            if (is_null($value)) {
                throw new InvalidArgumentException("Failed parsing JSON string value");
            }
        }
        $value = Cloudinary::build_array($value);
        if (!self::is_array_of_assoc($value)) {
            throw new InvalidArgumentException("Expected an array of associative arrays");
        }
        return $value;
    }
private static function build_array_of_assoc_arrays ( $ value ) { if ( is_string ( $ value ) ) { $ value = Cloudinary :: json_decode_cb ( $ value , 'Cloudinary::ensure_assoc' ) ; if ( is_null ( $ value ) ) { throw new InvalidArgumentException ( "Failed parsing JSON string value" ) ; } } $ value = Cloudinary :: build_array ( $ value ) ; if ( ! self :: is_array_of_assoc ( $ value ) ) { throw new InvalidArgumentException ( "Expected an array of associative arrays" ) ; } return $ value ; }
Converts a value that can be presented as an array of associative arrays.

In case top level item is not an array, it is wrapped with an array

@param array|string  $value  The value to be converted

Valid values examples:
- Valid assoc array: array("k" => "v", "k2"=> "v2")
- Array of assoc arrays: array(array("k" => "v"), array("k2" =>"v2"))
- JSON decodable string: '{"k": "v"}', or '[{"k": "v"}]'

Invalid values examples:
- array("not", "an", "assoc", "array")
- array(123, None),
- array(array("another", "array"))

@return array|mixed Converted(or original) array of associative arrays

@throws InvalidArgumentException in case value cannot be converted to an array of associative arrays
Converts a value that can be presented as an array of associative arrays .