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 99use Tobyz \JsonApiServer \Endpoint \ProvidesParameters ;
1010use Tobyz \JsonApiServer \Endpoint \ProvidesResourceMeta ;
1111use Tobyz \JsonApiServer \Exception \Sourceable ;
12- use Tobyz \JsonApiServer \Pagination \Concerns \HasSizeParameter ;
1312use Tobyz \JsonApiServer \Resource \CursorPaginatable ;
1413use Tobyz \JsonApiServer \Schema \Link ;
1514use Tobyz \JsonApiServer \Schema \Meta ;
@@ -23,13 +22,10 @@ class CursorPagination implements
2322 ProvidesDocumentLinks,
2423 ProvidesResourceMeta
2524{
26- use HasSizeParameter;
27-
2825 public const PROFILE_URI = 'https://jsonapi.org/profiles/ethanresnick/cursor-pagination ' ;
2926
30- public function __construct (int $ defaultSize = 20 , ?int $ maxSize = 50 )
27+ public function __construct (public int $ defaultSize = 20 , public ?int $ maxSize = 50 )
3128 {
32- $ this ->configureSizeParameter ($ defaultSize , $ maxSize );
3329 }
3430
3531 public function parameters (): array
Original file line number Diff line number Diff line change 77use Tobyz \JsonApiServer \Endpoint \ProvidesDocumentLinks ;
88use Tobyz \JsonApiServer \Endpoint \ProvidesDocumentMeta ;
99use Tobyz \JsonApiServer \Endpoint \ProvidesParameters ;
10- use Tobyz \JsonApiServer \Pagination \Concerns \HasSizeParameter ;
1110use Tobyz \JsonApiServer \Resource \Paginatable ;
1211use Tobyz \JsonApiServer \Schema \Link ;
1312use Tobyz \JsonApiServer \Schema \Meta ;
@@ -20,11 +19,8 @@ class OffsetPagination implements
2019 ProvidesDocumentMeta,
2120 ProvidesDocumentLinks
2221{
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 )
2623 {
27- $ this ->configureSizeParameter ($ defaultLimit , $ maxLimit );
2824 }
2925
3026 public function parameters (): array
@@ -38,9 +34,9 @@ public function parameters(): array
3834 ->type (
3935 Type \Integer::make ()
4036 ->minimum (1 )
41- ->maximum ($ this ->maxSize ),
37+ ->maximum ($ this ->maxLimit ),
4238 )
43- ->default (fn () => $ this ->defaultSize ),
39+ ->default (fn () => $ this ->defaultLimit ),
4440 ];
4541 }
4642
You can’t perform that action at this time.
0 commit comments