merge

@return static;
489813
public function merge()
    {
        $args = func_get_args();

        foreach ($args as $arg) {
            if (!($arg instanceof \SplPriorityQueue)) {
                throw new \InvalidArgumentException('Only \SplPriorityQueue can merge.');
            }

            $queue = clone $arg;

            $queue->setExtractFlags(self::EXTR_BOTH);

            foreach ($queue as $item) {
                $this->insert($item['data'], $item['priority']);
            }
        }

        return $this;
    }
952919
public function merge( array $members )
    {
        foreach( $members as $offset => $value ) {
            $this->offsetSet( $offset, $value );
        }
        return $this;
    }
1325665
public function merge()
    {
        $array = $this->getResult();
        foreach ($array as $key => $value) {
            $value['name'] = $value['0'];
            $value['type'] = $value['1'];
            $value['key'] = $value['0'].' :';
            $value['value'] = '';
            unset($value['1']);
            unset($value['0']);
            $this->result[] = $value;
        }

        return $this->result;
    }
1248454
public function merge(Condition $condition)
    {
        $this->expressions = array_merge($this->expressions, $condition->toArray());

        return $this;
    }
518170
public static function merge(): array
    {
        $arguments = [];
        foreach (func_get_args() as $key => $val) {
            if (!Any::isArray($val)) {
                $val = [];
            }

            $arguments[$key] = $val;
        }
        return call_user_func_array('array_merge', $arguments);
    }
194080
public function merge($data)
    {

        if ($data instanceof DedicatedPlayer) {
            $data = $data->toArray();
        }

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

        return $this;
    }
1282708
public function merge(array $data)
    {
        $this->isMergingWidgetData = true;

        $data = $this->setCoreData($data);

        $this->mergePropertyData($data);

        $this->isMergingWidgetData = false;

        return $this;
    }
178409
protected function mergeInheritedDependencies()
    {
        $reflection = new \ReflectionClass($this->class);

        $inheritance = $reflection->getInterfaceNames();
        $class = $reflection;

        while ($parent = $class->getParentClass()) {
            $inheritance[] = $parent->getName();
            $class = $parent;
        }

        foreach ($inheritance as $interface) {
            $interface = $this->container->getRaw($interface);
            if ($interface instanceof static and $interface->inherit()) {
                $this->addArgs($interface->getArgs());
                $this->withMethods($interface->getMethods());
            }
        }
    }
424189
public function merge()
    {
        $marged = NULL;
        foreach (func_get_args() as $arg) {
            // first is override.
            if ($marged === null) {
                $marged = $arg;

            // when mismatch variable type, then override.
            } elseif (gettype($marged) !== gettype($arg)) {
                $marged = $arg;

            // when not array, then override.
            } elseif (! is_array($arg)) {
                $marged = $arg;

            // when both array, then merge recursive.
            } else {
                foreach ($arg as $_key => $_val) {
                    // when int key, then push.
                    if(is_int($_key)) {
                        $marged[] = $_val;
                    // when not exists key, then override.
                    } elseif(! isset($marged[$_key])) {
                        $marged[$_key] = $_val;
                    // merge.
                    } else {
                        $marged[$_key] = $this->merge($marged[$_key], $_val);
                    }
                }
            }
        }
        return $marged;
    }
159217
public function mergeWith(self $objects): self
    {
        $clone = clone $this;
        foreach ($objects->objects as $reference => $object) {
            $clone->objects[$reference] = $object;
            $clone->array[$reference] = $object->getInstance();
        }
        
        return $clone;
    }
321852
public static function extendDistinct()
    {
        $merged = [];

        foreach (func_get_args() as $array) {
            foreach ($array as $key => $value) {
                if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
                    if (static::isAssoc($value) && static::isAssoc($merged[$key])) {
                        $merged[$key] = static::extendDistinct($merged[$key], $value);

                        continue;
                    }
                }

                $merged[$key] = $value;
            }
        }

        return $merged;
    }
1078048
public function merge(self $adapterManager): self
    {
        foreach ($adapterManager->getAdapters() as $adapterTmp => $callableFunctionTmp) {
            $this->validateAdapter($adapterTmp);
            $this->validateCallable($callableFunctionTmp);

            $key = \array_search($adapterTmp, $this->adapter, true);

            if ($key) {
                $this->adapter[$key] = $adapterTmp;
                $this->callableFunctions[$key] = $callableFunctionTmp;
            } else {
                $this->adapter[] = $adapterTmp;
                $this->callableFunctions[] = $callableFunctionTmp;
            }
        }

        return $this;
    }
977407
public static function merge($left, $right)
	{
		if (is_array($left) && is_array($right)) {
			foreach ($left as $key => $val) {
				if (is_int($key)) {
					$right[] = $val;
				} else {
					if (isset($right[$key])) {
						$val = static::merge($val, $right[$key]);
					}
					$right[$key] = $val;
				}
			}

			return $right;

		} elseif ($left === NULL && is_array($right)) {
			return $right;

		} else {
			return $left;
		}
	}
626841
public function collapse()
    {
        $results = [];

        foreach ($this->array as $item) {
            if (!is_array($item)) {
                continue;
            }

            $results = array_merge($results, $item);
        }

        return new static($results);
    }
897939
public static function extend(): array
    {
        $merged = [];

        foreach (func_get_args() as $array) {
            foreach ($array as $key => $value) {
                if (is_array($value) && static::has($merged, $key) && is_array($merged[$key])) {
                    $merged[$key] = static::extend($merged[$key], $value);
                } else {
                    $merged[$key] = $value;
                }
            }
        }

        return $merged;
    }
988930
public function merge(array $values)
    {
        foreach ($values as $key => $value) {
            $this->set($key, $value, ['strict' => false]);
        }

        return $this;
    }
299557
public function merge(iterable $options): self
	{
		$merged = clone $this;

		foreach ($options as $option => $value) {
			$this->assertOptionName($option);
			$merged->{'set'.ucfirst($option)}($value);
		}

		return $merged;
	}