-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from lptn/pagination-stubs
Add Pagination stubs
- Loading branch information
Showing
8 changed files
with
300 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Illuminate\Contracts\Pagination; | ||
|
||
/** | ||
* @template TItem | ||
*/ | ||
interface Paginator | ||
{ | ||
/** | ||
* @return array<TItem> | ||
*/ | ||
public function items(): array; | ||
} | ||
|
||
/** | ||
* @template TItem | ||
* | ||
* @extends Paginator<TItem> | ||
*/ | ||
interface LengthAwarePaginator extends Paginator | ||
{} | ||
|
||
/** | ||
* @template TItem | ||
*/ | ||
interface CursorPaginator | ||
{ | ||
/** | ||
* @return array<TItem> | ||
*/ | ||
public function items(): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?php | ||
|
||
namespace Illuminate\Pagination; | ||
|
||
/** | ||
* @template TValue | ||
* | ||
* @mixin \Illuminate\Support\Collection<array-key, TValue> | ||
*/ | ||
abstract class AbstractPaginator implements \Illuminate\Contracts\Support\Htmlable | ||
{ | ||
/** | ||
* @return array<TValue> | ||
*/ | ||
public function items(): array {} | ||
|
||
/** | ||
* @return \Illuminate\Support\Collection<array-key, TValue> | ||
*/ | ||
public function getCollection(): \Illuminate\Support\Collection {} | ||
|
||
/** | ||
* @return \ArrayIterator<array-key, TValue> | ||
*/ | ||
public function getIterator(): \Traversable {} | ||
|
||
public function offsetExists(mixed $offset): bool {} | ||
|
||
/** | ||
* @return TValue|null | ||
*/ | ||
public function offsetGet(mixed $offset): mixed {} | ||
|
||
/** | ||
* @param TValue $value | ||
*/ | ||
public function offsetSet(mixed $offset, $value): void {} | ||
|
||
public function offsetUnset(mixed $offset): void {} | ||
} | ||
|
||
/** | ||
* @template TValue | ||
* | ||
* @implements \ArrayAccess<array-key, TValue> | ||
* @implements \IteratorAggregate<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Support\Arrayable<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Pagination\Paginator<TValue> | ||
* | ||
* @extends AbstractPaginator<TValue> | ||
*/ | ||
class Paginator extends AbstractPaginator implements \Illuminate\Contracts\Support\Arrayable, \ArrayAccess, \Countable, \IteratorAggregate, \Illuminate\Contracts\Support\Jsonable, \JsonSerializable, \Illuminate\Contracts\Pagination\Paginator | ||
{} | ||
|
||
/** | ||
* @template TValue | ||
* | ||
* @implements \ArrayAccess<array-key, TValue> | ||
* @implements \IteratorAggregate<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Support\Arrayable<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Pagination\LengthAwarePaginator<TValue> | ||
* | ||
* @extends AbstractPaginator<TValue> | ||
*/ | ||
class LengthAwarePaginator extends AbstractPaginator implements \Illuminate\Contracts\Support\Arrayable, \ArrayAccess, \Countable, \IteratorAggregate, \Illuminate\Contracts\Support\Jsonable, \JsonSerializable, \Illuminate\Contracts\Pagination\LengthAwarePaginator | ||
{} | ||
|
||
/** | ||
* @template TValue | ||
* | ||
* @mixin \Illuminate\Support\Collection<mixed, TValue> | ||
*/ | ||
abstract class AbstractCursorPaginator implements \Illuminate\Contracts\Support\Htmlable | ||
{ | ||
/** | ||
* @return array<TValue> | ||
*/ | ||
public function items(): array {} | ||
|
||
/** | ||
* @return \Illuminate\Support\Collection<array-key, TValue> | ||
*/ | ||
public function getCollection(): \Illuminate\Support\Collection {} | ||
|
||
/** | ||
* @return \ArrayIterator<array-key, TValue> | ||
*/ | ||
public function getIterator(): \Traversable {} | ||
|
||
public function offsetExists(mixed $offset): bool {} | ||
|
||
/** | ||
* @return TValue|null | ||
*/ | ||
public function offsetGet(mixed $offset): mixed {} | ||
|
||
/** | ||
* @param TValue $value | ||
*/ | ||
public function offsetSet(mixed $offset, $value): void {} | ||
|
||
public function offsetUnset(mixed $offset): void {} | ||
} | ||
|
||
/** | ||
* @template TValue | ||
* | ||
* @implements \ArrayAccess<array-key, TValue> | ||
* @implements \IteratorAggregate<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Support\Arrayable<array-key, TValue> | ||
* @implements \Illuminate\Contracts\Pagination\CursorPaginator<TValue> | ||
* | ||
* @extends AbstractCursorPaginator<TValue> | ||
*/ | ||
class CursorPaginator extends AbstractCursorPaginator implements \Illuminate\Contracts\Support\Arrayable, \ArrayAccess, \Countable, \IteratorAggregate, \Illuminate\Contracts\Support\Jsonable, \JsonSerializable, \Illuminate\Contracts\Pagination\CursorPaginator | ||
{} | ||
|
||
/** | ||
* @implements \Illuminate\Contracts\Support\Arrayable<array-key, mixed> | ||
*/ | ||
class Cursor implements \Illuminate\Contracts\Support\Arrayable | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.