| Conditions | 3 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function rotate() |
||
| 17 | { |
||
| 18 | return function (int $offset): Collection { |
||
| 19 | if ($this->isEmpty()) { |
||
| 20 | return new static; |
||
| 21 | } |
||
| 22 | |||
| 23 | $count = $this->count(); |
||
| 24 | |||
| 25 | $offset %= $count; |
||
| 26 | |||
| 27 | if ($offset < 0) { |
||
| 28 | $offset += $count; |
||
| 29 | } |
||
| 30 | |||
| 31 | return new static($this->slice($offset)->merge($this->take($offset))); |
||
| 32 | }; |
||
| 33 | } |
||
| 34 | } |
||
| 35 |
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.