Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke() { |
||
20 | return function ($callback, bool $preserveKeys = false, $modelKey = 0, $itemsKey = 1): Collection { |
||
21 | $callback = $this->valueRetriever($callback); |
||
|
|||
22 | |||
23 | return $this->groupBy(function ($item) use ($callback) { |
||
24 | return $callback($item)->getKey(); |
||
25 | }, $preserveKeys)->map(function (Collection $items) use ($callback, $modelKey, $itemsKey) { |
||
26 | return [ |
||
27 | $modelKey => $callback($items->first()), |
||
28 | $itemsKey => $items, |
||
29 | ]; |
||
30 | })->values(); |
||
31 | }; |
||
32 | } |
||
33 | } |
||
34 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.