\Teknoo\CurlOptionsInterface

Interface OptionsInterface Interface to define class to manage cUrl's options in a request's context.

Summary

Methods
Constants
isValidOption()
checkOptionValue()
setOptionValue()
setOptionsValuesArray()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

isValidOption()

isValidOption(integer  $option) : boolean

Determine whether or not the value passed is a valid cURL option.

Parameters

integer $option

An Integer Flag

Returns

boolean —

Whether or not the flag is a valid cURL option

checkOptionValue()

checkOptionValue(integer  $option, mixed  $value,   $throw = true) : boolean

Check whether or not the value is a valid type for the given option.

Parameters

integer $option

An integer flag

mixed $value

the value to be set to the integer flag

$throw

Throws

\InvalidArgumentException

if the $option _isnot a valid cURL option

Returns

boolean —

Whether or not the value is of the correct type

setOptionValue()

setOptionValue(resource  $resource, integer  $option, mixed  $value) : boolean

Alias of the curl_setopt function.

Parameters

resource $resource

cUrl resource

integer $option

Option defined in http://php.net/manual/function.curl-setopt.php

mixed $value

Throws

\InvalidArgumentException

if the option does not exist or if it is invalid

Returns

boolean

setOptionsValuesArray()

setOptionsValuesArray(resource  $resource, array  $options) : boolean

Alias of the curl_setopt_array function.

Parameters

resource $resource

curl resource

array $options

defined in http://php.net/manual/function.curl-setopt-array.php

Returns

boolean