From fcd058f3671d0e37ff06cc5f0c868330624e9a96 Mon Sep 17 00:00:00 2001 From: Takayasu Oyama Date: Fri, 31 Jan 2025 17:13:23 +0900 Subject: [PATCH] [11.x] add Generics to Paginator's array access methods (#54428) --- .../Pagination/AbstractCursorPaginator.php | 12 ++++++------ src/Illuminate/Pagination/AbstractPaginator.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Illuminate/Pagination/AbstractCursorPaginator.php b/src/Illuminate/Pagination/AbstractCursorPaginator.php index 5f3322f75964..af82cc07198b 100644 --- a/src/Illuminate/Pagination/AbstractCursorPaginator.php +++ b/src/Illuminate/Pagination/AbstractCursorPaginator.php @@ -601,7 +601,7 @@ public function getOptions() /** * Determine if the given item exists. * - * @param mixed $key + * @param TKey $key * @return bool */ public function offsetExists($key): bool @@ -612,8 +612,8 @@ public function offsetExists($key): bool /** * Get the item at the given offset. * - * @param mixed $key - * @return mixed + * @param TKey $key + * @return TValue */ public function offsetGet($key): mixed { @@ -623,8 +623,8 @@ public function offsetGet($key): mixed /** * Set the item at the given offset. * - * @param mixed $key - * @param mixed $value + * @param TKey|null $key + * @param TValue $value * @return void */ public function offsetSet($key, $value): void @@ -635,7 +635,7 @@ public function offsetSet($key, $value): void /** * Unset the item at the given key. * - * @param mixed $key + * @param TKey $key * @return void */ public function offsetUnset($key): void diff --git a/src/Illuminate/Pagination/AbstractPaginator.php b/src/Illuminate/Pagination/AbstractPaginator.php index 58113ed6db92..c746f93d86cc 100644 --- a/src/Illuminate/Pagination/AbstractPaginator.php +++ b/src/Illuminate/Pagination/AbstractPaginator.php @@ -726,7 +726,7 @@ public function getOptions() /** * Determine if the given item exists. * - * @param mixed $key + * @param TKey $key * @return bool */ public function offsetExists($key): bool @@ -737,8 +737,8 @@ public function offsetExists($key): bool /** * Get the item at the given offset. * - * @param mixed $key - * @return mixed + * @param TKey $key + * @return TValue */ public function offsetGet($key): mixed { @@ -748,8 +748,8 @@ public function offsetGet($key): mixed /** * Set the item at the given offset. * - * @param mixed $key - * @param mixed $value + * @param TKey|null $key + * @param TValue $value * @return void */ public function offsetSet($key, $value): void @@ -760,7 +760,7 @@ public function offsetSet($key, $value): void /** * Unset the item at the given key. * - * @param mixed $key + * @param TKey $key * @return void */ public function offsetUnset($key): void