| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Spatie\CollectionMacros\Macros; |
||
| 18 | public function groupByModel() |
||
| 19 | { |
||
| 20 | return function ($callback, bool $preserveKeys = false, $modelKey = 0, $itemsKey = 1): Collection { |
||
| 21 | $callback = $this->valueRetriever($callback); |
||
| 22 | |||
| 23 | return $this->groupBy(function ($item) use ($callback) { |
||
| 24 | return $callback($item)->getKey(); |
||
| 25 | }, $preserveKeys)->map(function (Collection $items) use ($callback, $modelKey, $itemsKey) { |
||
| 26 | return [ |
||
| 27 | $modelKey => $callback($items->first()), |
||
| 28 | $itemsKey => $items, |
||
| 29 | ]; |
||
| 30 | })->values(); |
||
| 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.