Skip to content

Commit 9fcb679

Browse files
committed
docs: add comment to make things clear
1 parent b3f451b commit 9fcb679

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

system/Pager/PagerRenderer.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
class PagerRenderer
2626
{
2727
/**
28-
* First page number.
28+
* First page number in the current pages being displayed.
2929
*
3030
* @var int
3131
*/
3232
protected $first;
3333

3434
/**
35-
* Last page number.
35+
* Last page number in the current pages being displayed.
3636
*
3737
* @var int
3838
*/
@@ -85,8 +85,11 @@ class PagerRenderer
8585
*/
8686
public function __construct(array $details)
8787
{
88-
$this->first = 1;
89-
$this->last = $details['pageCount'];
88+
// `first` and `last` will be updated by `setSurroundCount()`.
89+
// You must call `setSurroundCount()` after instantiation.
90+
$this->first = 1;
91+
$this->last = $details['pageCount'];
92+
9093
$this->current = $details['currentPage'];
9194
$this->total = $details['total'];
9295
$this->uri = $details['uri'];
@@ -377,7 +380,7 @@ public function getNextPage()
377380
}
378381

379382
/**
380-
* Returns the page number of the first page.
383+
* Returns the page number of the first page in the current pages being displayed.
381384
*/
382385
public function getFirstPageNumber(): int
383386
{
@@ -393,7 +396,7 @@ public function getCurrentPageNumber(): int
393396
}
394397

395398
/**
396-
* Returns the page number of the last page.
399+
* Returns the page number of the last page in the current pages being displayed.
397400
*/
398401
public function getLastPageNumber(): int
399402
{

0 commit comments

Comments
 (0)