Skip to content

Commit 848a8df

Browse files
committed
Fix noLimit method
1 parent bbca1e4 commit 848a8df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Endpoint/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function buildPaginationLinks(Request $request, int $offset, ?int $limit
142142
$paginationLinks[] = new PrevLink($this->buildUrl($request, $params));
143143
}
144144

145-
if ($schema->isCountable() && $schema->getPerPage() && $offset + $limit < $total) {
145+
if ($schema->isCountable() && $schema->getPerPage() && $limit && $offset + $limit < $total) {
146146
$paginationLinks[] = new LastLink($this->buildUrl($request, ['page' => ['offset' => floor(($total - 1) / $limit) * $limit]]));
147147
}
148148

src/Schema/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function noLimit(): void
174174
* Get the maximum number of records that can be listed, or null if there
175175
* is no limit.
176176
*/
177-
public function getLimit(): int
177+
public function getLimit(): ?int
178178
{
179179
return $this->limit;
180180
}

0 commit comments

Comments
 (0)