Conditions | 4 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke() |
||
20 | { |
||
21 | return function (int $chunkSize, bool $preserveKeys = false): Collection { |
||
22 | $size = $this->count() - $chunkSize + 1; |
||
|
|||
23 | $result = collect(range(0, $size))->reduce(function ($result, $index) use ($chunkSize, $preserveKeys) { |
||
24 | $next = $this->slice($index, $chunkSize); |
||
25 | |||
26 | return $next->count() === $chunkSize ? $result->push($preserveKeys ? $next : $next->values()) : $result; |
||
27 | }, new static([])); |
||
28 | |||
29 | return $preserveKeys ? $result : $result->values(); |
||
30 | }; |
||
31 | } |
||
32 | } |
||
33 |
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.