Prepare any pool options for the new pool object.

@param  mixed $options Settings for the new pool.
@return array
12641
private function parsePoolOptions($options)
    {
        $defaults = [
            'pool_class' => $this->poolClass,
            'item_class' => $this->itemClass,
            'namespace'  => $this->namespace,
            'logger'     => $this->logger,
        ];

        if ($options === null) {
            return $defaults;
        }

        if (is_string($options)) {
            $options = [
                'namespace' => $options
            ];
        }

        if (!is_array($options)) {
            return $defaults;
        }

        return array_replace($defaults, $options);
    }
1195659
public function setOptions($options = [])
    {
        $this->options = $options;
        $this->debug->info(__FUNCTION__, 'setOptions: ', $this->options);

        return $this;
    }
231441
private function configure(array $options = []): array
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'max_restarts' => 10,
        ]);

        $resolver->setAllowedTypes('max_restarts', 'int');

        return $resolver->resolve($options);
    }
1359933
public function buildFilters($options) {
        if (empty($options['filters']) || !is_array($options['filters'])) return [];
        return array_filter(array_map(function($filter) {
            if (empty($this->config['filters'][$filter])) return;
            return new $this->config['filters'][$filter];
        }, $options['filters']));
    }
925188
public function setOptions(array $options)
    {
        foreach ($options as $opt => $val) {
            $this->setOption($opt, $val);
        }

        return $this;
    }
120681
protected function setOptions($options)
    {
        $all = [
            'auto_start',
            'cache_limiter',
            'cookie_domain',
            'cookie_httponly',
            'cookie_lifetime',
            'cookie_path',
            'cookie_secure',
            'entropy_file',
            'entropy_length',
            'gc_divisor',
            'gc_maxlifetime',
            'gc_probability',
            'hash_bits_per_character',
            'hash_function',
            'name',
            'referer_check',
            'serialize_handler',
            'use_cookies',
            'use_only_cookies',
            'use_trans_sid',
            'upload_progress.enabled',
            'upload_progress.cleanup',
            'upload_progress.prefix',
            'upload_progress.name',
            'upload_progress.freq',
            'upload_progress.min-freq',
            'url_rewriter.tags'
        ];

        foreach ($all as $key)
        {
            if (!array_key_exists($key, $options))
            {
                $options[$key] = ini_get("session.{$key}");
            }
            else
            {
                ini_set("session.{$key}", $options[$key]);
            }
        }

        return $options;
    }
785762
public function setOptions($options = [])
    {
        $default = [
            'dsn'             => null,
            'username'        => null,
            'password'        => null,
            'driver_options'  => null,
            'table_prefix'    => null,
            'fetch_mode'      => \PDO::FETCH_OBJ,
            'session_key'     => 'CDatabase',
            'verbose'         => null,
            'debug_connect'   => false,
        ];
        $this->options = array_merge($default, $options);

        if ($this->options['table_prefix']) {
            $this->setTablePrefix($this->options['table_prefix']);
        }

        if ($this->options['dsn']) {
            $dsn = explode(':', $this->options['dsn']);
            $this->setSQLDialect($dsn[0]);
        }
    }
569629
protected function prepareOptions(Options $options)
    {
        if ($options->getConvertImagesToBase64() === true) {

            $preparedHeaderContent = $this->convertImagesToBase64($options->getHeaderContent());
            $preparedFooterContent = $this->convertImagesToBase64($options->getFooterContent());

            $options->setHeaderContent($preparedHeaderContent);
            $options->setFooterContent($preparedFooterContent);
        }

        $options = $this->prepareHeaderAndFooter($options);

        return $options;
    }
933007
public function set_option($options = []) {
        if (!empty($options['dropbox_key'])) {
            set_config('dropbox_key', trim($options['dropbox_key']), 'dropbox');
            unset($options['dropbox_key']);
        }
        if (!empty($options['dropbox_secret'])) {
            set_config('dropbox_secret', trim($options['dropbox_secret']), 'dropbox');
            unset($options['dropbox_secret']);
        }
        if (!empty($options['dropbox_cachelimit'])) {
            $this->cachelimit = (int) trim($options['dropbox_cachelimit']);
            set_config('dropbox_cachelimit', $this->cachelimit, 'dropbox');
            unset($options['dropbox_cachelimit']);
        }

        return parent::set_option($options);
    }
