Skip to content

Commit

Permalink
RecoveryStartTime: object should be immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
y3n4 committed Apr 25, 2024
1 parent b545369 commit 47c2bac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Traits/RecoveryStartTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 47c2bac

Please sign in to comment.