Merge a given array or a Dot object with the given key
or with the whole Dot object

@param array|string|self $key
@param array             $value
165220
public function merge($key, $value = null)
    {
        if (is_array($key)) {
            $this->elements = array_merge($this->elements, $key);
        } elseif (is_string($key)) {
            $items = (array) $this->get($key);
            $value = array_merge($items, $this->getArrayItems($value));
            $this->set($key, $value);
        } elseif ($key instanceof self) {
            $this->elements = array_merge($this->elements, $key->all());
        }
    }
475597
public function append($value, $key = null): Arrayy
    {
        $this->checkTypeWrapper($value);

        return parent::append($value, $key);
    }
1078606
public static function prepend($array, $value, $key = null)
    {
        if (is_null($key)) {
            array_unshift($array, $value);
        } else {
            $array = [$key => $value] + $array;
        }

        return $array;
    }
712016
public static function set( & $array, $key, $value)
	{
		if(is_null($key))
		{
			return $array = $value;
		}

		if(strpos($key, ".") !== false)
		{
			for( $i = 0, $keys = explode('.', $key), $count = count($keys); $i < $count; $i++ )
			{
				$key = $keys[$i];
				if( $i + 1 == $count )
				{
					break;
				}

				// If the key doesn't exist at this depth, we will just create an empty array
				// to hold the next value, allowing us to create the arrays to hold final
				// values at the correct depth. Then we'll keep digging into the array.
				if(! isset($array[$key]) || ! is_array($array[$key]))
				{
					$array[$key] = [];
				}

				$array = & $array[$key];
			}
		}

		$array[$key] = $value;

		return $array;
	}
1210699
private function mergeAttributes($key, $value)
    {
        $this->dirty = true;
        $this->attributes[$key] = $value;

        return $this;
    }
389960
public function with( $key, $value = null ) {
		if ( is_array( $key ) ) {
			$this->context = array_merge( $this->getContext(), $key );
		} else {
			$this->context[ $key ] = $value;
		}
		return $this;
	}
668754
public function append( $key, $value ) {

		if ( !$this->has( $key ) ) {
			$this->data[$key] = array();
		}

		if ( !is_array( $value ) ) {
			 $value = array( $value );
		}

		$this->data[$key] = array_merge(
			(array)$this->data[$key],
			$value
		);
	}
709296
public function append($value, $key = null): self
    {
        $this->generatorToArray();

        if ($key !== null) {
            if (
                isset($this->array[$key])
                &&
                \is_array($this->array[$key])
            ) {
                $this->array[$key][] = $value;
            } else {
                $this->array[$key] = $value;
            }
        } else {
            $this->array[] = $value;
        }

        return $this;
    }
960552
private function setValue(array $arrayToSet, $key, $value) {
        if ($value <> '') {
            return array_merge($arrayToSet, [$key => $value]);
        }
        return $arrayToSet;
    }
1000107
public function set(string $key, $value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }
        $this->normSet($key, $value);
    }
121605
public function set_config($key, $value = null)
	{
		if (is_array($key))
		{
			$this->config = \Arr::merge($this->config, $key);
		}
		else
		{
			\Arr::set($this->config, $key, $value);
		}

		return $this;
	}
1198646
public function set(string $key, $value): self
    {
        $this->data[$key] = $value;

        return $this;
    }
143892
public function add($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $innerKey => $innerValue) {
                Arr::set($this->variables, $innerKey, $innerValue);
            }
        } elseif ($key instanceof Closure) {
            $this->variables[] = $key;
        } else {
            Arr::set($this->variables, $key, $value);
        }

        return $this;
    }
1372540
public function set($key, $value = null)
    {
        if (is_array($key)) {
            $this->global_data = array_merge($this->global_data, $key);
        } else {
            $this->global_data[$key] = $value;
        }

        return $this;
    }
730345
public function store($key, $value)
    {

        if (!is_array($value)) {
            $value = array($key => $value);
        } else {
            $value = array_dot($value);

            foreach ($value as $k => $v) {
                $value[$key . '.' . $k] = $v;
                unset($value[$k]);
            }
        }

        foreach ($value as $k => $v) {
            $this->_store($k, $v);
        }

    }
507124
public function setData($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $key => $value) {
                if (!is_array($value) && !is_object($value)) {
                    $this->$key = $value;
                }
            }
        } else {
            $this->$key = $value;
        }

        return $this;
    }
1207324
public function add(string $key, $value)
    {
        $current = $this->get($key, []);
        $adds = is_array($value) ? $value : [$value];
        $this->set($key, array_merge($current, array_values($adds)));
    }