1 | <?php |
||
13 | trait MapTrait |
||
14 | { |
||
15 | /** |
||
16 | * Make an iterator that applies $strategy to every entry in this iterable |
||
17 | * |
||
18 | * If additional iterables are passed, $strategy is called for each entry |
||
19 | * in the $iterable, where the first argument is the value and the |
||
20 | * second argument is the key of the entry |
||
21 | * |
||
22 | * If additional iterables are passed, $strategy is called with the |
||
23 | * values and the keys from the iterables. For example, the first |
||
24 | * call to $strategy will be: |
||
25 | * $strategy($value_iterable1, $value_iterable2, $key_iterable2, $key_iterable2) |
||
26 | * |
||
27 | * With multiple iterables, the iterator stops when the shortest |
||
28 | * iterable is exhausted. |
||
29 | * |
||
30 | * > $minimal = function ($value) { return min(3, $value); }; |
||
31 | * > iter\iterable([1, 2, 3, 4])->map($minimal); |
||
32 | * 3 3 3 4 |
||
33 | * |
||
34 | * > $average = function ($value1, $value2) { return ($value1 + $value2) / 2; }; |
||
35 | * > iter\iterable([1, 2, 3])->map($average, [4, 5, 6]); |
||
36 | * 2.5 3.5 4.5 |
||
37 | * |
||
38 | * @param null|string|\Closure $strategy |
||
39 | * @param array|string|\Iterator $iterable |
||
|
|||
40 | * @param array|string|\Iterator $iterable2 |
||
41 | * @return MapIterator |
||
42 | */ |
||
43 | 86 | public function map($strategy /*, $iterable, $iterable2, ... */) |
|
62 | } |
||
63 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.