Convert the curlOptions to an array of usable options for the cURL request

@return array
333152
protected function forgeOptions()
    {
        $results = array();
        foreach( $this->curlOptions as $key => $value ) {
            $arrayKey = constant( 'CURLOPT_' . $key );

            if( !$this->packageOptions[ 'containsFile' ] && $key == 'POSTFIELDS' && is_array( $value ) ) {
                $results[ $arrayKey ] = http_build_query( $value, null, '&' );
            } else {
                $results[ $arrayKey ] = $value;
            }
        }

        if( !empty($this->packageOptions[ 'xDebugSessionName' ]) ) {
            $char = strpos($this->curlOptions[ 'URL' ], '?') ? '&' : '?';
            $this->curlOptions[ 'URL' ] .= $char . 'XDEBUG_SESSION_START='. $this->packageOptions[ 'xDebugSessionName' ];
        }

        return $results;
    }
298236
protected function defaultCurlOptions()
    {
        $result = parent::defaultCurlOptions();
        $result[CURLOPT_NOSIGNAL] = 1;
        if ($this->speed == self::SPEED_LONG || $this->big) {
            $result[CURLOPT_CONNECTTIMEOUT_MS] = 60000;
            $result[CURLOPT_TIMEOUT_MS] = 60000;
            $this->big = false;
        } else {
            $result[CURLOPT_CONNECTTIMEOUT_MS] = 500;
            $result[CURLOPT_TIMEOUT_MS] = 500;
        }
        return $result;
    }
200235
private function FetchOptions()
    {
        $strOptions = $this->Value('Options');
        $lines = Str::SplitLines($strOptions);
        $result = array();
        foreach ($lines as $line)
        {
            $dpPos = strpos($line, ':');
            if ($dpPos !== false)
            {
                $value = trim(substr($line, 0, $dpPos));
                $text = trim(substr($line, $dpPos + 1));
            }
            else
            {
                $value = $line;
                $text = '';
            }
            $result[$value] = $text;
        }
        return $result;
    }
39397
public function getOptions(): array
    {
        if ($this->options === null && $this->_repository !== null) {
            $this->_repository->injectOptions($this);
        }

        return $this->options ?: [];
    }
592204
private function initCurl(array $curlOptions)
    {
        $curlResource = curl_init();
        foreach ($curlOptions as $option => $value) {
            curl_setopt($curlResource, $option, $value);
        }

        return $curlResource;
    }
1203838
public function getCommandOptions()
    {
        $consoleOptions = array();
        foreach ($this->requests as $name => $request) {
            if ($request->isAvailableAsCommandOption()) {
                $consoleOptions[$name] = $request->convertToCommandOption();
            }
        }

        return $consoleOptions;
    }
426519
public static function getConfiguredUrls()
    {
        $result = array();
        foreach (self::$urlOptions as $key => $optionName) {
            $result[$key] = Option::get($optionName);
        }
        return $result;
    }
416125
public function toOptionArray()
    {
        $fields[] = [
            'label' => __('---- Default Option ----'),
            'value' => '0',
        ];
        $apiEnabled = $this->helper->isEnabled($this->helper->getWebsite());
        //get datafields options
        if ($apiEnabled) {
            $datafields = $this->getDataFields();

            //set the api error message for the first option
            if (isset($datafields->message)) {
                //message
                $fields[] = [
                    'value' => 0,
                    'label' => $datafields->message,
                ];
            } else {
                //loop for all datafields option
                foreach ($datafields as $datafield) {
                    if (isset($datafield->name)
                        && $datafield->visibility == 'Public'
                    ) {
                        $fields[] = [
                            'value' => $datafield->name,
                            'label' => $datafield->name,
                        ];
                    }
                }
            }
        }

        return $fields;
    }
719905
protected function setOptions() {
        $this->resource->setOption(CURLOPT_URL, $this->createUrl());
        $this->resource->setOption(CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
        $this->resource->setOption(CURLOPT_RETURNTRANSFER, true);
        $this->resource->setOption(CURLOPT_HEADER, true);

        $this->resource->setOption(
            CURLOPT_FOLLOWLOCATION,
            $this->options->get(HttpClientOptions::FOLLOW_REDIRECT, false)
        );

        if ($this->options->get(HttpClientOptions::VERIFY_SSL, true)) {
            $this->resource->setOption(CURLOPT_SSL_VERIFYPEER, true);
            $this->resource->setOption(CURLOPT_SSL_VERIFYHOST, 2);
        } else {
            $this->resource->setOption(CURLOPT_SSL_VERIFYPEER, false);
            $this->resource->setOption(CURLOPT_SSL_VERIFYHOST, false);
        }

        foreach ($this->options->toArray() as $option => $value) {
            if (str_starts_with($option, 'CURLOPT_') && defined($option)) {
                $this->resource->setOption(constant($option), $value);
            }
        }
    }
421443
private function compileOptions(){
        $this->CurlOptions = array();
        $this->configureHTTPMethod($this->method);
        $this->configureUrl($this->url);
        $this->configureBody($this->body);
        $this->configureHeaders($this->headers);
        $this->configureOptions($this->options);
        return $this;
    }
911465
protected function options()
    {
        $types  = FieldType::all(['id', 'name', 'type']);
        $return = [];
        foreach ($types as $type) {
            $return[$type->id] = ucfirst(Str::humanize(is_null($type->type) ? $type->name : $type->name . ' ' . $type->type));
        }
        return $return;
    }
4881
protected function getOptions()
    {
        $options = array();

        foreach ($this->getModuleServices() as $module)
        {
            // Create a new option object based on the <option /> element.
            $tmp = \JHtml::_(
                'select.option', $module,
                \JText::_(trim((string) $module)), 'value', 'text'
            );

            // Add the option object to the result set.
            $options[] = $tmp;
        }

        reset($options);

        return $options;
    }
997672
private function getOptions()
    {
        $required = [
            'token' => $this->getToken(),
            'url'   => $this->getUrl()[0],
        ];

        $optional = [];
        if (null != $this->alias) {
            $optional['key'] = $this->getAlias();
        }
        if (null != $this->format) {
            $optional['format'] = $this->getFormat();
        }
        if (null != $this->password) {
            $optional['password'] = $this->getPassword();
        }
        if (null != $this->limit) {
            $optional['limit'] = $this->getLimit();
        }
        if (null != $this->expire) {
            $optional['expire'] = $this->getExpire();
        }

        return array_merge($required, $optional);
    }
924114
private function getOptions(): array
    {
        return $this->options + [
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
            PDO::ATTR_CASE => PDO::CASE_NATURAL,
            PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
            PDO::ATTR_STRINGIFY_FETCHES => false,
            PDO::ATTR_EMULATE_PREPARES => false,
        ];
    }
533870
protected function getRequestOptions()
    {
        $options = [
            'proxy' => Configuration::get('proxy')
        ];

        if (!empty(array_filter($this->multipartResources))) {
            $options['multipart'] = $this->multipartResources;
        }

        return $options;
    }
891432
public function getOptions()
    {
        foreach ($this->defaultOpts() as $k => $v) {
            if (!isset($this->_options[$k])) {
                $this->_options[$k] = $v;
            }
        }
        // !important see headerCallback() function
        $this->_options[CURLOPT_HEADER] = false;
        return $this->_options;
    }
267436
protected function getOptions() : array
    {
        $options = [];

        foreach ($this->elements as $element) {
            if ($element instanceof Option) {
                $options[] = $element;
            }
            elseif ($element instanceof OptionGroup) {
                $options = array_merge($options, $element->getOptions());
            }
        }

        return $options;
    }