Fix PHPStan errors

This commit is contained in:
Mike Colagrosso 2024-05-20 20:37:25 -06:00 committed by Alex Cabal
parent 79daa82bf4
commit 72d679a04f
12 changed files with 53 additions and 0 deletions

View file

@ -2,5 +2,6 @@
namespace Exceptions;
class EbookDescriptionRequiredException extends AppException{
/** @var string $message */
protected $message = 'Ebook Description required.';
}

View file

@ -2,5 +2,6 @@
namespace Exceptions;
class EbookIdentifierRequiredException extends AppException{
/** @var string $message */
protected $message = 'Ebook Identifier required.';
}

View file

@ -2,5 +2,6 @@
namespace Exceptions;
class EbookIndexableTextRequiredException extends AppException{
/** @var string $message */
protected $message = 'Ebook IndexableText required.';
}

View file

@ -2,5 +2,6 @@
namespace Exceptions;
class EbookLongDescriptionRequiredException extends AppException{
/** @var string $message */
protected $message = 'Ebook LongDescription required.';
}

View file

@ -2,5 +2,6 @@
namespace Exceptions;
class EbookTitleRequiredException extends AppException{
/** @var string $message */
protected $message = 'Ebook Title required.';
}

View file

@ -4,8 +4,12 @@ namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidEbookCreatedDatetimeException extends AppException{
/** @var string $message */
protected $message = 'Invalid EbookCreated datetime.';
/**
* @throws \Exception
*/
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') . '.';

View file

@ -4,6 +4,7 @@ namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidEbookRepoFilesystemPathException extends AppException{
/** @var string $message */
protected $message = 'Invalid RepoFilesystemPath.';
public function __construct(?string $path){

View file

@ -4,8 +4,12 @@ namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidEbookUpdatedDatetimeException extends AppException{
/** @var string $message */
protected $message = 'Invalid EbookUpdated datetime.';
/**
* @throws \Exception
*/
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') . '.';

View file

@ -4,6 +4,7 @@ namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidEbookWwwFilesystemPathException extends AppException{
/** @var string $message */
protected $message = 'Invalid WwwFilesystemPath.';
public function __construct(?string $path){