src/GeneratorCollection.php
public function append($items, bool $preserveKeys = true): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($items, $preserveKeys) {
            $lists = [$data, self::make($items)];

            foreach ($lists as $list) {
                foreach ($list as $key => $item) {
                    if ($preserveKeys) {
                        yield $key => $item;
                    } else {
                        yield $item;
                    }
                }
            }
        });
    }
public function append($items, bool $preserveKeys = true): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($items, $preserveKeys) {
            $lists = [$data, self::make($items)];

            foreach ($lists as $list) {
                foreach ($list as $key => $item) {
                    if ($preserveKeys) {
                        yield $key => $item;
                    } else {
                        yield $item;
                    }
                }
            }
        });
    }
public function append ( $ items , bool $ preserveKeys = true ) : CollectionInterface { return $ this -> wrap ( function ( Iterator $ data ) use ( $ items , $ preserveKeys ) { $ lists = [ $ data , self :: make ( $ items ) ] ; foreach ( $ lists as $ list ) { foreach ( $ list as $ key => $ item ) { if ( $ preserveKeys ) { yield $ key => $ item ; } else { yield $ item ; } } } } ) ; }
Append items onto this collection

@param mixed $items
@param bool $preserveKeys
@return \Buttress\Collection\CollectionInterface
Append items onto this collection