1 | <?php |
||
7 | trait MapTrait |
||
8 | { |
||
9 | /** |
||
10 | * Tranforms each element into something else using a callback |
||
11 | * (rough equivalent of array_map()). |
||
12 | * |
||
13 | * The callback should return the new element. |
||
14 | * |
||
15 | * To also change the key, return<code>p()->emit($key,$value)</code> |
||
16 | * <code> |
||
17 | * p()->map(function ($value, $key, $iterator) { |
||
18 | * return p()->emit($key.'_new', $value); |
||
19 | * }); |
||
20 | * |
||
21 | * |
||
22 | * @param callable $callback |
||
|
|||
23 | * |
||
24 | * @return \Pipes\Pipe |
||
25 | */ |
||
26 | public function map(callable $______callback) |
||
58 | } |
||
59 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.