diff --git a/lib/Artwork.php b/lib/Artwork.php
index 136e0cc0..ed4cffd8 100644
--- a/lib/Artwork.php
+++ b/lib/Artwork.php
@@ -48,8 +48,8 @@ class Artwork{
public ?bool $IsPublishedInUs = null;
public ?string $Exception = null;
public ?string $Notes = null;
- public ?ImageMimeType $MimeType = null;
- public ?ArtworkStatusType $Status = null;
+ public ?Enums\ImageMimeType $MimeType = null;
+ public ?Enums\ArtworkStatusType $Status = null;
protected ?string $_UrlName = null;
protected ?string $_Url = null;
@@ -290,7 +290,7 @@ class Artwork{
return true;
}
- if(($user->Benefits->CanReviewArtwork || $user->UserId == $this->SubmitterUserId) && ($this->Status == ArtworkStatusType::Unverified || $this->Status == ArtworkStatusType::Declined)){
+ if(($user->Benefits->CanReviewArtwork || $user->UserId == $this->SubmitterUserId) && ($this->Status == Enums\ArtworkStatusType::Unverified || $this->Status == Enums\ArtworkStatusType::Declined)){
// Editors can edit an artwork, and submitters can edit their own artwork, if it's not yet approved.
return true;
}
@@ -308,7 +308,7 @@ class Artwork{
return true;
}
- if($user->Benefits->CanReviewArtwork && $user->UserId != $this->SubmitterUserId && ($this->Status == ArtworkStatusType::Unverified || $this->Status == ArtworkStatusType::Declined)){
+ if($user->Benefits->CanReviewArtwork && $user->UserId != $this->SubmitterUserId && ($this->Status == Enums\ArtworkStatusType::Unverified || $this->Status == Enums\ArtworkStatusType::Declined)){
// Editors can change the status of artwork they did not submit themselves, and that is not yet approved.
return true;
}
@@ -661,7 +661,7 @@ class Artwork{
* @throws Exceptions\InvalidImageUploadException
*/
public function Create(?string $imagePath = null): void{
- $this->MimeType = ImageMimeType::FromFile($imagePath);
+ $this->MimeType = Enums\ImageMimeType::FromFile($imagePath);
$this->Validate($imagePath, true);
@@ -729,7 +729,7 @@ class Artwork{
$this->_UrlName = null;
if($imagePath !== null){
- $this->MimeType = ImageMimeType::FromFile($imagePath);
+ $this->MimeType = Enums\ImageMimeType::FromFile($imagePath);
// Manually set the updated timestamp, because if we only update the image and nothing else, the row's updated timestamp won't change automatically.
$this->Updated = NOW;
@@ -880,7 +880,7 @@ class Artwork{
$artwork->CompletedYear = HttpInput::Int(POST, 'artwork-year');
$artwork->CompletedYearIsCirca = HttpInput::Bool(POST, 'artwork-year-is-circa') ?? false;
$artwork->Tags = HttpInput::Str(POST, 'artwork-tags') ?? [];
- $artwork->Status = ArtworkStatusType::tryFrom(HttpInput::Str(POST, 'artwork-status') ?? '') ?? ArtworkStatusType::Unverified;
+ $artwork->Status = Enums\ArtworkStatusType::tryFrom(HttpInput::Str(POST, 'artwork-status') ?? '') ?? Enums\ArtworkStatusType::Unverified;
$artwork->EbookUrl = HttpInput::Str(POST, 'artwork-ebook-url');
$artwork->IsPublishedInUs = HttpInput::Bool(POST, 'artwork-is-published-in-us') ?? false;
$artwork->PublicationYear = HttpInput::Int(POST, 'artwork-publication-year');
diff --git a/lib/ArtworkTag.php b/lib/ArtworkTag.php
index 7b27306c..e3313bb6 100644
--- a/lib/ArtworkTag.php
+++ b/lib/ArtworkTag.php
@@ -4,7 +4,7 @@ use function Safe\preg_replace;
class ArtworkTag extends Tag{
public function __construct(){
- $this->Type = TagType::Artwork;
+ $this->Type = Enums\TagType::Artwork;
}
// *******
@@ -45,7 +45,7 @@ class ArtworkTag extends Tag{
$error->Add(new Exceptions\InvalidArtworkTagNameException());
}
- if($this->Type != TagType::Artwork){
+ if($this->Type != Enums\TagType::Artwork){
$error->Add(new Exceptions\InvalidArtworkTagTypeException($this->Type));
}
@@ -77,7 +77,7 @@ class ArtworkTag extends Tag{
from Tags
where Name = ?
and Type = ?
- ', [$artworkTag->Name, TagType::Artwork], ArtworkTag::class);
+ ', [$artworkTag->Name, Enums\TagType::Artwork], ArtworkTag::class);
if(isset($result[0])){
return $result[0];
diff --git a/lib/Collection.php b/lib/Collection.php
index 416a245b..bb6af2a2 100644
--- a/lib/Collection.php
+++ b/lib/Collection.php
@@ -10,7 +10,7 @@ class Collection{
public int $CollectionId;
public string $Name;
public string $UrlName;
- public ?CollectionType $Type = null;
+ public ?Enums\CollectionType $Type = null;
protected ?string $_Url = null;
protected function GetUrl(): string{
@@ -85,7 +85,7 @@ class Collection{
$error->Add(new Exceptions\CollectionUrlNameRequiredException());
}
- if($this->Type !== null && ($this->Type != CollectionType::Series && $this->Type != CollectionType::Set)){
+ if($this->Type !== null && ($this->Type != Enums\CollectionType::Series && $this->Type != Enums\CollectionType::Set)){
$error->Add(new Exceptions\InvalidCollectionTypeException($this->Type));
}
diff --git a/lib/Ebook.php b/lib/Ebook.php
index 894ecb0b..e4c77a8f 100644
--- a/lib/Ebook.php
+++ b/lib/Ebook.php
@@ -775,7 +775,7 @@ class Ebook{
$cm->SequenceNumber = (int)$s;
}
foreach($xml->xpath('/package/metadata/meta[@refines="#' . $id . '"][@property="collection-type"]') ?: [] as $s){
- $cm->Collection->Type = CollectionType::tryFrom((string)$s) ?? CollectionType::Unknown;
+ $cm->Collection->Type = Enums\CollectionType::tryFrom((string)$s) ?? Enums\CollectionType::Unknown;
}
$collectionMemberships[] = $cm;
}
@@ -901,32 +901,32 @@ class Ebook{
foreach($xml->xpath('/package/metadata/dc:source') ?: [] as $element){
$ebookSource = new EbookSource();
$ebookSource->Url = (string)$element;
- $ebookSource->Type = EbookSourceType::Other;
+ $ebookSource->Type = Enums\EbookSourceType::Other;
if(mb_stripos($ebookSource->Url, 'gutenberg.org/') !== false){
- $ebookSource->Type = EbookSourceType::ProjectGutenberg;
+ $ebookSource->Type = Enums\EbookSourceType::ProjectGutenberg;
}
elseif(mb_stripos($ebookSource->Url, 'gutenberg.net.au/') !== false){
- $ebookSource->Type = EbookSourceType::ProjectGutenbergAustralia;
+ $ebookSource->Type = Enums\EbookSourceType::ProjectGutenbergAustralia;
}
elseif(mb_stripos($ebookSource->Url, 'gutenberg.ca/') !== false){
- $ebookSource->Type = EbookSourceType::ProjectGutenbergCanada;
+ $ebookSource->Type = Enums\EbookSourceType::ProjectGutenbergCanada;
}
elseif(mb_stripos($ebookSource->Url, 'archive.org/details') !== false){
// `/details` excludes Wayback Machine URLs which may sometimes occur, for example in Lyrical Ballads.
- $ebookSource->Type = EbookSourceType::InternetArchive;
+ $ebookSource->Type = Enums\EbookSourceType::InternetArchive;
}
elseif(mb_stripos($ebookSource->Url, 'hathitrust.org/') !== false){
- $ebookSource->Type = EbookSourceType::HathiTrust;
+ $ebookSource->Type = Enums\EbookSourceType::HathiTrust;
}
elseif(mb_stripos($ebookSource->Url, 'wikisource.org/') !== false){
- $ebookSource->Type = EbookSourceType::Wikisource;
+ $ebookSource->Type = Enums\EbookSourceType::Wikisource;
}
elseif(mb_stripos($ebookSource->Url, 'books.google.com/') !== false || mb_stripos($ebookSource->Url, 'google.com/books/') !== false){
- $ebookSource->Type = EbookSourceType::GoogleBooks;
+ $ebookSource->Type = Enums\EbookSourceType::GoogleBooks;
}
elseif(mb_stripos($ebookSource->Url, 'www.fadedpage.com') !== false){
- $ebookSource->Type = EbookSourceType::FadedPage;
+ $ebookSource->Type = Enums\EbookSourceType::FadedPage;
}
$sources[] = $ebookSource;
diff --git a/lib/EbookSource.php b/lib/EbookSource.php
index 5bb7f836..e417c409 100644
--- a/lib/EbookSource.php
+++ b/lib/EbookSource.php
@@ -4,7 +4,7 @@ use Safe\DateTimeImmutable;
class EbookSource{
public ?int $EbookId = null;
- public EbookSourceType $Type;
+ public Enums\EbookSourceType $Type;
public string $Url;
public ?int $SortOrder = null;
diff --git a/lib/EbookTag.php b/lib/EbookTag.php
index a38854fa..c7814332 100644
--- a/lib/EbookTag.php
+++ b/lib/EbookTag.php
@@ -1,7 +1,7 @@
class EbookTag extends Tag{
public function __construct(){
- $this->Type = TagType::Ebook;
+ $this->Type = Enums\TagType::Ebook;
}
// *******
@@ -48,7 +48,7 @@ class EbookTag extends Tag{
$error->Add(new Exceptions\EbookTagNameRequiredException());
}
- if($this->Type != TagType::Ebook){
+ if($this->Type != Enums\TagType::Ebook){
$error->Add(new Exceptions\InvalidEbookTagTypeException($this->Type));
}
@@ -81,7 +81,7 @@ class EbookTag extends Tag{
from Tags
where Name = ?
and Type = ?
- ', [$name, TagType::Ebook], EbookTag::class);
+ ', [$name, Enums\TagType::Ebook], EbookTag::class);
if(isset($result[0])){
return $result[0];
diff --git a/lib/ArtworkSortType.php b/lib/Enums/ArtworkSortType.php
similarity index 89%
rename from lib/ArtworkSortType.php
rename to lib/Enums/ArtworkSortType.php
index 9f3a7ed2..5d9e2500 100644
--- a/lib/ArtworkSortType.php
+++ b/lib/Enums/ArtworkSortType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum ArtworkSortType: string{
case CreatedNewest = 'created-newest';
case ArtistAlpha = 'artist-alpha';
diff --git a/lib/ArtworkStatusType.php b/lib/Enums/ArtworkStatusType.php
similarity index 87%
rename from lib/ArtworkStatusType.php
rename to lib/Enums/ArtworkStatusType.php
index 4e2598c7..f4227b5d 100644
--- a/lib/ArtworkStatusType.php
+++ b/lib/Enums/ArtworkStatusType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum ArtworkStatusType: string{
case Unverified = 'unverified';
case Declined = 'declined';
diff --git a/lib/CollectionType.php b/lib/Enums/CollectionType.php
similarity index 85%
rename from lib/CollectionType.php
rename to lib/Enums/CollectionType.php
index f3de077e..5ac5f108 100644
--- a/lib/CollectionType.php
+++ b/lib/Enums/CollectionType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum CollectionType: string{
case Series = 'series';
case Set = 'set';
diff --git a/lib/EbookFormatType.php b/lib/Enums/EbookFormatType.php
similarity index 94%
rename from lib/EbookFormatType.php
rename to lib/Enums/EbookFormatType.php
index ab2e63ac..8d2dfde7 100644
--- a/lib/EbookFormatType.php
+++ b/lib/Enums/EbookFormatType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum EbookFormatType: string{
case Epub = 'epub';
case Azw3 = 'azw3';
diff --git a/lib/EbookSortType.php b/lib/Enums/EbookSortType.php
similarity index 89%
rename from lib/EbookSortType.php
rename to lib/Enums/EbookSortType.php
index 08553ec0..c247951e 100644
--- a/lib/EbookSortType.php
+++ b/lib/Enums/EbookSortType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum EbookSortType: string{
case Newest = 'newest';
case AuthorAlpha = 'author-alpha';
diff --git a/lib/EbookSourceType.php b/lib/Enums/EbookSourceType.php
similarity index 95%
rename from lib/EbookSourceType.php
rename to lib/Enums/EbookSourceType.php
index a39fcd9c..4ac656fe 100644
--- a/lib/EbookSourceType.php
+++ b/lib/Enums/EbookSourceType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum EbookSourceType: string{
case ProjectGutenberg = 'project_gutenberg';
case ProjectGutenbergAustralia = 'project_gutenberg_australia';
diff --git a/lib/ImageMimeType.php b/lib/Enums/ImageMimeType.php
similarity index 98%
rename from lib/ImageMimeType.php
rename to lib/Enums/ImageMimeType.php
index 6e7d7c89..7ac68b94 100644
--- a/lib/ImageMimeType.php
+++ b/lib/Enums/ImageMimeType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
use function Safe\mime_content_type;
enum ImageMimeType: string{
diff --git a/lib/PaymentProcessorType.php b/lib/Enums/PaymentProcessorType.php
similarity index 82%
rename from lib/PaymentProcessorType.php
rename to lib/Enums/PaymentProcessorType.php
index 5cecc6ed..cbe5b036 100644
--- a/lib/PaymentProcessorType.php
+++ b/lib/Enums/PaymentProcessorType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum PaymentProcessorType: string{
case FracturedAtlas = 'fractured_atlas';
}
diff --git a/lib/TagType.php b/lib/Enums/TagType.php
similarity index 83%
rename from lib/TagType.php
rename to lib/Enums/TagType.php
index 63b9ffd3..9529687a 100644
--- a/lib/TagType.php
+++ b/lib/Enums/TagType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum TagType: string{
case Artwork = 'artwork';
case Ebook = 'ebook';
diff --git a/lib/ViewType.php b/lib/Enums/ViewType.php
similarity index 79%
rename from lib/ViewType.php
rename to lib/Enums/ViewType.php
index e0d66d74..ff07c7d0 100644
--- a/lib/ViewType.php
+++ b/lib/Enums/ViewType.php
@@ -1,4 +1,6 @@
+namespace Enums;
+
enum ViewType: string{
case Grid = 'grid';
case List = 'list';
diff --git a/lib/Exceptions/InvalidArtworkTagTypeException.php b/lib/Exceptions/InvalidArtworkTagTypeException.php
index 57b435fb..f6c89a27 100644
--- a/lib/Exceptions/InvalidArtworkTagTypeException.php
+++ b/lib/Exceptions/InvalidArtworkTagTypeException.php
@@ -1,13 +1,11 @@
namespace Exceptions;
-use \TagType;
-
class InvalidArtworkTagTypeException extends AppException{
/** @var string $message */
- protected $message = 'Type should be `TagType::Artwork`.';
+ protected $message = 'Type should be `Enums\TagType::Artwork`.';
- public function __construct(?TagType $tagType){
+ public function __construct(?\Enums\TagType $tagType){
if($tagType !== null){
$this->message .= ' Type provided: ' . $tagType->value;
}
diff --git a/lib/Exceptions/InvalidCollectionTypeException.php b/lib/Exceptions/InvalidCollectionTypeException.php
index f113a82b..82b3bd87 100644
--- a/lib/Exceptions/InvalidCollectionTypeException.php
+++ b/lib/Exceptions/InvalidCollectionTypeException.php
@@ -1,14 +1,11 @@
-message .= ' Type provided: ' . $collectionType->value;
}
diff --git a/lib/Exceptions/InvalidEbookTagTypeException.php b/lib/Exceptions/InvalidEbookTagTypeException.php
index 70f9f81d..a14f95dc 100644
--- a/lib/Exceptions/InvalidEbookTagTypeException.php
+++ b/lib/Exceptions/InvalidEbookTagTypeException.php
@@ -1,13 +1,11 @@
namespace Exceptions;
-use \TagType;
-
class InvalidEbookTagTypeException extends AppException{
/** @var string $message */
- protected $message = 'Type should be `TagType::Ebook`.';
+ protected $message = 'Type should be `Enums\TagType::Ebook`.';
- public function __construct(?TagType $tagType){
+ public function __construct(?\Enums\TagType $tagType){
if($tagType !== null){
$this->message .= ' Type provided: ' . $tagType->value;
}
diff --git a/lib/Exceptions/InvalidFileUploadException.php b/lib/Exceptions/InvalidFileUploadException.php
index 30c4ea87..1467af80 100644
--- a/lib/Exceptions/InvalidFileUploadException.php
+++ b/lib/Exceptions/InvalidFileUploadException.php
@@ -1,5 +1,4 @@
-Path = $path;
- $this->MimeType = ImageMimeType::FromFile($path);
+ $this->MimeType = Enums\ImageMimeType::FromFile($path);
}
/**
@@ -22,16 +22,16 @@ class Image{
*/
private function GetImageHandle(){
switch($this->MimeType){
- case ImageMimeType::JPG:
+ case Enums\ImageMimeType::JPG:
$handle = \Safe\imagecreatefromjpeg($this->Path);
break;
- case ImageMimeType::BMP:
+ case Enums\ImageMimeType::BMP:
$handle = \Safe\imagecreatefrombmp($this->Path);
break;
- case ImageMimeType::PNG:
+ case Enums\ImageMimeType::PNG:
$handle = \Safe\imagecreatefrompng($this->Path);
break;
- case ImageMimeType::TIFF:
+ case Enums\ImageMimeType::TIFF:
$handle = $this->GetImageHandleFromTiff();
break;
default:
diff --git a/lib/Library.php b/lib/Library.php
index e1388363..8fdda6fe 100644
--- a/lib/Library.php
+++ b/lib/Library.php
@@ -16,7 +16,7 @@ class Library{
* @param array = Formatter::EscapeHtml($ebook->Title) ?> No ebooks matched your filters. You can try different filters, or browse all of our ebooks. We also have bulk ebook downloads and a list of collections available, as well as ebook catalog feeds for use directly in your ereader app or RSS reader. typeof="schema:BookSeries" about="= $collection->Url ?>" } ?>>
+
typeof="schema:BookSeries" about="= $collection->Url ?>" } ?>>
if($collection !== null){ ?>
} ?>
@@ -26,7 +26,7 @@ $collection = $collection ?? null;
We also have bulk ebook downloads and a list of collections available, as well as ebook catalog feeds for use directly in your ereader app or RSS reader.
= Template::ContributeAlert() ?> diff --git a/www/ebooks/download.php b/www/ebooks/download.php index dc2ca290..d10ba59d 100644 --- a/www/ebooks/download.php +++ b/www/ebooks/download.php @@ -13,21 +13,21 @@ try{ $identifier = EBOOKS_IDENTIFIER_PREFIX . $urlPath; $ebook = Ebook::GetByIdentifier($identifier); - $format = EbookFormatType::tryFrom(HttpInput::Str(GET, 'format') ?? '') ?? EbookFormatType::Epub; + $format = Enums\EbookFormatType::tryFrom(HttpInput::Str(GET, 'format') ?? '') ?? Enums\EbookFormatType::Epub; switch($format){ - case EbookFormatType::Kepub: + case Enums\EbookFormatType::Kepub: $downloadUrl = $ebook->KepubUrl; break; - case EbookFormatType::Azw3: + case Enums\EbookFormatType::Azw3: $downloadUrl = $ebook->Azw3Url; break; - case EbookFormatType::AdvancedEpub: + case Enums\EbookFormatType::AdvancedEpub: $downloadUrl = $ebook->AdvancedEpubUrl; break; - case EbookFormatType::Epub: + case Enums\EbookFormatType::Epub: default: $downloadUrl = $ebook->EpubUrl; break; diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 5e0648eb..eb9893ed 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -45,21 +45,21 @@ try{ // Divide our sources into transcriptions and scans. foreach($ebook->Sources as $source){ switch($source->Type){ - case EbookSourceType::ProjectGutenberg: - case EbookSourceType::ProjectGutenbergAustralia: - case EbookSourceType::ProjectGutenbergCanada: - case EbookSourceType::Wikisource: - case EbookSourceType::FadedPage: + case Enums\EbookSourceType::ProjectGutenberg: + case Enums\EbookSourceType::ProjectGutenbergAustralia: + case Enums\EbookSourceType::ProjectGutenbergCanada: + case Enums\EbookSourceType::Wikisource: + case Enums\EbookSourceType::FadedPage: $transcriptionSources[] = $source; break; - case EbookSourceType::InternetArchive: - case EbookSourceType::HathiTrust: - case EbookSourceType::GoogleBooks: + case Enums\EbookSourceType::InternetArchive: + case Enums\EbookSourceType::HathiTrust: + case Enums\EbookSourceType::GoogleBooks: $scanSources[] = $source; break; - case EbookSourceType::Other: + case Enums\EbookSourceType::Other: $otherSources[] = $source; break; } @@ -223,7 +223,7 @@ catch(Exceptions\EbookNotFoundException){- Compatible epub — All devices and apps except Kindles and Kobos. + Compatible epub — All devices and apps except Kindles and Kobos.
} ?> @@ -232,7 +232,7 @@ catch(Exceptions\EbookNotFoundException){- azw3 — Kindle devices and apps. if($ebook->KindleCoverUrl !== null){ ?> Also download the Kindle cover thumbnail to see the cover in your Kindle’s library. Despite what you’ve been told, Kindle does not natively support epub. You may also be interested in our Kindle FAQ. }else{ ?> Also see our Kindle FAQ. } ?> + azw3 — Kindle devices and apps. if($ebook->KindleCoverUrl !== null){ ?> Also download the Kindle cover thumbnail to see the cover in your Kindle’s library. Despite what you’ve been told, Kindle does not natively support epub. You may also be interested in our Kindle FAQ. }else{ ?> Also see our Kindle FAQ. } ?>
- kepub — Kobo devices and apps. You may also be interested in our Kobo FAQ. + kepub — Kobo devices and apps. You may also be interested in our Kobo FAQ.
- Advanced epub — An advanced format that uses the latest technology not yet fully supported by most ereaders. + Advanced epub — An advanced format that uses the latest technology not yet fully supported by most ereaders.
- if($source->Type == EbookSourceType::ProjectGutenberg){ ?> + if($source->Type == Enums\EbookSourceType::ProjectGutenberg){ ?> Transcription at Project Gutenberg - }elseif($source->Type == EbookSourceType::ProjectGutenbergAustralia){ ?> + }elseif($source->Type == Enums\EbookSourceType::ProjectGutenbergAustralia){ ?> Transcription at Project Gutenberg Australia - }elseif($source->Type == EbookSourceType::ProjectGutenbergCanada){ ?> + }elseif($source->Type == Enums\EbookSourceType::ProjectGutenbergCanada){ ?> Transcription at Project Gutenberg Canada - }elseif($source->Type == EbookSourceType::Wikisource){ ?> + }elseif($source->Type == Enums\EbookSourceType::Wikisource){ ?> Transcription at Wikisource - }elseif($source->Type == EbookSourceType::FadedPage){ ?> + }elseif($source->Type == Enums\EbookSourceType::FadedPage){ ?> Transcription at Faded Page }else{?> Transcription @@ -364,11 +364,11 @@ catch(Exceptions\EbookNotFoundException){ foreach($scanSources as $source){ ?>
- if($source->Type == EbookSourceType::InternetArchive){ ?> + if($source->Type == Enums\EbookSourceType::InternetArchive){ ?> Page scans at the Internet Archive - }elseif($source->Type == EbookSourceType::HathiTrust){ ?> + }elseif($source->Type == Enums\EbookSourceType::HathiTrust){ ?> Page scans at HathiTrust - }elseif($source->Type == EbookSourceType::GoogleBooks){ ?> + }elseif($source->Type == Enums\EbookSourceType::GoogleBooks){ ?> Page scans at Google Books }else{ ?> Page scans @@ -386,7 +386,7 @@ catch(Exceptions\EbookNotFoundException){ foreach($otherSources as $source){ ?>
- if($source->Type == EbookSourceType::Other){ ?>= Formatter::EscapeHtml(preg_replace(['|https?://(en\.)?|', '|/.+$|'], '', (string)$source->Url)) /* force type to (string) to satisfy PHPStan */ ?> } ?> + if($source->Type == Enums\EbookSourceType::Other){ ?>= Formatter::EscapeHtml(preg_replace(['|https?://(en\.)?|', '|/.+$|'], '', (string)$source->Url)) /* force type to (string) to satisfy PHPStan */ ?> } ?>