Fix noLimit method

This commit is contained in:
Toby Zerner 2021-05-18 16:18:49 +09:30
parent bbca1e44ed
commit 848a8df42d
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ class Index
$paginationLinks[] = new PrevLink($this->buildUrl($request, $params));
}
if ($schema->isCountable() && $schema->getPerPage() && $offset + $limit < $total) {
if ($schema->isCountable() && $schema->getPerPage() && $limit && $offset + $limit < $total) {
$paginationLinks[] = new LastLink($this->buildUrl($request, ['page' => ['offset' => floor(($total - 1) / $limit) * $limit]]));
}

View File

@ -174,7 +174,7 @@ final class Type
* Get the maximum number of records that can be listed, or null if there
* is no limit.
*/
public function getLimit(): int
public function getLimit(): ?int
{
return $this->limit;
}