1 | <?php |
||
14 | class CursorArgs |
||
15 | { |
||
16 | /** |
||
17 | * @var Cursor |
||
18 | */ |
||
19 | public $cursor; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | public $first; |
||
25 | |||
26 | /** |
||
27 | * Create a new instance from user given args. |
||
28 | * |
||
29 | * @param mixed[] $args |
||
30 | * @param \Nuwave\Lighthouse\Pagination\PaginationType|null $paginationType |
||
31 | * @return static |
||
32 | * |
||
33 | * @throws \GraphQL\Error\Error |
||
34 | */ |
||
35 | public static function extractArgs(array $args, ?PaginationType $paginationType, ?int $paginateMaxCount): self |
||
64 | |||
65 | public static function requestedZeroOrLessItems(int $amount): string |
||
69 | |||
70 | public static function requestedTooManyItems(int $maxCount, int $actualCount): string |
||
74 | |||
75 | public static function scoutBuilderNotSupported(): string |
||
79 | |||
80 | /** |
||
81 | * Apply the args to a builder, constructing a paginator. |
||
82 | * |
||
83 | * @param \Illuminate\Database\Query\Builder|\Laravel\Scout\Builder|\Illuminate\Database\Eloquent\Relations\Relation $builder |
||
84 | */ |
||
85 | public function applyToBuilder($builder): CursorPaginator |
||
95 | } |
||
96 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: