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