From 807e8410b4f73dde5d40444014e680e9c98ced48 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Sat, 6 Jul 2024 12:14:25 -0600 Subject: [PATCH] Use array shapes in the PHPDoc This makes the extra documentation unnecessary --- lib/Library.php | 6 +----- www/ebooks/index.php | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/Library.php b/lib/Library.php index 44aebfa5..a11283e9 100644 --- a/lib/Library.php +++ b/lib/Library.php @@ -16,13 +16,9 @@ use function Safe\usort; class Library{ /** * @param array $tags - * @return array|int> + * @return array{ebooks: array, ebooksCount: int} */ public static function FilterEbooks(string $query = null, array $tags = [], EbookSortType $sort = null, int $page = 1, int $perPage = EBOOKS_PER_PAGE): array{ - // Returns an array of: - // ['ebooks'] => array, - // ['ebooksCount'] => int - $limit = $perPage; $offset = (($page - 1) * $perPage); $joinContributors = ''; diff --git a/www/ebooks/index.php b/www/ebooks/index.php index 87d4b982..5945fb7a 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -36,9 +36,7 @@ try{ } $result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage); - /** @var array $ebooks */ $ebooks = $result['ebooks']; - /** @var int $totalEbooks */ $totalEbooks = $result['ebooksCount']; $pageTitle = 'Browse Standard Ebooks'; $pageHeader = 'Browse Ebooks';