Skip to content

Commit

Permalink
fix: pagination generics
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Feb 13, 2025
1 parent f21afbc commit 77f66ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/Illuminate/Pagination/AbstractCursorPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function count(): int
/**
* Get the paginator's underlying collection.
*
* @return \Illuminate\Support\Collection
* @return \Illuminate\Support\Collection<TKey, TValue>
*/
public function getCollection()
{
Expand All @@ -578,8 +578,13 @@ public function getCollection()
/**
* Set the paginator's underlying collection.
*
* @param \Illuminate\Support\Collection $collection
* @template TSetKey of array-key
* @template TSetValue
*
* @param \Illuminate\Support\Collection<TSetKey, TSetValue> $collection
* @return $this
*
* @phpstan-this-out static<TSetKey, TSetValue>
*/
public function setCollection(Collection $collection)
{
Expand Down Expand Up @@ -613,7 +618,7 @@ public function offsetExists($key): bool
* Get the item at the given offset.
*
* @param TKey $key
* @return TValue
* @return TValue|null
*/
public function offsetGet($key): mixed
{
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Pagination/AbstractPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ public function offsetExists($key): bool
* Get the item at the given offset.
*
* @param TKey $key
* @return TValue
* @return TValue|null
*/
public function offsetGet($key): mixed
{
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Pagination/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Collection;
use UnexpectedValueException;

/** @implements Arrayable<array-key, mixed> */
class Cursor implements Arrayable
{
/**
Expand Down

0 comments on commit 77f66ed

Please sign in to comment.