1 | <?php |
||
17 | class PaginatedResource implements JsonSerializable |
||
18 | { |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | protected $total; |
||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $pages; |
||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $currentPage; |
||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $pageSize; |
||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $offsetLimit; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $offset; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $cursor; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $data = []; |
||
54 | /** |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $include = []; |
||
58 | /** |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $links = []; |
||
62 | /** |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $meta = []; |
||
66 | |||
67 | /** |
||
68 | * @param string $elements |
||
69 | * @param int $currentPage |
||
70 | * @param int $pageSize |
||
71 | * @param null $total |
||
72 | * @param array $links |
||
73 | */ |
||
74 | public function __construct($elements, $currentPage = null, $pageSize = null, $total = null, array $links = []) |
||
83 | |||
84 | /** |
||
85 | * @param string $cursor |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function setPageCursor($cursor) |
||
93 | |||
94 | /** |
||
95 | * @param array $data |
||
96 | * |
||
97 | * @throws \InvalidArgumentException |
||
98 | * |
||
99 | * @return $this |
||
100 | */ |
||
101 | protected function setData($data) |
||
115 | |||
116 | /** |
||
117 | * @param array $links |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function setLinks(array $links) |
||
129 | |||
130 | /** |
||
131 | * @param string $offset |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | public function setPageOffset($offset) |
||
139 | |||
140 | /** |
||
141 | * @param string $offsetLimit |
||
142 | * |
||
143 | * @return $this |
||
144 | */ |
||
145 | public function setPageOffsetLimit($offsetLimit) |
||
149 | |||
150 | /** |
||
151 | * @param $currentPage |
||
152 | */ |
||
153 | protected function setCurrentPage($currentPage) |
||
157 | |||
158 | /** |
||
159 | * @param $pageSize |
||
160 | */ |
||
161 | protected function setPageSize($pageSize) |
||
165 | /** |
||
166 | * @param $total |
||
167 | */ |
||
168 | protected function setTotal($total) |
||
172 | |||
173 | /** |
||
174 | * @param $total |
||
175 | * @param $pageSize |
||
176 | */ |
||
177 | protected function setTotalPages($total, $pageSize) |
||
187 | |||
188 | /** |
||
189 | * @param array $meta |
||
190 | */ |
||
191 | public function setMeta(array $meta) |
||
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | public function jsonSerialize() |
||
229 | } |
||
230 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: