Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Fix) Call to a member function pluck() on array #3717

Merged
merged 3 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Resources/TorrentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading