File tree Expand file tree Collapse file tree 3 files changed +4
-65
lines changed Expand file tree Collapse file tree 3 files changed +4
-65
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
use Tobyz \JsonApiServer \Endpoint \ProvidesParameters ;
10
10
use Tobyz \JsonApiServer \Endpoint \ProvidesResourceMeta ;
11
11
use Tobyz \JsonApiServer \Exception \Sourceable ;
12
- use Tobyz \JsonApiServer \Pagination \Concerns \HasSizeParameter ;
13
12
use Tobyz \JsonApiServer \Resource \CursorPaginatable ;
14
13
use Tobyz \JsonApiServer \Schema \Link ;
15
14
use Tobyz \JsonApiServer \Schema \Meta ;
@@ -23,13 +22,10 @@ class CursorPagination implements
23
22
ProvidesDocumentLinks,
24
23
ProvidesResourceMeta
25
24
{
26
- use HasSizeParameter;
27
-
28
25
public const PROFILE_URI = 'https://jsonapi.org/profiles/ethanresnick/cursor-pagination ' ;
29
26
30
- public function __construct (int $ defaultSize = 20 , ?int $ maxSize = 50 )
27
+ public function __construct (public int $ defaultSize = 20 , public ?int $ maxSize = 50 )
31
28
{
32
- $ this ->configureSizeParameter ($ defaultSize , $ maxSize );
33
29
}
34
30
35
31
public function parameters (): array
Original file line number Diff line number Diff line change 7
7
use Tobyz \JsonApiServer \Endpoint \ProvidesDocumentLinks ;
8
8
use Tobyz \JsonApiServer \Endpoint \ProvidesDocumentMeta ;
9
9
use Tobyz \JsonApiServer \Endpoint \ProvidesParameters ;
10
- use Tobyz \JsonApiServer \Pagination \Concerns \HasSizeParameter ;
11
10
use Tobyz \JsonApiServer \Resource \Paginatable ;
12
11
use Tobyz \JsonApiServer \Schema \Link ;
13
12
use Tobyz \JsonApiServer \Schema \Meta ;
@@ -20,11 +19,8 @@ class OffsetPagination implements
20
19
ProvidesDocumentMeta,
21
20
ProvidesDocumentLinks
22
21
{
23
- use HasSizeParameter;
24
-
25
- public function __construct (int $ defaultLimit = 20 , ?int $ maxLimit = 50 )
22
+ public function __construct (public int $ defaultLimit = 20 , public ?int $ maxLimit = 50 )
26
23
{
27
- $ this ->configureSizeParameter ($ defaultLimit , $ maxLimit );
28
24
}
29
25
30
26
public function parameters (): array
@@ -38,9 +34,9 @@ public function parameters(): array
38
34
->type (
39
35
Type \Integer::make ()
40
36
->minimum (1 )
41
- ->maximum ($ this ->maxSize ),
37
+ ->maximum ($ this ->maxLimit ),
42
38
)
43
- ->default (fn () => $ this ->defaultSize ),
39
+ ->default (fn () => $ this ->defaultLimit ),
44
40
];
45
41
}
46
42
You can’t perform that action at this time.
0 commit comments