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