| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | 5 | public function getRecentViews(array|string|null $types = null): Collection |
|
| 22 | { |
||
| 23 | 5 | $query = $this->recentViews(); |
|
| 24 | 5 | if (!is_null($types)) { |
|
| 25 | 4 | $query->whereIn('type', (array) $types); |
|
| 26 | } |
||
| 27 | |||
| 28 | 5 | return $query->get()->pluck('views', 'type')->map(fn ($views) => json_decode($views, true)); |
|
| 29 | } |
||
| 43 |