1 | <?php |
||
12 | final class PagerComponent implements ComponentInterface, Countable, JsonSerializable |
||
13 | { |
||
14 | /** |
||
15 | * @var UriInterface |
||
16 | */ |
||
17 | private $baseUri; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $nbItems; |
||
23 | |||
24 | /** |
||
25 | * @var int|null |
||
26 | */ |
||
27 | private $perPage; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | private $currentPageNumber; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | private $delta; |
||
38 | |||
39 | /** |
||
40 | * @var PageSize[] |
||
41 | */ |
||
42 | private $pageSizes; |
||
43 | |||
44 | /** |
||
45 | * @var PagerUriManagerInterface |
||
46 | */ |
||
47 | private $uriManager; |
||
48 | |||
49 | /** |
||
50 | * @var Page[] |
||
51 | */ |
||
52 | private $pages; |
||
53 | |||
54 | /** |
||
55 | * PagerComponent constructor. |
||
56 | * @param UriInterface $baseUri |
||
57 | * @param int $totalItems |
||
58 | * @param int|null $perPage |
||
59 | * @param int $currentPageNumber |
||
60 | * @param int|null $delta |
||
61 | * @param array $pageSizes |
||
62 | * @param PagerUriManagerInterface|null $uriManager |
||
63 | */ |
||
64 | public function __construct( |
||
85 | |||
86 | /** |
||
87 | * @param int $nbItems |
||
88 | */ |
||
89 | public function setNbItems(int $nbItems): void |
||
93 | |||
94 | /** |
||
95 | * @return bool |
||
96 | */ |
||
97 | public function isEnabled() |
||
101 | |||
102 | /** |
||
103 | * @return PageSize[] |
||
104 | */ |
||
105 | public function getPageSizes(): array |
||
109 | |||
110 | /** |
||
111 | * @return Page[] |
||
112 | */ |
||
113 | public function getPages(): array |
||
121 | |||
122 | /** |
||
123 | * @return \Generator |
||
124 | * @throws \InvalidArgumentException |
||
125 | */ |
||
126 | private function generatePages() |
||
146 | |||
147 | /** |
||
148 | * @param int $pageNumber |
||
149 | * @return Page |
||
150 | * @throws \InvalidArgumentException |
||
151 | */ |
||
152 | private function createPage(int $pageNumber): Page |
||
166 | |||
167 | /** |
||
168 | * @inheritDoc |
||
169 | */ |
||
170 | public static function getName(): string |
||
174 | |||
175 | /** |
||
176 | * |
||
177 | * /** |
||
178 | * @return int |
||
179 | */ |
||
180 | public function count(): int |
||
188 | |||
189 | /** |
||
190 | * @return int |
||
191 | */ |
||
192 | public function getCurrentPage(): int |
||
196 | |||
197 | /** |
||
198 | * @return int |
||
199 | */ |
||
200 | public function getNbItems(): int |
||
204 | |||
205 | /** |
||
206 | * @return int |
||
207 | */ |
||
208 | public function getCurrentOffset(): int |
||
216 | |||
217 | /** |
||
218 | * @param int $page |
||
219 | * @return int |
||
220 | */ |
||
221 | public function getPageOffset(int $page): int |
||
227 | |||
228 | /** |
||
229 | * @param int $page |
||
230 | * @return int |
||
231 | */ |
||
232 | public function getPageCount(int $page): int |
||
242 | |||
243 | /** |
||
244 | * @return int |
||
245 | */ |
||
246 | public function getPerPage(): int |
||
250 | |||
251 | /** |
||
252 | * @param int|null $page |
||
253 | * @return bool |
||
254 | */ |
||
255 | public function isFirstPage(?int $page = null): bool |
||
259 | |||
260 | /** |
||
261 | * @param int $page |
||
262 | * @return bool |
||
263 | */ |
||
264 | public function isPreviousPage(int $page): bool |
||
268 | |||
269 | /** |
||
270 | * @param int $page |
||
271 | * @return bool |
||
272 | */ |
||
273 | public function isCurrentPage(int $page): bool |
||
277 | |||
278 | /** |
||
279 | * @param int $page |
||
280 | * @return bool |
||
281 | */ |
||
282 | public function isNextPage(int $page): bool |
||
286 | |||
287 | /** |
||
288 | * @param int|null $page |
||
289 | * @return bool |
||
290 | */ |
||
291 | public function isLastPage(?int $page = null): bool |
||
295 | |||
296 | /** |
||
297 | * @param int|null $page |
||
|
|||
298 | * @return int |
||
299 | */ |
||
300 | public function getFirstPage(): int |
||
304 | |||
305 | /** |
||
306 | * @return int |
||
307 | */ |
||
308 | public function getLastPage(): int |
||
312 | |||
313 | /** |
||
314 | * @return int |
||
315 | */ |
||
316 | public function getPreviousPage(?int $page = null): int |
||
322 | |||
323 | /** |
||
324 | * @return int |
||
325 | */ |
||
326 | public function getNextPage(?int $page = null): int |
||
332 | |||
333 | /** |
||
334 | * @param int $page |
||
335 | * @return int |
||
336 | */ |
||
337 | private function snap(?int $page): int |
||
353 | |||
354 | /** |
||
355 | * @inheritDoc |
||
356 | */ |
||
357 | public function jsonSerialize(): array |
||
373 | } |
||
374 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.