Set up config values, these are merged with the defaults.

@param array

@return RoyalMail\RoyalMail $this
5271
function configure($config = []) {
    $this->config = array_replace_recursive($this->config, $this->modes[@$config['mode'] ?: $this->config['mode']]);
    
    $this->config = array_replace_recursive($this->config, $config);
    
    return $this;
  }
234318
public function assign($array = [])
    {
        foreach ($array as $key => $value) {
            if (is_string($key)) {
                $this->set($key, $value);
            }
        }

        return $this;
    }
458204
public function values(array $values = [])
    {
        $values = array_combine(array_map([$this, 'trimName'], array_keys($values)), array_values($values));
        $this->values = $values;
        return $this;
    }
911387
public function set($name, $value)
    {
        if (is_array($value)) {
            $this->__options[$name] = $this->getInstance()->merge($value);
        } else {
            $this->__options[$name] = $value;
        }

        return $this;
    }
616885
public function setConfig($key = null, $value = null)
    {
        if (is_array($key)) {
            $this->config = $key;
        } else {
            $this->config[$key] = $value;
        }

        return $this;
    }
359564
protected function setData($data = [])
    {
        $defaults = [
            'content'  => '',
            'data'     => null,
        ];

        $this->data = array_merge($defaults, $data);

        return $this;
    }
364440
public function addConfig()
    {
        $params = func_get_args();

        if (!empty($params)) {
            if (is_array($params[0])) {
                forward_static_call_array([Configuration::class, 'setMany'], $params);
            } else {
                forward_static_call_array([Configuration::class, 'set'], $params);
            }
        }

        return $this;
    }
1230029
public function merge($array)
    {
        if ($this->isInstanceOf($array, $this)) {
            $array = $array->val();
        }

        $this->val(array_merge($this->val(), $array));

        return $this;
    }
398649
public function fromArray($array, $options = array())
    {
        // default options
        if (!isset($options['except'])) {
          $options['except'] = array();
        }

        foreach ($options['except'] as $value) {
            unset($array[$value]);
        }

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

        return $this;
    }
945210
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            $this->_config[$key] = $value;
        }

        return $this;
    }
767412
public function setConfig($key, $value = null)
	{
		\Arr::set($this->config, $key, $value);

		return $this;
	}
1166766
protected function setDefault()
    {
        if (strpos($this->input, '=')) {
            list($this->input, $this->default) = explode('=', $this->input);

            $this->modeArray[] = 'OPTIONAL';
        }

        return $this;
    }
1080326
protected function set_defaults()
	{
		$this->options   = $this->default_options;
		$this->params    = $this->default_params;
		return $this;
	}
650476
public function setDefaultValues(Array $defaultValues)
    {
        foreach ($defaultValues as $defaultName => $defaultValue) {
            if (array_key_exists($defaultName, $this->_metadata)) {
                $this->_defaultValues[$defaultName] = $defaultValue;
            }
        }
        return $this;
    }
1086098
public function merge( array $attributes ) {
		foreach ( $attributes as $name => $value ) {
			$this->set_attribute( $name, $value );
		}

		return $this;
	}
232835
public function setArray(array $array)
    {
        $this->array = array_values($array);
        $this->arraySize = count($this->array);
        $this->rewind();

        return $this;
    }
70242
public function setParams(array $array)
        {
            $this->_params = $this->_params + (array) $array;

            foreach ($array as $key => $value) {
                if (null === $value) {
                    unset($this->_params[$key]);
                }
            }

            return $this;
        }