Skip to content

Commit 43512fb

Browse files
committed
RecoveryStartTime: object should be immutable
1 parent a42eb79 commit 43512fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Traits/RecoveryStartTimeTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace App\Traits;
44

5-
use DateTime;
5+
use DateTimeImmutable;
66
use Exception;
77
use Doctrine\ORM\Mapping as ORM;
88

99
trait RecoveryStartTimeTrait
1010
{
1111
#[ORM\Column(nullable: true)]
12-
private ?DateTime $recoveryStartTime = null;
12+
private ?DateTimeImmutable $recoveryStartTime = null;
1313

14-
public function getRecoveryStartTime(): ?DateTime
14+
public function getRecoveryStartTime(): ?DateTimeImmutable
1515
{
1616
return $this->recoveryStartTime;
1717
}
1818

19-
public function setRecoveryStartTime(DateTime $recoveryStartTime): void
19+
public function setRecoveryStartTime(DateTimeImmutable $recoveryStartTime): void
2020
{
2121
$this->recoveryStartTime = $recoveryStartTime;
2222
}
@@ -26,7 +26,7 @@ public function setRecoveryStartTime(DateTime $recoveryStartTime): void
2626
*/
2727
public function updateRecoveryStartTime(): void
2828
{
29-
$this->setRecoveryStartTime(new DateTime());
29+
$this->setRecoveryStartTime(new DateTimeImmutable());
3030
}
3131

3232
public function eraseRecoveryStartTime(): void

0 commit comments

Comments
 (0)