File tree 15 files changed +40
-38
lines changed
15 files changed +40
-38
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,12 @@ jobs:
14
14
strategy :
15
15
fail-fast : true
16
16
matrix :
17
- php : [7.4, '8.0', 8.1]
18
- laravel : [8, 9]
19
- exclude :
20
- - php : 7.4
21
- laravel : 9
17
+ php : [8.1, 8.2]
18
+ laravel : [10]
22
19
23
20
steps :
24
21
- name : Checkout Code
25
- uses : actions/checkout@v2
22
+ uses : actions/checkout@v3
26
23
27
24
- name : Setup PHP
28
25
uses : shivammathur/setup-php@v2
37
34
run : composer require "illuminate/database:^${{ matrix.laravel }}" --no-update
38
35
39
36
- name : Install dependencies
40
- uses : nick-invision /retry@v1
37
+ uses : nick-fields /retry@v2
41
38
with :
42
39
timeout_minutes : 5
43
40
max_attempts : 5
Original file line number Diff line number Diff line change 3
3
All notable changes to this project will be documented in this file. This project adheres to
4
4
[ Semantic Versioning] ( http://semver.org/ ) and [ this changelog format] ( http://keepachangelog.com/ ) .
5
5
6
+ ## [ 3.0.0] - 2023-02-14
7
+
8
+ ### Changed
9
+
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.
13
+
6
14
## [ 2.1.0] - 2023-01-24
7
15
8
16
### Added
Original file line number Diff line number Diff line change 23
23
}
24
24
],
25
25
"require" : {
26
- "php" : " ^7.4|^8.0 " ,
26
+ "php" : " ^8.1 " ,
27
27
"ext-json" : " *" ,
28
- "illuminate/database" : " ^8.0|^9 .0" ,
29
- "illuminate/pagination" : " ^8.0|^9 .0" ,
30
- "illuminate/support" : " ^8.0|^9 .0" ,
31
- "laravel-json-api/eloquent" : " ^2 .0"
28
+ "illuminate/database" : " ^10 .0" ,
29
+ "illuminate/pagination" : " ^10 .0" ,
30
+ "illuminate/support" : " ^10 .0" ,
31
+ "laravel-json-api/eloquent" : " ^3 .0"
32
32
},
33
33
"require-dev" : {
34
- "orchestra/testbench" : " ^6.23|^7 .0" ,
35
- "phpunit/phpunit" : " ^9.5.10 "
34
+ "orchestra/testbench" : " ^8 .0" ,
35
+ "phpunit/phpunit" : " ^9.5.28 "
36
36
},
37
37
"autoload" : {
38
38
"psr-4" : {
48
48
},
49
49
"extra" : {
50
50
"branch-alias" : {
51
- "dev-develop" : " 2 .x-dev"
51
+ "dev-develop" : " 3 .x-dev"
52
52
}
53
53
},
54
54
"minimum-stability" : " stable" ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
@@ -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 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
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)
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/*
3
- * Copyright 2022 Cloud Creativity Limited
3
+ * Copyright 2023 Cloud Creativity Limited
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
You can’t perform that action at this time.
0 commit comments