Standardize trim and other validation of nullable and non-nullable properties

This commit is contained in:
Mike Colagrosso 2024-10-05 00:15:02 -06:00 committed by Alex Cabal
parent 0eaf2e8e47
commit 85307a7c7e
21 changed files with 347 additions and 16 deletions

View file

@ -0,0 +1,15 @@
<?
namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidGitCommitCreatedDatetimeException extends AppException{
/** @var string $message */
protected $message = 'Invalid GitCommit Created datetime.';
public function __construct(DateTimeImmutable $createdDatetime){
/** @throws void */
$now = new DateTimeImmutable();
$this->message = 'Invalid GitCommit Created datetime. ' . $createdDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.';
}
}