From 4b406613333669401cf0ba21dce745a9baca9a3b Mon Sep 17 00:00:00 2001
From: Tobias Gross-Vogt <tgros@tugraz.at>
Date: Tue, 15 Nov 2022 13:36:43 +0100
Subject: [PATCH] lower limit for page and perPage

---
 src/Pagination/Pagination.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Pagination/Pagination.php b/src/Pagination/Pagination.php
index 0fdb872..d7f613c 100644
--- a/src/Pagination/Pagination.php
+++ b/src/Pagination/Pagination.php
@@ -32,12 +32,12 @@ class Pagination
 
     public static function getCurrentPageNumber(array $options): int
     {
-        return max(1, intval($options[self::CURRENT_PAGE_NUMBER_PARAMETER_NAME]) ?? self::CURRENT_PAGE_NUMBER_DEFAULT);
+        return max(1, intval($options[self::CURRENT_PAGE_NUMBER_PARAMETER_NAME] ?? self::CURRENT_PAGE_NUMBER_DEFAULT));
     }
 
     public static function getMaxNumItemsPerPage(array $options): int
     {
-        return max(1, intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME]) ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT);
+        return max(1, intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME] ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT));
     }
 
     public static function isPartialPagination(array $options): bool
-- 
GitLab