public function delete(int $id) { $comment = $this->commentRepository->getById($id); if (null === $comment) { throw new NotFoundHttpException(); } $this->commentRepository->remove($comment); }