Conditions | 5 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke() { |
||
20 | return function ($key, bool $preserveKeys = false, $sectionKey = 0, $itemsKey = 1): Collection { |
||
21 | $sectionNameRetriever = $this->valueRetriever($key); |
||
|
|||
22 | |||
23 | $results = new Collection(); |
||
24 | |||
25 | foreach ($this->items as $key => $value) { |
||
26 | $sectionName = $sectionNameRetriever($value); |
||
27 | |||
28 | if (! $results->last() || $results->last()->get($sectionKey) !== $sectionName) { |
||
29 | $results->push(new Collection([ |
||
30 | $sectionKey => $sectionName, |
||
31 | $itemsKey => new Collection(), |
||
32 | ])); |
||
33 | } |
||
34 | |||
35 | $results->last()->get($itemsKey)->offsetSet($preserveKeys ? $key : null, $value); |
||
36 | } |
||
37 | |||
38 | return $results; |
||
39 | }; |
||
40 | } |
||
41 | } |
||
42 |
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.