1 | <?php |
||
17 | class MapIterator extends \MultipleIterator implements FiniteIterableInterface |
||
18 | { |
||
19 | use FiniteIterableTrait; |
||
20 | |||
21 | /** @var \Closure */ |
||
22 | private $valueFunc; |
||
23 | |||
24 | /** @var \Closure */ |
||
25 | private $keyFunc; |
||
26 | |||
27 | /** |
||
28 | * MapIterator constructor. |
||
29 | * |
||
30 | * @param \Closure $valueFunc |
||
31 | */ |
||
32 | 72 | public function __construct(\Closure $valueFunc /* [\Closure $keyFunc], \Iterator $iterable1, [\Iterator $iterable2, [...]] */) |
|
54 | |||
55 | /** |
||
56 | * Compute the key for an element |
||
57 | * |
||
58 | * When multiple iterables are given, the key for an element is computed by taking |
||
59 | * the keys of the element of all iterables, when they are the same, this key is used, |
||
60 | * otherwise a compound key is created by concatenating the keys together. |
||
61 | * |
||
62 | * @param array $keysAndValues |
||
63 | * @return mixed |
||
64 | */ |
||
65 | 65 | protected function genericKeysToKey($keysAndValues) |
|
92 | |||
93 | /** |
||
94 | * @{inheritDoc} |
||
95 | */ |
||
96 | 66 | public function current() |
|
100 | |||
101 | /** |
||
102 | * @{inheritDoc} |
||
103 | */ |
||
104 | 66 | public function key() |
|
108 | |||
109 | /** |
||
110 | * @{inheritDoc} |
||
111 | */ |
||
112 | 66 | public function next() |
|
116 | } |
||
117 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.