Skip to content

Use Generic Types Annotations for LazyCollection Methods #55380

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

Merged
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
22 changes: 11 additions & 11 deletions src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function all()
/**
* Eager load all items into a new lazy collection backed by an array.
*
* @return static
* @return static<TKey, TValue>
*/
public function eager()
{
Expand All @@ -123,7 +123,7 @@ public function eager()
/**
* Cache values as they're enumerated.
*
* @return static
* @return static<TKey, TValue>
*/
public function remember()
{
Expand Down Expand Up @@ -334,7 +334,7 @@ public function countBy($countBy = null)
* Get the items that are not present in the given items.
*
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
* @return static
* @return static<TKey, TValue>
*/
public function diff($items)
{
Expand Down Expand Up @@ -1091,7 +1091,7 @@ public function replaceRecursive($items)
/**
* Reverse items order.
*
* @return static
* @return static<TKey, TValue>
*/
public function reverse()
{
Expand Down Expand Up @@ -1186,7 +1186,7 @@ public function after($value, $strict = false)
/**
* Shuffle the items in the collection.
*
* @return static
* @return static<TKey, TValue>
*/
public function shuffle()
{
Expand Down Expand Up @@ -1549,7 +1549,7 @@ public function sortKeysUsing(callable $callback)
* Take the first or last {$limit} items.
*
* @param int $limit
* @return static
* @return static<TKey, TValue>
*/
public function take($limit)
{
Expand Down Expand Up @@ -1592,7 +1592,7 @@ public function take($limit)
* Take items in the collection until the given condition is met.
*
* @param TValue|callable(TValue,TKey): bool $value
* @return static
* @return static<TKey, TValue>
*/
public function takeUntil($value)
{
Expand All @@ -1614,7 +1614,7 @@ public function takeUntil($value)
* Take items in the collection until a given point in time.
*
* @param \DateTimeInterface $timeout
* @return static
* @return static<TKey, TValue>
*/
public function takeUntilTimeout(DateTimeInterface $timeout)
{
Expand All @@ -1639,7 +1639,7 @@ public function takeUntilTimeout(DateTimeInterface $timeout)
* Take items in the collection while the given condition is met.
*
* @param TValue|callable(TValue,TKey): bool $value
* @return static
* @return static<TKey, TValue>
*/
public function takeWhile($value)
{
Expand All @@ -1653,7 +1653,7 @@ public function takeWhile($value)
* Pass each item in the collection to the given callback, lazily.
*
* @param callable(TValue, TKey): mixed $callback
* @return static
* @return static<TKey, TValue>
*/
public function tapEach(callable $callback)
{
Expand Down Expand Up @@ -1713,7 +1713,7 @@ public function undot()
*
* @param (callable(TValue, TKey): mixed)|string|null $key
* @param bool $strict
* @return static
* @return static<TKey, TValue>
*/
public function unique($key = null, $strict = false)
{
Expand Down
Loading