Define options from an associative array.

@param  (bool|int|string[][])[] $options
@return $this
352475
public function fromArray(array $options)
    {
        static $configurables = [
            'limit',
            'forward',
            'backward',
            'exclusive',
            'inclusive',
            'seekable',
            'unseekable',
        ];

        if (isset($options['orders'])) {
            foreach ($options['orders'] as $order) {
                $this->orderBy(...$order);
            }
        }

        foreach (array_intersect_key($options, array_flip($configurables)) as $key => $value) {
            $this->$key($value);
        }

        return $this;
    }
929490
public function setOptions(array $options)
    {
        if (isset($options['bitstring_padding']) && \is_string($options['bitstring_padding'])) {
            $this->options['bitstring_padding'] = $options['bitstring_padding'];
        }

        return $this;
    }
27631
public function setOptions(array $options)
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);

        $this->options = $options;

        return $this;
    }
1168603
public function addOptions(array $options)
    {
        $existingOptions = $this->getOptions();
        $newOptions = empty($existingOptions) ? $options : array_merge((array)$existingOptions, $options);
        $this->setOptions($newOptions);
        return $this;
    }
698854
public function setOptions(array $options)
    {
        if (isset($options['indentWidth'])) {
            $this->setIndentWidth($options['indentWidth']);
        }
        if (isset($options['indent'])) {
            $this->setIndent($options['indent']);
        }
        if (isset($options['quote'])) {
            $this->setQuote($options['quote']);
        }
        if (isset($options['fgcolor'])) {
            $this->setFgColor($options['fgcolor']);
        }
        if (isset($options['bgcolor'])) {
            $this->setBgColor($options['bgcolor']);
        }
        return $this;
    }
1055651
public function setOptions($options)
    {
        if (!is_array($options)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '[%s] expects array; received [%s]',
                __METHOD__,
                gettype($options)
            ));
        }

        $this->options = $options;
    }
955978
public function addOptions(array $options) : OptionGroup
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
1356180
public function addOptions(array $options) : Select
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
294520
public function addOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->addOption($name, $value);
        }

        return $this;
    }
539623
public function options(array $options): self
    {
        foreach ($options as $name => $value) {
            $this->option($name, $value);
        }

        return $this;
    }
1133717
protected function setOptions($options)
    {
        if (!$options instanceof OptionsInterface) {
            $options = is_array($options) ? $options : [];
            $options = new Options($options);
        }

        $this->options = $options;
    }
1303107
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $method = 'set' . ucfirst($name);

            if (method_exists($this, $method)) {
                $this->$method($value);
            } else {
                $this->options[$name] = $value;
            }
        }

        return $this;
    }
1191580
public function setOptions(array $options)
    {
        if (count($options)) {
            foreach ($options as $method => $value) {
                $method = camelcase('set_' . $method);

                if (method_exists($this, $method)) {
                    call_user_func_array([&$this, $method], [$value]);
                }
            }
        }

        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];
            }
        }
    }
53963
public function setDisplayOptions(array $options)
    {
        if (!is_array($options)) {
            throw new \RuntimeException('The display options must be an associative array.');
        }

        $this->displayOptions = array_merge($this->defaultDisplayOptions(), $options);

        return $this;
    }
834916
public function withoutOptions(int ...$options): OptionsInterface
    {
        foreach ($options as $option) {
            $this->options &= ~$option;
        }

        return $this;
    }