1 | <?php |
||
5 | final class MapIterator implements \Iterator |
||
6 | { |
||
7 | /** |
||
8 | * @var \Iterator |
||
9 | */ |
||
10 | private $wrappedIterator; |
||
11 | |||
12 | /** |
||
13 | * @var callable |
||
14 | */ |
||
15 | private $map; |
||
16 | |||
17 | /** |
||
18 | * @param \Iterator $wrappedIterator |
||
19 | * @param callable $map |
||
20 | */ |
||
21 | 5 | public function __construct(\Iterator $wrappedIterator, callable $map) |
|
26 | |||
27 | /** |
||
28 | * {@inheritDoc} |
||
29 | */ |
||
30 | 1 | public function current() |
|
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | 1 | public function next() |
|
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | 1 | public function key() |
|
52 | |||
53 | /** |
||
54 | * {@inheritDoc} |
||
55 | */ |
||
56 | 1 | public function valid() |
|
60 | |||
61 | /** |
||
62 | * {@inheritDoc} |
||
63 | */ |
||
64 | 1 | public function rewind() |
|
68 | } |
||
69 |