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