diff --git a/src/Endpoint/Index.php b/src/Endpoint/Index.php index 1a462b0..9f3eb27 100644 --- a/src/Endpoint/Index.php +++ b/src/Endpoint/Index.php @@ -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]])); } diff --git a/src/Schema/Type.php b/src/Schema/Type.php index 8101000..b5cef04 100644 --- a/src/Schema/Type.php +++ b/src/Schema/Type.php @@ -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; }