From 47c2bac03fe38d7c3f33fc7f7e24cb89b159c739 Mon Sep 17 00:00:00 2001 From: yena Date: Thu, 25 Apr 2024 18:15:55 +0200 Subject: [PATCH] RecoveryStartTime: object should be immutable --- src/Traits/RecoveryStartTimeTrait.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Traits/RecoveryStartTimeTrait.php b/src/Traits/RecoveryStartTimeTrait.php index ae01f688..e28e0012 100644 --- a/src/Traits/RecoveryStartTimeTrait.php +++ b/src/Traits/RecoveryStartTimeTrait.php @@ -2,21 +2,21 @@ namespace App\Traits; -use DateTime; +use DateTimeImmutable; use Exception; use Doctrine\ORM\Mapping as ORM; trait RecoveryStartTimeTrait { #[ORM\Column(nullable: true)] - private ?DateTime $recoveryStartTime = null; + private ?DateTimeImmutable $recoveryStartTime = null; - public function getRecoveryStartTime(): ?DateTime + public function getRecoveryStartTime(): ?DateTimeImmutable { return $this->recoveryStartTime; } - public function setRecoveryStartTime(DateTime $recoveryStartTime): void + public function setRecoveryStartTime(DateTimeImmutable $recoveryStartTime): void { $this->recoveryStartTime = $recoveryStartTime; } @@ -26,7 +26,7 @@ public function setRecoveryStartTime(DateTime $recoveryStartTime): void */ public function updateRecoveryStartTime(): void { - $this->setRecoveryStartTime(new DateTime()); + $this->setRecoveryStartTime(new DateTimeImmutable()); } public function eraseRecoveryStartTime(): void