| 1 | <?php |
||
| 17 | class UniqueIterator extends \FilterIterator implements FiniteIterableInterface |
||
| 18 | { |
||
| 19 | use FiniteIterableTrait; |
||
| 20 | |||
| 21 | /** @var \Closure */ |
||
| 22 | private $func; |
||
| 23 | |||
| 24 | /** @var array */ |
||
| 25 | private $seen; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * UniqueIterator constructor. |
||
| 29 | * |
||
| 30 | * @param \Closure $func |
||
| 31 | * @param \Iterator $iterable |
||
| 32 | */ |
||
| 33 | 15 | public function __construct(\Closure $func, \Iterator $iterable) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @{inheritDoc} |
||
| 42 | */ |
||
| 43 | 11 | public function accept() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @{inheritDoc} |
||
| 56 | */ |
||
| 57 | 13 | public function rewind() |
|
| 62 | } |
||
| 63 |