@@ -85,7 +85,7 @@ private function loadPosts(ObjectManager $manager): void
8585 $ comment = new Comment ();
8686 $ comment ->setAuthor ($ commentAuthor );
8787 $ comment ->setContent ($ this ->getRandomText (random_int (255 , 512 )));
88- $ comment ->setPublishedAt (new \DateTime ('now + ' .$ i .'seconds ' ));
88+ $ comment ->setPublishedAt (new \DateTimeImmutable ('now + ' .$ i .'seconds ' ));
8989
9090 $ post ->addComment ($ comment );
9191 }
@@ -130,7 +130,7 @@ private function getTagData(): array
130130 /**
131131 * @throws \Exception
132132 *
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>}>
134134 */
135135 private function getPostData (): array
136136 {
@@ -147,7 +147,7 @@ private function getPostData(): array
147147 $ this ->slugger ->slug ($ title )->lower (),
148148 $ this ->getRandomText (),
149149 $ 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 )),
151151 // Ensure that the first post is written by Jane Doe to simplify tests
152152 $ user ,
153153 $ this ->getRandomTags (),
0 commit comments