mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 06:40:33 -04:00
Change tag type from string to enum (TagType)
This commit is contained in:
parent
59eee3cc57
commit
5b1bb2a9f0
6 changed files with 26 additions and 16 deletions
|
@ -1,13 +1,15 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use \TagType;
|
||||
|
||||
class InvalidArtworkTagTypeException extends AppException{
|
||||
/** @var string $message */
|
||||
protected $message = 'Type should be `artwork`.';
|
||||
protected $message = 'Type should be `TagType::Artwork`.';
|
||||
|
||||
public function __construct(?string $tagType){
|
||||
if($tagType !== null && trim($tagType) != ''){
|
||||
$this->message .= ' Type provided: ' . $tagType;
|
||||
public function __construct(?TagType $tagType){
|
||||
if($tagType !== null){
|
||||
$this->message .= ' Type provided: ' . $tagType->value;
|
||||
}
|
||||
|
||||
parent::__construct($this->message);
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use \TagType;
|
||||
|
||||
class InvalidEbookTagTypeException extends AppException{
|
||||
/** @var string $message */
|
||||
protected $message = 'Type should be `ebook`.';
|
||||
protected $message = 'Type should be `TagType::Ebook`.';
|
||||
|
||||
public function __construct(?string $tagType){
|
||||
if($tagType !== null && trim($tagType) != ''){
|
||||
$this->message .= ' Type provided: ' . $tagType;
|
||||
public function __construct(?TagType $tagType){
|
||||
if($tagType !== null){
|
||||
$this->message .= ' Type provided: ' . $tagType->value;
|
||||
}
|
||||
|
||||
parent::__construct($this->message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue