mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Additional Ebook validation
This commit is contained in:
parent
3ef1af1237
commit
032032b920
22 changed files with 262 additions and 2 deletions
6
lib/Exceptions/EbookDescriptionRequiredException.php
Normal file
6
lib/Exceptions/EbookDescriptionRequiredException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class EbookDescriptionRequiredException extends AppException{
|
||||
protected $message = 'Ebook Description required.';
|
||||
}
|
|
@ -2,4 +2,5 @@
|
|||
namespace Exceptions;
|
||||
|
||||
class EbookIdentifierRequiredException extends AppException{
|
||||
protected $message = 'Ebook Identifier required.';
|
||||
}
|
||||
|
|
6
lib/Exceptions/EbookIndexableTextRequiredException.php
Normal file
6
lib/Exceptions/EbookIndexableTextRequiredException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class EbookIndexableTextRequiredException extends AppException{
|
||||
protected $message = 'Ebook IndexableText required.';
|
||||
}
|
6
lib/Exceptions/EbookLongDescriptionRequiredException.php
Normal file
6
lib/Exceptions/EbookLongDescriptionRequiredException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class EbookLongDescriptionRequiredException extends AppException{
|
||||
protected $message = 'Ebook LongDescription required.';
|
||||
}
|
|
@ -2,4 +2,5 @@
|
|||
namespace Exceptions;
|
||||
|
||||
class EbookTitleRequiredException extends AppException{
|
||||
protected $message = 'Ebook Title required.';
|
||||
}
|
||||
|
|
5
lib/Exceptions/InvalidEbookAdvancedEpubUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookAdvancedEpubUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookAdvancedEpubUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookAzw3UrlException.php
Normal file
5
lib/Exceptions/InvalidEbookAzw3UrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookAzw3UrlException extends AppException{
|
||||
}
|
13
lib/Exceptions/InvalidEbookCreatedDatetimeException.php
Normal file
13
lib/Exceptions/InvalidEbookCreatedDatetimeException.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookCreatedDatetimeException extends AppException{
|
||||
protected $message = 'Invalid EbookCreated datetime.';
|
||||
|
||||
public function __construct(DateTimeImmutable $createdDatetime){
|
||||
$now = new DateTimeImmutable();
|
||||
$this->message = 'Invalid EbookCreated datetime. ' . $createdDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.';
|
||||
}
|
||||
}
|
5
lib/Exceptions/InvalidEbookDistCoverUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookDistCoverUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookDistCoverUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookEpubUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookEpubUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookEpubUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookGitHubUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookGitHubUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookGitHubUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookKepubUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookKepubUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookKepubUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookKindleCoverUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookKindleCoverUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookKindleCoverUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookReadingEaseException.php
Normal file
5
lib/Exceptions/InvalidEbookReadingEaseException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookReadingEaseException extends AppException{
|
||||
}
|
12
lib/Exceptions/InvalidEbookRepoFilesystemPathException.php
Normal file
12
lib/Exceptions/InvalidEbookRepoFilesystemPathException.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookRepoFilesystemPathException extends AppException{
|
||||
protected $message = 'Invalid RepoFilesystemPath.';
|
||||
|
||||
public function __construct(?string $path){
|
||||
$this->message = 'Invalid RepoFilesystemPath. Not readable: ' . $path;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookTextSinglePageByteCountException extends AppException{
|
||||
}
|
13
lib/Exceptions/InvalidEbookUpdatedDatetimeException.php
Normal file
13
lib/Exceptions/InvalidEbookUpdatedDatetimeException.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookUpdatedDatetimeException extends AppException{
|
||||
protected $message = 'Invalid EbookUpdated datetime.';
|
||||
|
||||
public function __construct(DateTimeImmutable $updatedDatetime){
|
||||
$now = new DateTimeImmutable();
|
||||
$this->message = 'Invalid EbookUpdated datetime. ' . $updatedDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.';
|
||||
}
|
||||
}
|
5
lib/Exceptions/InvalidEbookWikipediaUrlException.php
Normal file
5
lib/Exceptions/InvalidEbookWikipediaUrlException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookWikipediaUrlException extends AppException{
|
||||
}
|
5
lib/Exceptions/InvalidEbookWordCountException.php
Normal file
5
lib/Exceptions/InvalidEbookWordCountException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookWordCountException extends AppException{
|
||||
}
|
12
lib/Exceptions/InvalidEbookWwwFilesystemPathException.php
Normal file
12
lib/Exceptions/InvalidEbookWwwFilesystemPathException.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookWwwFilesystemPathException extends AppException{
|
||||
protected $message = 'Invalid WwwFilesystemPath.';
|
||||
|
||||
public function __construct(?string $path){
|
||||
$this->message = 'Invalid WwwFilesystemPath. Not readable: ' . $path;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue