Skip to content

Commit

Permalink
refactor: Use more iterator aggregates.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 25, 2022
1 parent 7af1d80 commit 669a956
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Operation/Normalize.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

use Closure;
use Generator;
use Iterator;
use loophp\iterators\NormalizeIteratorAggregate;
use loophp\iterators\NormalizeIterableAggregate;

/**
* @immutable
Expand All @@ -25,16 +24,16 @@ final class Normalize extends AbstractOperation
/**
* @pure
*
* @return Closure(Iterator<TKey, T>): Generator<int, T>
* @return Closure(iterable<TKey, T>): Generator<int, T>
*/
public function __invoke(): Closure
{
return
/**
* @param Iterator<TKey, T> $iterator
* @param iterable<TKey, T> $iterable
*
* @return Generator<int, T>
*/
static fn (Iterator $iterator): Generator => yield from new NormalizeIteratorAggregate($iterator);
static fn (iterable $iterable): Generator => yield from new NormalizeIterableAggregate($iterable);
}
}

0 comments on commit 669a956

Please sign in to comment.