Workaround a bug in Safe-PHP causes PHPStan errors

This commit is contained in:
Mike Colagrosso 2024-05-23 22:13:45 -06:00 committed by Alex Cabal
parent 72d679a04f
commit 5c69923176
3 changed files with 7 additions and 10 deletions

View file

@ -7,10 +7,8 @@ class InvalidEbookCreatedDatetimeException extends AppException{
/** @var string $message */
protected $message = 'Invalid EbookCreated datetime.';
/**
* @throws \Exception
*/
public function __construct(DateTimeImmutable $createdDatetime){
/** @throws void */
$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') . '.';
}