| Conditions | 4 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function eachCons() |
||
| 18 | { |
||
| 19 | return function (int $chunkSize, bool $preserveKeys = false): Collection { |
||
| 20 | $size = $this->count() - $chunkSize + 1; |
||
| 21 | $result = collect(range(0, $size))->reduce(function ($result, $index) use ($chunkSize, $preserveKeys) { |
||
| 22 | $next = $this->slice($index, $chunkSize); |
||
| 23 | |||
| 24 | return $next->count() === $chunkSize ? $result->push($preserveKeys ? $next : $next->values()) : $result; |
||
| 25 | }, new static([])); |
||
| 26 | |||
| 27 | return $preserveKeys ? $result : $result->values(); |
||
| 28 | }; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.