userRepo->findByEmail( new EmailAddress('bob@example.com'), ); $carol = $this->userRepo->findByEmail( new EmailAddress('carol@example.com'), ); if ($bob === null || $carol === null) { return; } $posts = $this->postRepo->findRecent(10); if (count($posts) === 0) { return; } $firstPost = $posts[0]; $this->commentRepo->create(new CreateCommentDto( postId: $firstPost->getId(), userId: $bob->getId(), body: 'Welcome aboard!', createdAt: $now, )); $this->commentRepo->create(new CreateCommentDto( postId: $firstPost->getId(), userId: $carol->getId(), body: 'Looking forward to more.', createdAt: $now->modify('+1 minute'), )); } }