for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace loophp\iterators;
use AppendIterator;
use Generator;
use IteratorAggregate;
use NoRewindIterator;
* @template TKey
* @template T
*
* @implements IteratorAggregate<TKey, T>
final class ConcatIterableAggregate implements IteratorAggregate
{
* @param iterable<mixed, iterable<TKey, T>> $iterables
public function __construct(private iterable $iterables)
}
* @return Generator<TKey, T>
public function getIterator(): Generator
$iterator = new AppendIterator();
foreach ($this->iterables as $iterable) {
$iterator->append(
new NoRewindIterator((new IterableIteratorAggregate($iterable))->getIterator())
);
yield from $iterator;