mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 01:22:23 -04:00
Use array shapes in PHPDoc for FilterArtwork
This commit is contained in:
parent
b5933631c5
commit
ad9bdde32d
2 changed files with 1 additions and 7 deletions
|
@ -168,13 +168,9 @@ class Library{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array<string, array<Artwork>|int>
|
* @return array{artworks: array<Artwork>, artworksCount: int}
|
||||||
*/
|
*/
|
||||||
public static function FilterArtwork(?string $query = null, ?string $status = null, ?ArtworkSortType $sort = null, ?int $submitterUserId = null, int $page = 1, int $perPage = ARTWORK_PER_PAGE): array{
|
public static function FilterArtwork(?string $query = null, ?string $status = null, ?ArtworkSortType $sort = null, ?int $submitterUserId = null, int $page = 1, int $perPage = ARTWORK_PER_PAGE): array{
|
||||||
// Returns an array of:
|
|
||||||
// ['artworks'] => array<Artwork>,
|
|
||||||
// ['artworksCount'] => int
|
|
||||||
//
|
|
||||||
// $status is either the string value of an ArtworkStatus enum, or one of these special statuses:
|
// $status is either the string value of an ArtworkStatus enum, or one of these special statuses:
|
||||||
// null: same as "all"
|
// null: same as "all"
|
||||||
// "all": Show all approved and in use artwork
|
// "all": Show all approved and in use artwork
|
||||||
|
|
|
@ -68,9 +68,7 @@ try{
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$result = Library::FilterArtwork($query, $filterArtworkStatus, $sort, $submitterUserId, $page, $perPage);
|
$result = Library::FilterArtwork($query, $filterArtworkStatus, $sort, $submitterUserId, $page, $perPage);
|
||||||
/** @var array<Artwork> $artworks */
|
|
||||||
$artworks = $result['artworks'];
|
$artworks = $result['artworks'];
|
||||||
/** @var int $totalArtworkCount */
|
|
||||||
$totalArtworkCount = $result['artworksCount'];
|
$totalArtworkCount = $result['artworksCount'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue