commentId = $commentId; $this->wp = $wp; } public function getCommentId(): int { return $this->commentId; } public function getComment(): ?\WP_Comment { if ($this->comment === null) { $comment = $this->wp->getComment($this->commentId); $this->comment = $comment instanceof \WP_Comment ? $comment : null; } return $this->comment; } }