public function setOption($option, $value = null)
    {
        if (is_array($option)) { // If it's an array, loop through each option and call this method recursively.
            foreach ($option as $opt => $val) {
                $this->setOption($opt, $val);
            }
            return;
        }

        if (array_key_exists($option, $this->defaults)) { // If it is a default value.
            throw new ProtectedOptionException(sprintf('Unable to set protected option #%u', $option));
        }

        if (curl_setopt($this->handle, $option, $value) === false) {
            throw new CurlErrorException(sprintf('Couldn\'t set option #%u', $option));
        }
    }
public function setOption($option, $value = null)
    {
        if (is_array($option)) { // If it's an array, loop through each option and call this method recursively.
            foreach ($option as $opt => $val) {
                $this->setOption($opt, $val);
            }
            return;
        }

        if (array_key_exists($option, $this->defaults)) { // If it is a default value.
            throw new ProtectedOptionException(sprintf('Unable to set protected option #%u', $option));
        }

        if (curl_setopt($this->handle, $option, $value) === false) {
            throw new CurlErrorException(sprintf('Couldn\'t set option #%u', $option));
        }
    }
public function setOption ( $ option , $ value = null ) { if ( is_array ( $ option ) ) { // If it's an array, loop through each option and call this method recursively. foreach ( $ option as $ opt => $ val ) { $ this -> setOption ( $ opt , $ val ) ; } return ; } if ( array_key_exists ( $ option , $ this -> defaults ) ) { // If it is a default value. throw new ProtectedOptionException ( sprintf ( 'Unable to set protected option #%u' , $ option ) ) ; } if ( curl_setopt ( $ this -> handle , $ option , $ value ) === false ) { throw new CurlErrorException ( sprintf ( 'Couldn\'t set option #%u' , $ option ) ) ; } }
Set an option for the request.

@param  mixed            $option
@param  mixed            $value  null
@return RequestInterface
Set an option for the request .