Option

@param string $options
@param mixed  $value

@return CURL
333225
public function option(String $options, $value) : CURL
    {
        $this->options[Helper::toConstant($options, 'CURLOPT_')] = $value;

        return $this;
    }
414511
public function setOption($option, $value)
    {
        if ($this->suppressErrors) {
            return @ldap_set_option($this->getConnection(), $option, $value);
        }

        return ldap_set_option($this->getConnection(), $option, $value);
    }
1039336
public function setCurlOption($option, $value)
        {
            curl_setopt($this->ch, $option, $value);

            $this->curl_options[$option] = $value;

            return $this;
        }
797044
public function setOption($option, $value = '')
    {
        if (is_array($option)) {
            foreach ($option as $key => $value) {
                $this->options[$key] = $value;
            }
        }
        else {
            $this->options[$option] = $value;
        }

        return $this;
    }
422314
public function asImage($value, $options = [])
    {
        if ($value === null) {
            return $this->getNullDisplay();
        }

        return Html::img($value, $options);
    }
1346938
public static function encodeJson($value, int $options = JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION): string
    {
        return \json_encode($value, $options);
    }
598634
public function setCurlOption($option, $value)
    {
        $this->debug("setCurlOption option=$option, value=");
        $this->appendDebug($this->varDump($value));
        curl_setopt($this->ch, $option, $value);
    }
352549
public function filter($value, $options = [])
    {
        $value    = (string) $value;
        $filtered = htmlentities(
            $value,
            $this->getQuoteStyle(),
            $this->getEncoding(),
            $this->getDoubleQuote()
        );

        if (strlen($value) && !strlen($filtered)) {
            if (!function_exists('iconv')) {
                $ex = new \Exception('Encoding mismatch has resulted in htmlentities errors.');
                throw $ex;
            }

            $enc      = $this->getEncoding();
            $value    = iconv('', $enc . '//IGNORE', $value);
            $filtered = htmlentities($value, $this->getQuoteStyle(), $enc, $this->getDoubleQuote());

            if (!strlen($filtered)) {
                $ex = new \Exception('Encoding mismatch has resulted in htmlentities errors.');
                throw $ex;
            }
        }

        return $filtered;
    }
780035
public function getKey($value): Option
	{
		if ($this->containsValue($value))
		{
			return new Option(array_search($value, $this->data, true), true);
		}
		else
		{
			return new Option(null, false);
		}
	}
801681
public static function encode($value, $options = JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK)
    {
        if ($value instanceof \Traversable)
        {
            $value = \iterator_to_array($value);
        }

        return \json_encode($value, $options);
    }
973625
public function setOption($option, $value)
    {
        $this->options[$option] = $value;
        curl_setopt($this->resource, $option, $value);

        return $this;
    }
157380
protected function mapValuesToOptions(array $value, array $options)
    {
        $result = [];
        foreach ($value as $key) {
            $result[] = $this->mapValueToOption($key, $options);
        }
        return $result;
    }
82388
public static function encode($value, $options = null)
    {
        if ($options === null) {
            $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
        }

        $json = json_encode($value, $options);

        static::handleJsonError(json_last_error());

        return $json;
    }
1048734
public function setOption(int $option, $value) : void
    {
        curl_setopt($this->curl, $option, $value);
    }
203600
public function setOption($key, $value)
    {
        if(in_array($key, [CURLINFO_HEADER_OUT, CURLOPT_PUT, CURLOPT_RETURNTRANSFER]))
        {
            throw new Exception("Value for cURL option $key cannot be modified", 3);
        }

        $this->options[$key] = $value;

        return $this;
    }
619248
public function toString($value, $type, array $options)
    {
        return $this->convert($value, $type, $options, $this->getToStringCallbacks());
    }
904340
public function addURL($url,$options=array()) {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        foreach($options as $option=>$value) {
            curl_setopt($ch, $option, $value);
        }
        return $this->addCurl($ch);
    }