diff --git a/app/Http/Resources/TorrentResource.php b/app/Http/Resources/TorrentResource.php index 223c7e413f..f8a4a634f0 100644 --- a/app/Http/Resources/TorrentResource.php +++ b/app/Http/Resources/TorrentResource.php @@ -31,7 +31,7 @@ public function toArray($request): array 'attributes' => [ 'meta' => [ 'poster' => isset($this->meta->poster) ? tmdb_image('poster_small', $this->meta->poster) : 'https://via.placeholder.com/90x135', - 'genres' => isset($this->meta->genres) ? $this->meta->genres->pluck('name')->implode(', ') : '', + 'genres' => isset($this->meta->genres) ? collect($this->meta->genres)->pluck('name')->implode(', ') : '', ], 'name' => $this->name, 'release_year' => $this->release_year, diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1d1f0cdfed..906a2a40ca 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1275,6 +1275,16 @@ parameters: count: 1 path: app/Http/Resources/TorrentResource.php + - + message: "#^Unable to resolve the template type TKey in call to function collect$#" + count: 1 + path: app/Http/Resources/TorrentResource.php + + - + message: "#^Unable to resolve the template type TValue in call to function collect$#" + count: 1 + path: app/Http/Resources/TorrentResource.php + - message: "#^Method App\\\\Http\\\\Resources\\\\TorrentsResource\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1