Flesh out some PHPDocs, and consistently name enums

This commit is contained in:
Alex Cabal 2024-05-14 14:31:24 -05:00
parent ace9cea6b7
commit a9eab552ab
25 changed files with 205 additions and 118 deletions

View file

@ -11,7 +11,7 @@ $downloadUrl = null;
try{
$urlPath = HttpInput::Str(GET, 'url-path') ?? null;
$format = EbookFormat::tryFrom(HttpInput::Str(GET, 'format') ?? '') ?? EbookFormat::Epub;
$format = EbookFormatType::tryFrom(HttpInput::Str(GET, 'format') ?? '') ?? EbookFormatType::Epub;
$wwwFilesystemPath = EBOOKS_DIST_PATH . $urlPath;
// Do we have the ebook cached?
@ -24,19 +24,19 @@ try{
}
switch($format){
case EbookFormat::Kepub:
case EbookFormatType::Kepub:
$downloadUrl = $ebook->KepubUrl;
break;
case EbookFormat::Azw3:
case EbookFormatType::Azw3:
$downloadUrl = $ebook->Azw3Url;
break;
case EbookFormat::AdvancedEpub:
case EbookFormatType::AdvancedEpub:
$downloadUrl = $ebook->AdvancedEpubUrl;
break;
case EbookFormat::Epub:
case EbookFormatType::Epub:
default:
$downloadUrl = $ebook->EpubUrl;
break;