mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -04:00
Use array shapes in the PHPDoc
This makes the extra documentation unnecessary
This commit is contained in:
parent
e5fc21ffd3
commit
807e8410b4
2 changed files with 1 additions and 7 deletions
|
@ -16,13 +16,9 @@ use function Safe\usort;
|
|||
class Library{
|
||||
/**
|
||||
* @param array<string> $tags
|
||||
* @return array<string, array<Ebook>|int>
|
||||
* @return array{ebooks: array<Ebook>, 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<Ebook>,
|
||||
// ['ebooksCount'] => int
|
||||
|
||||
$limit = $perPage;
|
||||
$offset = (($page - 1) * $perPage);
|
||||
$joinContributors = '';
|
||||
|
|
|
@ -36,9 +36,7 @@ try{
|
|||
}
|
||||
|
||||
$result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage);
|
||||
/** @var array<Ebook> $ebooks */
|
||||
$ebooks = $result['ebooks'];
|
||||
/** @var int $totalEbooks */
|
||||
$totalEbooks = $result['ebooksCount'];
|
||||
$pageTitle = 'Browse Standard Ebooks';
|
||||
$pageHeader = 'Browse Ebooks';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue