Handle a merge action.
@param $options
@return bool
546884
protected function runMergeAction($options)
    {
        if (array_key_exists('branch', $options)) {
            $cmd = 'cd "%s" && git checkout %s && git merge "%s"';
            $path = $this->phpci->buildPath;
            return $this->phpci->executeCommand($cmd, $path, $options['branch'], $this->build->getBranch());
        }
    }
97296
public function addOptions($options)
    {
        if (is_string($options)) {
            $this->mergeOptions($this->optionParser->parseString($options));
        } elseif (is_array($options)) {
            $this->mergeOptions($this->optionParser->parseArray($options));
        } else {
            throw new \InvalidArgumentException("Getopt(): argument must be string or array");
        }
    }
1177920
protected function mergeOptions(array $options)
    {
        $defaults = $options + $this->_default_options;
        $flip_request_params = array_flip($defaults['request_param']);
        $request = array_intersect_key($this->application->input->get(), $flip_request_params);

        if ($defaults['save'] !== false) {
            $last_request = $this->application->session->userdata($defaults['save']);
            if (!empty($last_request)) {
                $request = array_merge($last_request, $request);
            }
            $this->application->session->set_userdata($defaults['save'], $request);
        }

        foreach ($request as $key => $value) {
            if (isset($defaults[$flip_request_params[$key]])) {
                $defaults[$flip_request_params[$key]] = $value;
            }
        }
        return array_merge($defaults, $request);
    }
912681
public function setOptions(array $options, $merge = true)
    {
        if ($merge) {
            $this->options = array_replace($this->options, $options);
        } else {
            $this->options = $options;
        }
    }
1330116
public function merge($actions)
	{
		if (is_string($actions))
		{
			$actions = json_decode($actions, true);
		}

		if (is_array($actions))
		{
			foreach ($actions as $action => $identities)
			{
				$this->mergeAction($action, $identities);
			}
		}
		elseif ($actions instanceof Rules)
		{
			$data = $actions->getData();

			foreach ($data as $name => $identities)
			{
				$this->mergeAction($name, $identities);
			}
		}
	}
973881
public function mergeUserOptions(array $options) {
    foreach ($options as $option=>$value)
      $this->_options[$option] = $value;
    return $this;
  }
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'];
    }
1276950
protected function merge($target, $source)
    {
        if ($source === null) {
            return $target;
        }

        return call_user_func($this->merge, $target, $source);
    }
959426
private function executeExtraUpdates(array $options)
    {
        foreach ($this->extraUpdates as $oid => $update) {
            list ($document, $changeset) = $update;
            $this->documentChangeSets[$oid] = $changeset;
            $this->getDocumentPersister(get_class($document))->update($document, $options);
        }
    }
36957
public function execute($options = array())
    {
        $message = $options['message'];
        $receivers = isset($options['attributes']) ? $options['attributes'] : array();
        foreach ($receivers as $receiver) {
            $this->sendNotification($receiver, $message->getBody());
        }
    }
1169360
protected function processOptions(&$options)
    {
        if (!isset($options['extra'])) {
            $options['extra'] = array();
        }
        $options['extra'] = CMap::mergeArray($this->extraVariables, $options['extra']);
    }
430016
public function merge($rules, $overwrite = true)
	{
		if (!is_array($rules)
		 && !($rules instanceof self))
		{
			throw new InvalidArgumentException('merge() expects an array or an instance of Ruleset');
		}

		foreach ($rules as $action => $value)
		{
			if (is_array($value))
			{
				foreach ($value as $tagName)
				{
					$this->$action($tagName);
				}
			}
			elseif ($overwrite || !isset($this->items[$action]))
			{
				$this->$action($value);
			}
		}
	}
1123359
protected function mergeOptions(array $options)
    {
        $merged = [];
        foreach ($this->supportedOptions() as $option) {
            $merged[$option] = $this->mergeOption($option, $options);
        }

        return $merged;
    }
648504
public function execute($options = array())
    {
        $message = $options['message'];
        $receivers = $message->getReceivers();

        $options['provide_link'] = true;
        foreach ($receivers as $receiver) {
            if ($email = $this->extractEmailFromReceiver($receiver))
                $this->sendMail($message, $email, $options);
        }
    }
1264188
protected function handleOptions(array &$options = [])
    {
        parent::handleOptions($options);
        if (isset($options['reason_phrase'])) {
            $this->reasonPhrase = $options['reason_phrase'];
        }
    }
829869
public function saveIfExistsOrFail(array $options = []): bool
    {
        if ($this->exists === false) {
            return false;
        }

        return $this->saveOrFail($options);
    }
264883
protected function mergeValues(array $values, $merge = true)
    {
        $this->values = $merge ? array_merge($this->values, $values) : $values;
        return $this;
    }