18
18
* @property int $page
19
19
* @property-read int $firstPage
20
20
* @property-read int|null $lastPage
21
- * @property-read int $firstItemOnPage
22
- * @property-read int $lastItemOnPage
21
+ * @property-read int<0,max> $firstItemOnPage
22
+ * @property-read int<0,max> $lastItemOnPage
23
23
* @property int $base
24
24
* @property-read bool $first
25
25
* @property-read bool $last
26
- * @property-read int|null $pageCount
27
- * @property int $itemsPerPage
28
- * @property int|null $itemCount
29
- * @property-read int $offset
30
- * @property-read int|null $countdownOffset
31
- * @property-read int $length
26
+ * @property-read int<0,max> |null $pageCount
27
+ * @property positive- int $itemsPerPage
28
+ * @property int<0,max> |null $itemCount
29
+ * @property-read int<0,max> $offset
30
+ * @property-read int<0,max> |null $countdownOffset
31
+ * @property-read int<0,max> $length
32
32
*/
33
33
class Paginator
34
34
{
@@ -89,6 +89,7 @@ public function getLastPage(): ?int
89
89
90
90
/**
91
91
* Returns the sequence number of the first element on the page
92
+ * @return int<0, max>
92
93
*/
93
94
public function getFirstItemOnPage (): int
94
95
{
@@ -100,6 +101,7 @@ public function getFirstItemOnPage(): int
100
101
101
102
/**
102
103
* Returns the sequence number of the last element on the page
104
+ * @return int<0, max>
103
105
*/
104
106
public function getLastItemOnPage (): int
105
107
{
@@ -129,6 +131,7 @@ public function getBase(): int
129
131
130
132
/**
131
133
* Returns zero-based page number.
134
+ * @return int<0, max>
132
135
*/
133
136
protected function getPageIndex (): int
134
137
{
@@ -161,6 +164,7 @@ public function isLast(): bool
161
164
162
165
/**
163
166
* Returns the total number of pages.
167
+ * @return int<0, max>|null
164
168
*/
165
169
public function getPageCount (): ?int
166
170
{
@@ -183,6 +187,7 @@ public function setItemsPerPage(int $itemsPerPage)
183
187
184
188
/**
185
189
* Returns the number of items to display on a single page.
190
+ * @return positive-int
186
191
*/
187
192
public function getItemsPerPage (): int
188
193
{
@@ -203,6 +208,7 @@ public function setItemCount(?int $itemCount = null)
203
208
204
209
/**
205
210
* Returns the total number of items.
211
+ * @return int<0, max>|null
206
212
*/
207
213
public function getItemCount (): ?int
208
214
{
@@ -212,6 +218,7 @@ public function getItemCount(): ?int
212
218
213
219
/**
214
220
* Returns the absolute index of the first item on current page.
221
+ * @return int<0, max>
215
222
*/
216
223
public function getOffset (): int
217
224
{
@@ -221,6 +228,7 @@ public function getOffset(): int
221
228
222
229
/**
223
230
* Returns the absolute index of the first item on current page in countdown paging.
231
+ * @return int<0, max>|null
224
232
*/
225
233
public function getCountdownOffset (): ?int
226
234
{
@@ -232,6 +240,7 @@ public function getCountdownOffset(): ?int
232
240
233
241
/**
234
242
* Returns the number of items on current page.
243
+ * @return int<0, max>
235
244
*/
236
245
public function getLength (): int
237
246
{
0 commit comments