1 | <?php |
||
6 | class JsonApiPaginationDecorator extends PaginationDecoratorAbstract implements \JsonSerializable |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * @var UriInterface |
||
11 | */ |
||
12 | public $uri; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | public $query_params = array(); |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | public $json_result = array(); |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | public $filter_result = false; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * @param PaginationInterface $pagination The pagination to decorate |
||
32 | * @param UriInterface $uri PSR-7 URI instance |
||
33 | * @param array $query_params Optional: default query parameters for URIs |
||
34 | * @param bool $filter_result Optional: Filter out null member values in jsonSerialize's result. |
||
35 | * Default: FALSE |
||
36 | */ |
||
37 | 48 | public function __construct( PaginationInterface $pagination, UriInterface $uri, array $query_params = array(), bool $filter_result = false ) |
|
51 | |||
52 | |||
53 | /** |
||
54 | * JsonSerializable alias for getLinks() |
||
55 | * @return array |
||
56 | */ |
||
57 | 24 | public function jsonSerialize() |
|
61 | |||
62 | |||
63 | /** |
||
64 | * Returns an array with `first`, `last`, `next`, and `previous` elements |
||
65 | * according to the JsonAPI pagination specs. |
||
66 | * |
||
67 | * @return array |
||
68 | * @see https://jsonapi.org/format/#fetching-pagination |
||
69 | */ |
||
70 | 48 | public function getLinks() : array |
|
87 | |||
88 | /** |
||
89 | * Returns an array with non-standard meta information about the pagination |
||
90 | * |
||
91 | * - numberOfPages |
||
92 | * - currentPage |
||
93 | * - pageSize |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | 48 | public function getMeta() : array |
|
109 | |||
110 | |||
111 | |||
112 | |||
113 | /** |
||
114 | * @param string $field Link element field name |
||
115 | * @param int $page Page number |
||
116 | * @param int|null $page_size Page size |
||
117 | * @return void |
||
118 | */ |
||
119 | 18 | protected function buildField($field, $page, $page_size) { |
|
132 | |||
133 | |||
134 | /** |
||
135 | * @param array $custom_params |
||
136 | * @return string |
||
137 | */ |
||
138 | 24 | protected function buildUriString( array $custom_params) : string |
|
144 | |||
145 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..