Skip to content

Commit 3b69d2a

Browse files
committed
minor #15010 Minor change to use DateTimeImmutable instead of DateTime (Erdou)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead. Discussion ---------- Minor change to use DateTimeImmutable instead of DateTime Using DateTimeImmutable instead of DateTime when no mutation is needed improves performances. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 8c6912b Minor change to use DateTimeImmutable instead of DateTime
2 parents 4d7a063 + 8c6912b commit 3b69d2a

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)