Skip to content

Commit 6809eef

Browse files
authored
[9.x] Fix (widen) PHPDoc parameter typehint for EnumeratesValues::reject() (#45139)
* Widen parameter typehint for `EnumeratesValues::reject()` * Add type test
1 parent 607d786 commit 6809eef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ class_basename(static::class), gettype($result)
765765
/**
766766
* Create a collection of all elements that do not pass a given truth test.
767767
*
768-
* @param (callable(TValue, TKey): bool)|bool $callback
768+
* @param (callable(TValue, TKey): bool)|bool|TValue $callback
769769
* @return static
770770
*/
771771
public function reject($callback = true)

types/Support/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ function ($collection, $count) {
855855
assertType('Illuminate\Support\Collection<int, mixed>', $collection->make(['string' => 'string'])->pluck('string', 'string'));
856856

857857
assertType('Illuminate\Support\Collection<int, User>', $collection->reject());
858+
assertType('Illuminate\Support\Collection<int, User>', $collection->reject(new User));
858859
assertType('Illuminate\Support\Collection<int, User>', $collection->reject(function ($user) {
859860
assertType('User', $user);
860861

0 commit comments

Comments
 (0)