@@ -85,7 +85,7 @@ private function loadPosts(ObjectManager $manager): void
85
85
$ comment = new Comment ();
86
86
$ comment ->setAuthor ($ commentAuthor );
87
87
$ comment ->setContent ($ this ->getRandomText (random_int (255 , 512 )));
88
- $ comment ->setPublishedAt (new \DateTime ('now + ' .$ i .'seconds ' ));
88
+ $ comment ->setPublishedAt (new \DateTimeImmutable ('now + ' .$ i .'seconds ' ));
89
89
90
90
$ post ->addComment ($ comment );
91
91
}
@@ -130,7 +130,7 @@ private function getTagData(): array
130
130
/**
131
131
* @throws \Exception
132
132
*
133
- * @return array<int, array{0: string, 1: AbstractUnicodeString, 2: string, 3: string, 4: \DateTime , 5: User, 6: array<Tag>}>
133
+ * @return array<int, array{0: string, 1: AbstractUnicodeString, 2: string, 3: string, 4: \DateTimeImmutable , 5: User, 6: array<Tag>}>
134
134
*/
135
135
private function getPostData (): array
136
136
{
@@ -147,7 +147,7 @@ private function getPostData(): array
147
147
$ this ->slugger ->slug ($ title )->lower (),
148
148
$ this ->getRandomText (),
149
149
$ this ->getPostContent (),
150
- (new \DateTime ('now - ' .$ i .'days ' ))->setTime (random_int (8 , 17 ), random_int (7 , 49 ), random_int (0 , 59 )),
150
+ (new \DateTimeImmutable ('now - ' .$ i .'days ' ))->setTime (random_int (8 , 17 ), random_int (7 , 49 ), random_int (0 , 59 )),
151
151
// Ensure that the first post is written by Jane Doe to simplify tests
152
152
$ user ,
153
153
$ this ->getRandomTags (),
0 commit comments