mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Add a Type enum to Tags for artwork/ebook
This commit is contained in:
parent
ee29c526f8
commit
402dae95ff
7 changed files with 62 additions and 10 deletions
15
lib/Exceptions/InvalidArtworkTagTypeException.php
Normal file
15
lib/Exceptions/InvalidArtworkTagTypeException.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidArtworkTagTypeException extends AppException{
|
||||
/** @var string $message */
|
||||
protected $message = 'Type should be `artwork`.';
|
||||
|
||||
public function __construct(?string $tagType){
|
||||
if($tagType !== null && trim($tagType) != ''){
|
||||
$this->message .= ' Type provided: ' . $tagType;
|
||||
}
|
||||
|
||||
parent::__construct($this->message);
|
||||
}
|
||||
}
|
15
lib/Exceptions/InvalidEbookTagTypeException.php
Normal file
15
lib/Exceptions/InvalidEbookTagTypeException.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookTagTypeException extends AppException{
|
||||
/** @var string $message */
|
||||
protected $message = 'Type should be `ebook`.';
|
||||
|
||||
public function __construct(?string $tagType){
|
||||
if($tagType !== null && trim($tagType) != ''){
|
||||
$this->message .= ' Type provided: ' . $tagType;
|
||||
}
|
||||
|
||||
parent::__construct($this->message);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue