mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -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{
|
class Library{
|
||||||
/**
|
/**
|
||||||
* @param array<string> $tags
|
* @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{
|
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;
|
$limit = $perPage;
|
||||||
$offset = (($page - 1) * $perPage);
|
$offset = (($page - 1) * $perPage);
|
||||||
$joinContributors = '';
|
$joinContributors = '';
|
||||||
|
|
|
@ -36,9 +36,7 @@ try{
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage);
|
$result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage);
|
||||||
/** @var array<Ebook> $ebooks */
|
|
||||||
$ebooks = $result['ebooks'];
|
$ebooks = $result['ebooks'];
|
||||||
/** @var int $totalEbooks */
|
|
||||||
$totalEbooks = $result['ebooksCount'];
|
$totalEbooks = $result['ebooksCount'];
|
||||||
$pageTitle = 'Browse Standard Ebooks';
|
$pageTitle = 'Browse Standard Ebooks';
|
||||||
$pageHeader = 'Browse Ebooks';
|
$pageHeader = 'Browse Ebooks';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue