Clones the current object and merges configuration values with the new ones
Ex: $newconf = $conf->merge(['key1' => 'test', 'key2' => 'test']);
@param array $values
@param boolean $invert
@throws \InvalidArgumentException
@return \FluentConfiguration
489848
public function merge(array $values, $invert = false) {
		$obj = $this->preserveInstance ? $this : clone $this;
		$obj->config = ($invert) ? array_merge($values, $this->config) : array_merge($this->config, $values);
		return $obj;
	}
1208445
public function merge($to)
    {
        if (is_array($to)) {
            $to = Url::createFromArray($to);
        }
        else if (is_string($to)) {
            $to = self::createFromString($to);
        }
        else if (($to instanceof Url) === false) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'to'; expecting a url as string, ".
                "an instance of sndsgd\\Url, or an array of url properties"
            );
        }

        $toValues = $to->__toArray();

        # the query property will be an empty array if it has no value
        if (count($this->query) === 0 && $toValues['query']) {
            $this->setQuery($toValues['query']);
        }

        $keys = ['scheme','user','pass','host','port','path','fragment'];
        foreach ($keys as $key) {
            if ($this->$key === null && $toValues[$key] !== null) {
                call_user_func([$this, 'set'.ucfirst($key)], $toValues[$key]);
            }
        }

        return $this;
    }
598070
protected function transform(array $placeholders)
    {
        if (isset($this->config['parameters'])) {
            ArrayHelper::transform($this->config['parameters'], $placeholders);
            $placeholders = array_merge($this->config['parameters'], $placeholders);
            unset($this->config['parameters']);
        }
        ArrayHelper::transform($this->config, $placeholders);
        $this->rewind();
        return $this;
    }
1012164
public function set_config($config, $value = null)
	{
		$config = is_array($config) ? $config : array($config => $value);
		foreach ($config as $key => $value)
		{
			if (strpos($key, '.') === false)
			{
				$this->config[$key] = $value;
			}
			else
			{
				\Arr::set($this->config, $key, $value);
			}
		}

		return $this;
	}
1246861
public function setParams($params) {
        if (!is_array($params)) {
            throw new \InvalidArgumentException('Paramater $params must be an array.');
        }

        foreach ($params as $name => $value) {
            if (isset($this->params[$name]) || array_key_exists($name, $this->params)) {
                if (is_array($this->params[$name])) {
                    if (is_array($value)) {
                        $this->params[$name] = array_merge($this->params[$name], $value);
                    }
                    else {
                        throw new ConfigurationException(sprintf('Parameters type mismatch. Given type is "%s", expected type is "%s"', gettype($this->params[$name]) ,gettype($value)));
                    }
                }
                else {
                    $this->params[$name] = $value;
                }
            }
            else {
                throw new ConfigurationException(sprintf('Parameter "%s" doesn\'t exists', $name));
            }
        }
    }
51136
public function values( array $values )
	{
		// do nothing if we get nothing
		if ( empty( $values ) )
		{
			return $this;
		}
		
		// check if the the passed array is a collection.
		// because we want to be able to insert bulk values.
		if ( !\CCArr::is_collection( $values ) )
		{
			$values = array( $values );
		}
		
		// because we could recive the arrays in diffrent order 
		// we have to sort them by their key.
		foreach( $values as $key => $value )
		{
			ksort( $value ); $values[$key] = $value;
		}
		
		// merge the new values with the existing ones.
		$this->values = array_merge( $this->values, $values ); 
		
		// return self so we can continue running the next function
		return $this;
	}
746802
public function bind($values = [])
    {
        if (is_object($values)) {
            $values = get_object_vars($values);
        }

        if (!is_array($values)) {
            throw new \InvalidArgumentException('Please give me array or object');
        }

        foreach ($values as $key => $value) {
            $this->$key = $value;
        }

        return $this;
    }
600739
public function combine(array $keys = null, array $values = null)
	{
		return array_combine($keys ?: $this->members, $values ?: $this->members);
	}
908483
function set(array $values)
    {
        array_walk($values, function(&$val, $key) {
            $key = new Node\UnqualifiedColumn($key);
            $val = new Node\Assignment($key, $val);
        });

        $this->nodes->values = $values;
        return $this;
    }
353664
public function insert(array $values)
    {
        $result = parent::insert($values);

        $this->handler->setBuilder($this)
            ->invalidateQuery(Reflector::QUERY_TYPE_INSERT, $values);

        return $result;
    }
1295582
public function mergeConfig($new = array())
    {
        $config = (object) array_merge(
            (array) $this->_defaultConfiguration,
            (array) $this->_configuration,
            (array) $new
        );

        foreach ($config as $key => $value) {
            $this->setConfig($key, $value);
        }

        return $this;
    }
463347
public function in(array $values)
    {
        foreach ($values as $value) {
            if (\is_array($value)) {
                $this->in($value);
            } else {
                $this->is($value);
            }
        }

        return $this;
    }
1115820
private function mergeOptions(array $options)
    {
        /** @var Option[] $mergedList */
        $mergedList = array_merge($this->optionList, $options);
        $duplicates = array();
        foreach ($mergedList as $option) {
            foreach ($mergedList as $otherOption) {
                if (($option === $otherOption) || in_array($otherOption, $duplicates)) {
                    continue;
                }
                if ($this->optionsConflict($option, $otherOption)) {
                    throw new \InvalidArgumentException('Failed to add options due to conflict');
                }
                if (($option->short() === $otherOption->short()) && ($option->long() === $otherOption->long())) {
                    $duplicates[] = $option;
                }
            }
        }
        foreach ($mergedList as $index => $option) {
            if (in_array($option, $duplicates)) {
                unset($mergedList[$index]);
            }
        }
        $this->optionList = array_values($mergedList);
    }
1074055
public function setIn($keys, $value)
    {
        $lastKey = array_shift($keys);
        if (count($keys) > 0 && !isset($this->$lastKey->{$keys[0]})) {
            throw new \RuntimeException(sprintf("Key '%s->%s' does not exist.", $lastKey, $keys[0]));
        }
        if (count($keys) > 0 && $this->$lastKey instanceof Map) {
            return $this->merge(new self(array($lastKey => $this->$lastKey->setIn($keys, $value))));
        }
        return $this->merge(new self(array($lastKey => $value)));
    }
1258032
public function setValues(array $values)
    {
        foreach ($values as $name => $value) {
            $this->fields->set($name, $value);
        }

        return $this;
    }
607635
public function withValues(array $values) : self
    {
        $new = clone $this;
        foreach ($values as $property => $value) {
            $new->data[$property] = $value;
        }

        return $new;
    }
758614
public function setMultipleProperties(array $properties)
    {
        $this->parseStyleAttribute();

        foreach ($properties as $propertyName => $value) {
            if (!is_string($propertyName)) {
                throw new InvalidArgumentException(sprintf('Property name must be a string, %s given', (is_object($propertyName) ? get_class($propertyName) : gettype($propertyName))));
            }

            if (!is_string($value)) {
                throw new InvalidArgumentException(sprintf('Property value must be a string, %s given', (is_object($value) ? get_class($value) : gettype($value))));
            }

            $this->properties[$propertyName] = $value;
        }

        $this->updateStyleAttribute();

        return $this;
    }