diff --git a/src/Parameters.php b/src/Parameters.php index 0280e47..8653b07 100644 --- a/src/Parameters.php +++ b/src/Parameters.php @@ -112,7 +112,15 @@ protected function getOffsetFromNumber($perPage) */ public function getLimit($max = null) { - $limit = $this->getPage('limit') ?: $this->getPage('size') ?: null; + $limit = (int) $this->getPage('limit'); + + if (! $limit) { + $limit = (int) $this->getPage('size'); + } + + if (! $limit) { + $limit = null; + } if ($limit && $max) { $limit = min($max, $limit);