Use the NOW constant from eec7971

This commit is contained in:
Mike Colagrosso 2024-10-23 17:10:53 -06:00 committed by Alex Cabal
parent df8eac6f82
commit 65d1dcdd88
6 changed files with 6 additions and 21 deletions

View file

@ -30,9 +30,6 @@ class GitCommit{
* @throws Exceptions\ValidationException
*/
public function Validate(): void{
/** @throws void */
$now = new DateTimeImmutable();
$error = new Exceptions\ValidationException();
if(!isset($this->EbookId)){
@ -40,7 +37,7 @@ class GitCommit{
}
if(isset($this->Created)){
if($this->Created > $now){
if($this->Created > NOW){
$error->Add(new Exceptions\InvalidGitCommitCreatedDatetimeException($this->Created));
}
}