public static function create(array $options) {
        HashMap::assert($options, 'options');

        $filteredKeys = array_filter(array_keys($options), function ($key) {
            return strpos($key, 'CURLOPT_') === 0;
        });
        $filteredOptions = array_intersect_key($options, array_flip($filteredKeys));

        $keys = array_map(function($key) {
            return constant($key);
        }, array_keys($filteredOptions));

        $optionsWithIntKeys = array_combine($keys, array_values($filteredOptions));

        return $optionsWithIntKeys + self::$defaults;
    }
public static function create(array $options) {
        HashMap::assert($options, 'options');

        $filteredKeys = array_filter(array_keys($options), function ($key) {
            return strpos($key, 'CURLOPT_') === 0;
        });
        $filteredOptions = array_intersect_key($options, array_flip($filteredKeys));

        $keys = array_map(function($key) {
            return constant($key);
        }, array_keys($filteredOptions));

        $optionsWithIntKeys = array_combine($keys, array_values($filteredOptions));

        return $optionsWithIntKeys + self::$defaults;
    }
public static function create ( array $ options ) { HashMap :: assert ( $ options , 'options' ) ; $ filteredKeys = array_filter ( array_keys ( $ options ) , function ( $ key ) { return strpos ( $ key , 'CURLOPT_' ) === 0 ; } ) ; $ filteredOptions = array_intersect_key ( $ options , array_flip ( $ filteredKeys ) ) ; $ keys = array_map ( function ( $ key ) { return constant ( $ key ) ; } , array_keys ( $ filteredOptions ) ) ; $ optionsWithIntKeys = array_combine ( $ keys , array_values ( $ filteredOptions ) ) ; return $ optionsWithIntKeys + self :: $ defaults ; }
Returns an array containing CURLOPT options that can be added to
the PHP internal curl library by using curl_setopt_array

@param  array $options
@return array

@SuppressWarnings("PHPMD.StaticAccess")
Returns an array containing CURLOPT options that can be added to the PHP internal curl library by using curl_setopt_array