|
364 | 364 |
|
365 | 365 | return false; |
366 | 366 | }, 'string')); |
| 367 | +assertType('string|User', $collection->first(null, function () { |
| 368 | + return 'string'; |
| 369 | +})); |
367 | 370 |
|
368 | 371 | assertType('Illuminate\Support\Collection<int, mixed>', $collection->flatten()); |
369 | 372 | assertType('Illuminate\Support\Collection<int, mixed>', $collection::make(['string' => 'string'])->flatten(4)); |
|
412 | 415 | assertType('string|User', $collection->last(function () { |
413 | 416 | return true; |
414 | 417 | }, 'string')); |
| 418 | +assertType('string|User', $collection->last(null, function () { |
| 419 | + return 'string'; |
| 420 | +})); |
415 | 421 |
|
416 | 422 | assertType('Illuminate\Support\Collection<int, int>', $collection->map(function () { |
417 | 423 | return 1; |
|
772 | 778 |
|
773 | 779 | assertType('User|null', $collection->get(0)); |
774 | 780 | assertType('string|User', $collection->get(0, 'string')); |
| 781 | +assertType('string|User', $collection->get(0, function () { |
| 782 | + return 'string'; |
| 783 | +})); |
775 | 784 |
|
776 | 785 | assertType('Illuminate\Support\Collection<int, User>', $collection->forget(1)); |
777 | 786 | assertType('Illuminate\Support\Collection<int, User>', $collection->forget([1, 2])); |
|
790 | 799 |
|
791 | 800 | assertType('User|null', $collection->pull(1)); |
792 | 801 | assertType('string|User', $collection->pull(1, 'string')); |
| 802 | +assertType('string|User', $collection->pull(1, function () { |
| 803 | + return 'string'; |
| 804 | +})); |
793 | 805 |
|
794 | 806 | assertType('Illuminate\Support\Collection<int, User>', $collection->put(1, new User)); |
795 | 807 | assertType('Illuminate\Support\Collection<string, string>', $collection::make([ |
|
0 commit comments