Skip to content

Commit bfeadb4

Browse files
Improve Generic Type annotations for LazyCollection methods (#55380)
1 parent 0549cba commit bfeadb4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Illuminate/Collections/LazyCollection.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function all()
113113
/**
114114
* Eager load all items into a new lazy collection backed by an array.
115115
*
116-
* @return static
116+
* @return static<TKey, TValue>
117117
*/
118118
public function eager()
119119
{
@@ -123,7 +123,7 @@ public function eager()
123123
/**
124124
* Cache values as they're enumerated.
125125
*
126-
* @return static
126+
* @return static<TKey, TValue>
127127
*/
128128
public function remember()
129129
{
@@ -334,7 +334,7 @@ public function countBy($countBy = null)
334334
* Get the items that are not present in the given items.
335335
*
336336
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
337-
* @return static
337+
* @return static<TKey, TValue>
338338
*/
339339
public function diff($items)
340340
{
@@ -1091,7 +1091,7 @@ public function replaceRecursive($items)
10911091
/**
10921092
* Reverse items order.
10931093
*
1094-
* @return static
1094+
* @return static<TKey, TValue>
10951095
*/
10961096
public function reverse()
10971097
{
@@ -1186,7 +1186,7 @@ public function after($value, $strict = false)
11861186
/**
11871187
* Shuffle the items in the collection.
11881188
*
1189-
* @return static
1189+
* @return static<TKey, TValue>
11901190
*/
11911191
public function shuffle()
11921192
{
@@ -1549,7 +1549,7 @@ public function sortKeysUsing(callable $callback)
15491549
* Take the first or last {$limit} items.
15501550
*
15511551
* @param int $limit
1552-
* @return static
1552+
* @return static<TKey, TValue>
15531553
*/
15541554
public function take($limit)
15551555
{
@@ -1592,7 +1592,7 @@ public function take($limit)
15921592
* Take items in the collection until the given condition is met.
15931593
*
15941594
* @param TValue|callable(TValue,TKey): bool $value
1595-
* @return static
1595+
* @return static<TKey, TValue>
15961596
*/
15971597
public function takeUntil($value)
15981598
{
@@ -1614,7 +1614,7 @@ public function takeUntil($value)
16141614
* Take items in the collection until a given point in time.
16151615
*
16161616
* @param \DateTimeInterface $timeout
1617-
* @return static
1617+
* @return static<TKey, TValue>
16181618
*/
16191619
public function takeUntilTimeout(DateTimeInterface $timeout)
16201620
{
@@ -1639,7 +1639,7 @@ public function takeUntilTimeout(DateTimeInterface $timeout)
16391639
* Take items in the collection while the given condition is met.
16401640
*
16411641
* @param TValue|callable(TValue,TKey): bool $value
1642-
* @return static
1642+
* @return static<TKey, TValue>
16431643
*/
16441644
public function takeWhile($value)
16451645
{
@@ -1653,7 +1653,7 @@ public function takeWhile($value)
16531653
* Pass each item in the collection to the given callback, lazily.
16541654
*
16551655
* @param callable(TValue, TKey): mixed $callback
1656-
* @return static
1656+
* @return static<TKey, TValue>
16571657
*/
16581658
public function tapEach(callable $callback)
16591659
{
@@ -1713,7 +1713,7 @@ public function undot()
17131713
*
17141714
* @param (callable(TValue, TKey): mixed)|string|null $key
17151715
* @param bool $strict
1716-
* @return static
1716+
* @return static<TKey, TValue>
17171717
*/
17181718
public function unique($key = null, $strict = false)
17191719
{

0 commit comments

Comments
 (0)