]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Pager.php
Merge pull request #9 from nupplaphil/dependabot/composer/guzzlehttp/guzzle-6.5.8
[friendica.git] / src / Content / Pager.php
index 5b4345a4c8bc4a2140884e50b063c8893eb40c30..5109fd1de3e3d806273daf6fcdb1304337cecde4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -30,10 +30,13 @@ use Friendica\Util\Strings;
  */
 class Pager
 {
+       /** @var int Default count of items per page */
+       const ITEMS_PER_PAGE = 50;
+
        /** @var integer */
        private $page = 1;
        /** @var integer */
-       protected $itemsPerPage = 50;
+       protected $itemsPerPage = self::ITEMS_PER_PAGE;
        /** @var string */
        protected $baseQueryString = '';
 
@@ -125,7 +128,7 @@ class Pager
        /**
         * Sets the base query string from a full query string.
         *
-        * Strips the 'page' parameter, and remove the 'q=' string for some reason.
+        * Strips the 'page' parameter
         *
         * @param string $queryString
         */
@@ -157,7 +160,7 @@ class Pager
         * @return string HTML string of the pager
         * @throws \Exception
         */
-       public function renderMinimal(int $itemCount)
+       public function renderMinimal(int $itemCount): string
        {
                $displayedItemCount = max(0, intval($itemCount));
 
@@ -196,13 +199,13 @@ class Pager
         *
         * $html = $pager->renderFull();
         *
-        * @param integer $itemCount The total number of items including those note displayed on the page
+        * @param int $itemCount The total number of items including those note displayed on the page
         * @return string HTML string of the pager
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function renderFull($itemCount)
+       public function renderFull(int $itemCount): string
        {
-               $totalItemCount = max(0, intval($itemCount));
+               $totalItemCount = max(0, $itemCount);
 
                $data = [];