mirror of
https://github.com/standardebooks/web.git
synced 2025-07-20 05:14:48 -04:00
Add type hints and some other tweaks to satisfy PHPStan
This commit is contained in:
parent
caa623bd0b
commit
bef5aea7ad
11 changed files with 72 additions and 28 deletions
|
@ -6,6 +6,9 @@ use function Safe\unlink;
|
|||
use function Safe\usort;
|
||||
|
||||
class Library{
|
||||
/**
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function GetEbooks(string $sort = null): array{
|
||||
$ebooks = [];
|
||||
|
||||
|
@ -69,6 +72,9 @@ class Library{
|
|||
return $ebooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function GetEbooksByAuthor(string $wwwFilesystemPath): array{
|
||||
// Do we have the author's ebooks cached?
|
||||
$ebooks = [];
|
||||
|
@ -82,6 +88,9 @@ class Library{
|
|||
return $ebooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function GetEbooksByTag(string $tag): array{
|
||||
// Do we have the tag's ebooks cached?
|
||||
$ebooks = [];
|
||||
|
@ -95,6 +104,9 @@ class Library{
|
|||
return $ebooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function GetEbooksByCollection(string $collection): array{
|
||||
// Do we have the tag's ebooks cached?
|
||||
$ebooks = [];
|
||||
|
@ -108,6 +120,9 @@ class Library{
|
|||
return $ebooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function Search(string $query): array{
|
||||
$ebooks = Library::GetEbooks();
|
||||
$matches = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue