1 | <?php |
||
14 | trait PaginationLinksTrait |
||
15 | { |
||
16 | abstract public function setLink($key, $value); |
||
17 | |||
18 | abstract public function removeLink($key); |
||
19 | |||
20 | /** |
||
21 | * Set pagination links (first, prev, next, and last). |
||
22 | * |
||
23 | * @param string $url The base URL for pagination links. |
||
24 | * @param array $queryParams The query params provided in the request. |
||
25 | * @param int $offset The current offset. |
||
26 | * @param int $limit The current limit. |
||
27 | * @param int|null $total The total number of results, or null if unknown. |
||
28 | */ |
||
29 | 3 | public function setPaginationLinks($url, array $queryParams, $offset, $limit, $total = null) |
|
53 | |||
54 | /** |
||
55 | * Set a pagination link. |
||
56 | * |
||
57 | * @param string $name The name of the link. |
||
58 | * @param string $url The base URL for pagination links. |
||
59 | * @param array $queryParams The query params provided in the request. |
||
60 | * @param int $offset The offset to link to. |
||
61 | * @param int $limit The current limit. |
||
62 | */ |
||
63 | 3 | private function setPaginationLink($name, $url, array $queryParams, $offset, $limit) |
|
95 | } |
||
96 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.