src/Collection.php
public function merge($items)
    {
        if ($items instanceof CollectionInterface) {
            $items = $items->toArray();
        }

        if (!is_array($items)) {
            throw new InvalidArgumentException('Merge must be given array or Collection');
        }

        $this->validateItems($items, $this->type);
        $newItems = array_merge($this->items, $items);

        $col = new static ($this->type);
        $col->setItemsFromTrustedSource($newItems);

        return $col;
    }
public function merge($items)
    {
        if ($items instanceof CollectionInterface) {
            $items = $items->toArray();
        }

        if (!is_array($items)) {
            throw new InvalidArgumentException('Merge must be given array or Collection');
        }

        $this->validateItems($items, $this->type);
        $newItems = array_merge($this->items, $items);

        $col = new static ($this->type);
        $col->setItemsFromTrustedSource($newItems);

        return $col;
    }
public function merge ( $ items ) { if ( $ items instanceof CollectionInterface ) { $ items = $ items -> toArray ( ) ; } if ( ! is_array ( $ items ) ) { throw new InvalidArgumentException ( 'Merge must be given array or Collection' ) ; } $ this -> validateItems ( $ items , $ this -> type ) ; $ newItems = array_merge ( $ this -> items , $ items ) ; $ col = new static ( $ this -> type ) ; $ col -> setItemsFromTrustedSource ( $ newItems ) ; return $ col ; }
{@inheritdoc}
{