File tree 3 files changed +10
-11
lines changed
3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. This projec
8
8
### Changed
9
9
10
10
- Upgrade to Laravel 10 and set minimum PHP version to 8.1.
11
+ - ** BREAKING** : The schema's id field must now always be provided to the ` CursorPagination::make() ` method and/or
12
+ constructor.
11
13
12
14
## [ 2.1.0] - 2023-01-24
13
15
Original file line number Diff line number Diff line change @@ -31,11 +31,6 @@ class CursorPagination implements Paginator
31
31
{
32
32
use HasPageMeta;
33
33
34
- /**
35
- * @var ID|null
36
- */
37
- private ?ID $ id ;
38
-
39
34
/**
40
35
* @var string
41
36
*/
@@ -79,22 +74,21 @@ class CursorPagination implements Paginator
79
74
/**
80
75
* Fluent constructor.
81
76
*
82
- * @param ID|null $id
77
+ * @param ID $id
83
78
* @return CursorPagination
84
79
*/
85
- public static function make (ID $ id = null ): self
80
+ public static function make (ID $ id ): self
86
81
{
87
82
return new static ($ id );
88
83
}
89
84
90
85
/**
91
86
* CursorPagination constructor.
92
87
*
93
- * @param ID|null $id
88
+ * @param ID $id
94
89
*/
95
- public function __construct (ID $ id = null )
90
+ public function __construct (private readonly ID $ id )
96
91
{
97
- $ this ->id = $ id ;
98
92
$ this ->before = 'before ' ;
99
93
$ this ->after = 'after ' ;
100
94
$ this ->limit = 'limit ' ;
Original file line number Diff line number Diff line change 30
30
use LaravelJsonApi \CursorPagination \CursorPage ;
31
31
use LaravelJsonApi \CursorPagination \CursorPagination ;
32
32
use LaravelJsonApi \CursorPagination \Tests \EncodedId ;
33
+ use LaravelJsonApi \Eloquent \Fields \ID ;
33
34
34
35
class Test extends TestCase
35
36
{
@@ -61,7 +62,9 @@ protected function setUp(): void
61
62
{
62
63
parent ::setUp ();
63
64
64
- $ this ->paginator = CursorPagination::make ();
65
+ $ this ->paginator = CursorPagination::make (
66
+ ID ::make ()->uuid ()
67
+ );
65
68
66
69
$ this ->videos = $ this
67
70
->getMockBuilder (VideoSchema::class)
You can’t perform that action at this time.
0 commit comments