mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
Standardize trim and other validation of nullable and non-nullable properties
This commit is contained in:
parent
0eaf2e8e47
commit
85307a7c7e
21 changed files with 347 additions and 16 deletions
15
lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php
Normal file
15
lib/Exceptions/InvalidGitCommitCreatedDatetimeException.php
Normal 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') . '.';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue