Skip to content

Commit 5462ec5

Browse files
authored
Minor change to use DateTimeImmutable instead of DateTime
Using DateTimeImmutable instead of DateTime when no mutation is needed improves performances.
1 parent 862be12 commit 5462ec5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doctrine/events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ define a callback for the ``prePersist`` Doctrine event:
7676
*/
7777
public function setCreatedAtValue(): void
7878
{
79-
$this->createdAt = new \DateTime();
79+
$this->createdAt = new \DateTimeImmutable();
8080
}
8181
}
8282

0 commit comments

Comments
 (0)