Skip to content

Commit

Permalink
Support $paginator->all() and other Collection methods
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgaal committed Oct 18, 2022
1 parent f040642 commit 0113ab8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Type/data/paginator-extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
use function PHPStan\Testing\assertType;

assertType('Illuminate\Pagination\LengthAwarePaginator<App\User>', User::paginate());
assertType('array<App\User>', User::paginate()->all());
assertType('array<App\User>', User::paginate()->items());

assertType('Illuminate\Pagination\Paginator<App\User>', User::simplePaginate());
assertType('array<App\User>', User::simplePaginate()->all());
assertType('array<App\User>', User::simplePaginate()->items());

assertType('Illuminate\Pagination\CursorPaginator<App\User>', User::cursorPaginate());
assertType('array<App\User>', User::cursorPaginate()->all());
assertType('array<App\User>', User::cursorPaginate()->items());

assertType('ArrayIterator<(int|string), App\User>', User::query()->paginate()->getIterator());
Expand Down

0 comments on commit 0113ab8

Please sign in to comment.