Convert SOURCE_ constants to an enum

This commit is contained in:
Mike Colagrosso 2024-01-28 00:01:12 -07:00 committed by Alex Cabal
parent 3606a5c425
commit 09b4385100
4 changed files with 41 additions and 39 deletions

View file

@ -1,9 +1,21 @@
<?
enum EbookSourceType{
case ProjectGutenberg;
case ProjectGutenbergAustralia;
case ProjectGutenbergCanada;
case InternetArchive;
case HathiTrust;
case Wikisource;
case GoogleBooks;
case FadedPage;
case Other;
}
class EbookSource{
public int $Type;
public EbookSourceType $Type;
public string $Url;
public function __construct(int $type, string $url){
public function __construct(EbookSourceType $type, string $url){
$this->Type = $type;
$this->Url = $url;
}