Merge $options into existing options

@param array $options
973881
public function mergeUserOptions(array $options) {
    foreach ($options as $option=>$value)
      $this->_options[$option] = $value;
    return $this;
  }
1131240
public function setOptions(array $options = []): void
    {
        $this->options = $this->shortcuts = [];
        $this->addOptions($options);
    }
326315
public function options($options = [])
    {
        if ($options instanceof Arrayable) {
            $options = $options->toArray();
        }

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

        return $this;
    }
1032703
public function setOptionFromArray($options) {
        foreach($options as $option => $value) {
            $this->setOption($option, $value);
        }

        return $this;
    }
1138557
public function merge($options)
    {
        $other_options = self::parse($options);
        if ($other_options->apiKey === null) {
            $other_options->apiKey = $this->apiKey;
        }
        $other_options->headers = array_merge($this->headers, $other_options->headers);
        return $other_options;
    }
82004
public function addOptions($options)
    {
        foreach ($options as $key => $value) {
            $this->addOption($key, $value);
        }

        return $this;
    }
440498
public function setup(array $options)
    {
        foreach ($options as $method => $value) {
            $method = 'set' . ucfirst($method);
            if (method_exists($this, $method)) {
                $this->{$method}($value);
            }
        }
    }
912681
public function setOptions(array $options, $merge = true)
    {
        if ($merge) {
            $this->options = array_replace($this->options, $options);
        } else {
            $this->options = $options;
        }
    }
336165
public function setOptions(array $options = array())
    {
        $options['inited'] = true;

        // Resolve merged options
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $options = $resolver->resolve($options);
        $this->options = array_merge($this->options, $options);

        if (empty($this->options['blocks']['header'])) {
            $this->options['header'] = false;
        }

        if (!$this->options['header']) {
            $this->options['css'] = trim($this->options['css'].' no page header');
        }

        if (isset($options['keywords'])) {
            $this->options['metas']['keywords'] = $options['keywords'];
        }

        if (isset($options['description'])) {
            $this->options['metas']['description'] = $options['description'];
        }

        if ($seo = $this->seoPage) {
            $seo->setTitle($this->options['title']);
            $seo->addHtmlAttributes('lang', $this->options['locale']);

            if ($this->options['canonical']) {
                $seo->setLinkCanonical($this->options['canonical']);
            }

            foreach ($this->options['metas'] as $key => $value) {
                if (is_array($value)) {
                    foreach ($value as $k => $v) {
                        $seo->addMeta('property', $k, $v);
                    }
                } else {
                    $seo->addMeta('name', $key, $value);
                }
            }
        }
    }
1101851
public function options($options = [])
    {
        if (empty($options)) {
            return $this->options;
        }

        $this->options = array_merge($this->options, $options);
    }
472708
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->setOption($k, $v);
        }
    }
554106
private function getMergedOptions(array $options)
    {
        $options = array_merge(
            $this->getDefaultOptions(),
            $options
        );

        if (isset($options['formats'])) {
            $options['formats'] = self::mergeFormats($this->getDefaultFormats(), $options['formats']);
        } else {
            $options['formats'] = $this->getDefaultFormats();
        }

        if (is_null($options['line_ending'])) {
            $options['line_ending'] = $options['type'] === 'html' ? '<br/>' : "\n";
        }

        if (is_null($options['indentation'])) {
            $options['indentation'] = $options['type'] === 'html' ? '&nbsp;&nbsp;&nbsp;&nbsp;' : '    ';
        }

        // `parts_newline` requires `clause_newline`
        $options['parts_newline'] &= $options['clause_newline'];

        return $options;
    }
1228338
protected function initializeOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
1148051
private function mergeDefaults(&$options)
    {
        // Merging optimization for when no headers are present
        if (!isset($options['headers'])
            || !isset($this->defaults['headers'])) {
            $options = array_replace_recursive($this->defaults, $options);
            return null;
        }

        $defaults = $this->defaults;
        unset($defaults['headers']);
        $options = array_replace_recursive($defaults, $options);

        return $this->defaults['headers'];
    }
1075726
public static function merge(...$options) {
            $o = [];

            foreach ($options as $opt) {
                if ($opt instanceof Options) {
                    $o = array_merge($o, $opt->toArray());
                } elseif (is_array($opt)) {
                    $o = array_merge($o, $opt);
                }
            }

            return new self(Util::trimNulls($o));
        }
37471
public function mergeWith(Translations $translations, $options = Merge::DEFAULTS)
    {
        Merge::mergeHeaders($translations, $this, $options);
        Merge::mergeTranslations($translations, $this, $options);

        return $this;
    }
378442
protected function mergeOptions(&$config, $options)
    {
        foreach ($config as $paramName => $paramValue) {
            if (isset($options[$paramName])) {
                if (is_array($paramValue)) {
                    $config[$paramName] =  array_merge($config[$paramName], $options[$paramName]);
                } else {
                    $config[$paramName] = $options[$paramName];
                }
            }
        }

        return $config;
    }