implement immutable datetime

This commit is contained in:
Dennis Eichhorn 2020-09-10 20:18:47 +02:00
parent 6438c075df
commit 4b181a9a9e

View File

@ -69,7 +69,7 @@ class Item
*/ */
public function __construct() public function __construct()
{ {
$this->createdAt = new \DateTime('now'); $this->createdAt = new \DateTimeImmutable('now');
} }
/** /**
@ -91,7 +91,7 @@ class Item
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCreatedAt() : \DateTime public function getCreatedAt() : \DateTimeInterface
{ {
return $this->createdAt; return $this->createdAt;
} }