Skip to content
New issue

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

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

Already on GitHub? # to your account

[11.x] Fix docblock for collection pluck methods #51295

Merged
merged 1 commit into from
May 5, 2024
Merged

[11.x] Fix docblock for collection pluck methods #51295

merged 1 commit into from
May 5, 2024

Conversation

SanderMuller
Copy link
Contributor

Arr::pluck() allows passing null as the $value, however src/Illuminate/Collections/Collection::pluck() and src/Illuminate/Database/Eloquent/Collection::pluck() don't include null int he docblock for the $value param.

This causes static analysis to report that passing null as the value is not allowed, e.g.:

  304    Parameter #1 $value of method                                                          
         Illuminate\Database\Eloquent\Collection<int,Illuminate\Database\Eloquent\Model>::pluck()  
         expects array<string>|string, null given.

See https://github.com/laravel/framework/blob/11.x/src/Illuminate/Collections/Arr.php#L545 for the Arr::pluck() definition containing null

@SanderMuller SanderMuller changed the title Fix docblock for collection pluck methods [11.x] Fix docblock for collection pluck methods May 5, 2024
@taylorotwell taylorotwell merged commit 2f9a217 into laravel:11.x May 5, 2024
30 checks passed
func0der pushed a commit to func0der/framework that referenced this pull request May 6, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants