Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function groupByModel() |
||
20 | { |
||
21 | return function ($callback, bool $preserveKeys = false, $modelKey = 0, $itemsKey = 1): Collection { |
||
22 | $callback = $this->valueRetriever($callback); |
||
23 | |||
24 | return $this->groupBy(function ($item) use ($callback) { |
||
25 | return $callback($item)->getKey(); |
||
26 | }, $preserveKeys)->map(function (Collection $items) use ($callback, $modelKey, $itemsKey) { |
||
27 | return [ |
||
28 | $modelKey => $callback($items->first()), |
||
29 | $itemsKey => $items, |
||
30 | ]; |
||
31 | })->values(); |
||
32 | }; |
||
33 | } |
||
34 | } |
||
35 |
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.