1168720
public function setOptions($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        $this->options = array_merge($this->getDefaults(), $options);
        return $this;
    }
108170
private function configureDeliveryOptions(array $options): array
    {
        $logger = $options['options']['logger'];
        if (\null !== $logger) {
            $options['options']['logger'] = \true === $logger
                ? new Reference(LoggerInterface::class)
                : new Reference($options['options']['logger']);
        }

        if (\null !== $options['options']['client']) {
            $options['options']['client'] = new Reference($options['options']['client']);
        }

        $pool = $options['options']['cache']['pool'];
        if (\null !== $pool) {
            $options['options']['cache']['pool'] = \true === $pool
                ? new Reference(CacheItemPoolInterface::class)
                : new Reference($pool);
        }

        return $options;
    }
65407
protected function prepareOptions(array $options = [])
    {
        $helper = $this->formHelper;

        if (array_get($this->options, 'template') !== null) {
            $this->template = array_pull($this->options, 'template');
        }

        $options = $helper->mergeOptions($this->options, $options);

        if ($this->parent->haveErrorsEnabled()) {
            $this->addErrorClass($options);
        }

        if ($this->getOption('attr.multiple')) {
            $this->name = $this->name.'[]';
        }

        if ($this->getOption('required') === true) {
            $options['label_attr']['class'] .= ' ' . $this->formHelper
                ->getConfig('defaults.required_class', 'required');
            $options['attr']['required'] = 'required';
        }

        $options['wrapperAttrs'] = $helper->prepareAttributes($options['wrapper']);
        $options['errorAttrs'] = $helper->prepareAttributes($options['errors']);

        if ($options['is_child']) {
            $options['labelAttrs'] = $helper->prepareAttributes($options['label_attr']);
        }

        if ($options['help_block']['text']) {
            $options['help_block']['helpBlockAttrs'] = $helper->prepareAttributes(
                $options['help_block']['attr']
            );
        }

        return $options;
    }
371722
private function prepareOptions($options, $forceOptions = [])
    {
        $optionString = '';

        foreach ($forceOptions as $option => $value) {
            if (is_numeric($option)) {
                $options[$value] = null;
            } else {
                $options[$option] = $value;
            }
        }

        foreach ($options as $option => $value) {

            if (is_null($value)) {
                $optionString .= ' ' . $option;
            } else {
                $optionString .= ' ' . $option . '=' . $value;
            }
        }

        return $optionString;
    }
1062934
public static function prepareOptions(array $options) : array
    {
        if (empty($options['fields'])) {
            return [];
        }

        $result = [];
        foreach ($options['fields'] as $field => $params) {
            if (empty($params['column']) && empty($params['default'])) {
                continue;
            }

            $result['fields'][$field] = $params;
        }

        return $result;
    }
677220
public function setOptionsArray($options) {
    foreach($options as $key => $value) {
      if (!$this->setOption($key, $value)) {
        return false;
      }
    }
    return true;
  }
146904
public function setCurlOptions(array $options) {
        return new Request([
            'method'              => $this->method,
            'url'                 => $this->url,
            'curlOptions'         => $options,
            'query'               => $this->query,
            'payload'             => $this->payload,
            'expectedStatusCodes' => $this->expectedStatusCodes
        ]);
    }
1349623
protected function _initOptions($options)
    {
        $defaultOptions = array(
            'soap_version' => SOAP_1_1,
            'authentication' => SOAP_AUTHENTICATION_BASIC,
            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
            'exceptions' => true,
            'timeout' => (int) ini_get('default_socket_timeout'), // in seconds
        );
        $options = array_merge($defaultOptions, $options);

        ini_set('default_socket_timeout', (int) $options['timeout']);

        return $options;
    }