posts = $posts; $this->users = $users; } public function create($postId, $userId, PostCommentForm $form): PostComment { $post = $this->posts->get($postId); $user = $this->users->get($userId); $comment = $post->addComment($user->id, $form->parentId, $form->text); $this->posts->save($post); return $comment; } }