X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FBoundariesPager.php;h=51838f053618bb66b8a7e7ca79ee4edc0a7a2403;hb=ddd2c72be8e7245389f97d74dd847f5a20410936;hp=8bbbde2b4764eed12362073f86d6895cee940647;hpb=d6ed0068e6c8bf513e40a5d29b73d100f664261b;p=friendica.git diff --git a/src/Content/BoundariesPager.php b/src/Content/BoundariesPager.php index 8bbbde2b47..51838f0536 100644 --- a/src/Content/BoundariesPager.php +++ b/src/Content/BoundariesPager.php @@ -1,6 +1,6 @@ first_page = !($queryParameters['since_id'] ?? null) && !($queryParameters['max_id'] ?? null); + $this->first_page = !($queryParameters['min_id'] ?? null) && !($queryParameters['max_id'] ?? null); - unset($queryParameters['since_id']); + unset($queryParameters['min_id']); unset($queryParameters['max_id']); $parsed['query'] = http_build_query($queryParameters); @@ -73,12 +73,12 @@ class BoundariesPager extends Pager } } - public function getStart() + public function getStart(): int { throw new \BadMethodCallException(); } - public function getPage() + public function getPage(): int { throw new \BadMethodCallException(); } @@ -94,7 +94,7 @@ class BoundariesPager extends Pager * $params = ['order' => ['sort_field' => true], 'limit' => $itemsPerPage]; * $items = DBA::toArray(DBA::select($table, $fields, $condition, $params)); * - * $pager = new BoundariesPager($a->query_string, $items[0]['sort_field'], $items[coutn($items) - 1]['sort_field'], $itemsPerPage); + * $pager = new BoundariesPager($a->query_string, $items[0]['sort_field'], $items[count($items) - 1]['sort_field'], $itemsPerPage); * * $html = $pager->renderMinimal(count($items)); * @@ -102,7 +102,7 @@ class BoundariesPager extends Pager * @return string HTML string of the pager * @throws \Exception */ - public function renderMinimal(int $itemCount) + public function renderMinimal(int $itemCount): string { $displayedItemCount = max(0, intval($itemCount)); @@ -111,7 +111,7 @@ class BoundariesPager extends Pager 'prev' => [ 'url' => Strings::ensureQueryParameter($this->baseQueryString . ($this->first_item_id >= $this->last_item_id ? - '&since_id=' . $this->first_item_id : '&max_id=' . $this->first_item_id) + '&min_id=' . $this->first_item_id : '&max_id=' . $this->first_item_id) ), 'text' => $this->l10n->t('newer'), 'class' => 'previous' . ($this->first_page ? ' disabled' : '') @@ -119,7 +119,7 @@ class BoundariesPager extends Pager 'next' => [ 'url' => Strings::ensureQueryParameter($this->baseQueryString . ($this->first_item_id >= $this->last_item_id ? - '&max_id=' . $this->last_item_id : '&since_id=' . $this->last_item_id) + '&max_id=' . $this->last_item_id : '&min_id=' . $this->last_item_id) ), 'text' => $this->l10n->t('older'), 'class' => 'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '') @@ -130,7 +130,10 @@ class BoundariesPager extends Pager return Renderer::replaceMacros($tpl, ['pager' => $data]); } - public function renderFull($itemCount) + /** + * Unsupported method, must be type-compatible + */ + public function renderFull(int $itemCount): string { throw new \BadMethodCallException(); }