16
16
17
17
class ResourceCollectionEndpoint implements Endpoint
18
18
{
19
- /** @var ReadSchema */
20
- private $ schema ;
21
-
22
- /** @var string */
23
- private $ path ;
24
-
25
19
/** @var Response[] */
26
- private $ responses ;
27
-
28
- /** @var mixed[] */
29
- private $ filters ;
30
-
31
- /** @var array<string, ReadSchema> */
32
- private $ includes ;
33
-
34
- /** @var mixed[] */
35
- private $ fields ;
36
-
37
- /**
38
- * @var mixed[]
39
- *
40
- * @psalm-suppress UnusedProperty
41
- */
42
- private $ sorts ;
43
-
44
- /** @var null|Schema */
45
- private $ pagination ;
20
+ private array $ responses ;
46
21
47
22
/**
48
23
* @param Filter[] $filters
49
24
* @param array<string, ReadSchema> $includes
50
25
*/
51
26
public function __construct (
52
- ReadSchema $ schema ,
53
- string $ path ,
54
- array $ filters = [],
55
- array $ sorts = [],
56
- array $ includes = [],
57
- array $ fields = [],
58
- ?Schema $ pagination = null ,
27
+ private ReadSchema $ schema ,
28
+ private string $ path ,
29
+ private array $ filters = [],
30
+ /**
31
+ * @var mixed[]
32
+ *
33
+ * @psalm-suppress UnusedProperty
34
+ */
35
+ private array $ sorts = [],
36
+ private array $ includes = [],
37
+ /** @var mixed[] */
38
+ private array $ fields = [],
39
+ private ?Schema $ pagination = null ,
59
40
array $ errorResponses = []
60
41
) {
61
- $ this ->schema = $ schema ;
62
- $ this ->path = $ path ;
63
- $ this ->includes = $ includes ;
64
-
65
42
Assertion::allIsInstanceOf ($ this ->includes , ReadSchema::class);
66
43
67
44
/** @var Response[] $responses */
@@ -73,10 +50,6 @@ public function __construct(
73
50
);
74
51
75
52
$ this ->responses = $ responses ;
76
- $ this ->filters = $ filters ;
77
- $ this ->sorts = $ sorts ;
78
- $ this ->fields = $ fields ;
79
- $ this ->pagination = $ pagination ;
80
53
}
81
54
82
55
public function getMethod (): string
0 commit comments