This method allows to set the API configuration
through an array rather than using the Laravel
and Lumen Config contracts.

@param  array $options
@return \NEM\API
@throws InvalidArgumentException on invalid option names.
517260
public function setOptions(array $options)
    {
        foreach ($options as $option => $config) {
            if (! (bool) preg_match("/^[0-9A-Za-z_]+$/", $option))
                // invalid option format
                throw new InvalidArgumentException("Invalid option name provided to evias\\NEMBlockchain\\API@setOptions: " . var_export($option, true));

            $upper  = str_replace(" ", "", ucwords(str_replace("_", " ", $option)));
            $setter = "set" . $upper;

            if (method_exists($this, $setter))
                $this->$setter($config);
            elseif (method_exists($this->getRequestHandler(), $setter))
                $this->getRequestHandler()->$setter($config);
        }

        return $this;
    }
1186496
public function setOptions(array $options)
    {
        $availableOptions = [
            'default',
            'group',
            'key',
            'message',
            'messages',
            'rules'
        ];

        foreach ($availableOptions as $option) {
            if (isset($options[$option])) {
                $this->$option = $options[$option];
            }
        }
    }
205457
public function setOptions(array $options)
    {
        $this->options = [];

        foreach ($options as $k => $v) {
            $this->addOption($k, (array)$v);
        }

        return $this;
    }
1332011
protected function loadConfig($options)
    {
        if (isset($options['env']) && !in_array($options['env'], ['cli', 'product', 'development'])) {
            throw new \InvalidArgumentException('option --env\'s value must be [cli, product, development]');
        }
        $env = 'development';
        isset($options['env']) && $env = $options['env'];

        Output::writeln('using config -- ' . Colour::colour($env, Colour::GREEN));

        $this->setConfig(new Config($env));
    }
266586
function setOptions(array $options)
    {
        $params = array(1, $this->username, $this->password, $options);

        return $this->sendRequest('wp.setOptions', $params);
    }
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
        ]);
    }
828503
protected function _setOptions($options)
    {
        if (empty($options)) {
            $options = [];
        }

        $url = $this->get('url');
        if (!is_array($url)) {
            $isHttp = substr($url, 0, 7) === 'http://';
            $isHttps = substr($url, 0, 8) === 'https://';
            if ($isHttp || $isHttps) {
                $options += ['target' => '_blank'];
            }
        }

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

        return $this;
    }
566716
public function options($options)
    {
        if (!is_array($options)) {
            throw new InvalidParamException('Array parameter expected, ' . gettype($options) . ' received.');
        }

        $this->options = $options;
        return $this;
    }
1232494
protected function setOptions($options)
    {
        $options = array_merge(array(
            'format'                => 'hex',
            'invoke_inline'         => false,
            'include_dependencies'  => false,
            'as_component'          => false,
            'class'                 => 'colorpicker',
        ), $options);

        if (!in_array($options['format'], array('hex', 'rgb', 'rgba'))) {
            throw new Exception\InvalidArgumentException(
                'Invalid format supplied. Allowed formats are "hex", "rgb" and "rgba".'
            );
        }

        $defaultColors = array(
            'hex'   => '#fff',
            'rgb'   => 'rgb(255,255,255)',
            'rgba'  => 'rgba(255,255,255,1)',
        );

        if (empty($options['color'])) {
            $options['color'] = $defaultColors[$options['format']];
        }

        return $this->options = $options;
    }
392839
protected function parseOptions(array $options)
    {
        $options = array_merge($this->defaultOptions, $options);

        foreach ($options as $option => $value) {
            if (! in_array($option, $this->allowedOptions, true)) {
                throw new \InvalidArgumentException("Option [$option] is not allowed.");
            }
        }

        return $options;
    }
749334
public function setOptions($options)
	{
		$options = is_array($options) ? $options : array($options);

		foreach ($options as $option)
		{
			$this->addOption($option);
		}

		return $this;
	}
316326
public function config(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . $key;
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
503252
public function setOptions(Array $options)
    {
        foreach ($options as $key => $value) {
            switch ($key) {
                case self::ADAPTER:
                    $this->_setAdapter($value);
                    break;
                case self::SCHEMA:
                    $this->_schema = (string) $value;
                    break;
                case self::NAME:
                    $this->_name = (string) $value;
                    break;
                case self::PRIMARY:
                    $this->_primary = (array) $value;
                    break;
                case self::SEQUENCE:
                    $this->_setSequence($value);
                    break;
                default:
                    // ignore unrecognized configuration directive
                    break;
            }
        }

        return $this;
    }
1092667
public function setOptions(array $options = array())
    {
        if (isset($options['image_path'])) {
            $this->_options['image_path'] = $options['image_path'];
        }

        if (isset($options['plugins'])) {
            $this->_options['plugins'] = $options['plugins'];
        }
        return $this;
    }
1362946
protected function setRequestOptions(array $options)
    {
        if (isset($options['timestamp'])) {
            $this->authentication->setTimestamp($options['timestamp']);
        } elseif (!$this->getConfig('timestamp')) {
            $this->authentication->setTimestamp();
        }

        if (isset($options['nonce'])) {
            $this->authentication->setNonce($options['nonce']);
        }

        if (isset($options['handler'])) {
            $options = $this->setAuthenticationHandler($options, $this->authentication);
        }

        if ($fp = $this->isVerbose()) {
            $options = $this->setVerboseHandler($options, $fp);
        }

        $options['debug'] = $this->getDebugOption($options);
        if ($fp = $this->isDebug()) {
            $options = $this->setDebugHandler($options, $fp);
        }

        if ($this->logger && isset($options['handler'])) {
            $this->setLogHandler($options['handler'], $this->logger);
            return $options;
        }

        return $options;
    }
513352
public function setOptions(array $options)
    {
        // Set namespace first, see ZF-10836
        if (isset($options['namespace'])) {
            $this->setNamespace($options['namespace']);
            unset($options['namespace']);
        }

        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }