public function getComments($id)
{
$response = $this->client->apiIssues()->comments()->all($this->getUsername(), $this->getRepository(), $id);
$resultArray = json_decode($response->getContent(), true);
$comments = [];
foreach ($resultArray as $comment) {
$comments[] = ['id' => $comment['comment_id'], 'url' => sprintf('%s/%s/%s/issue/%d/#comment-%d', $this->domain, $this->username, $this->getRepository(), $id, $comment['comment_id']), 'user' => ['login' => $comment['author_info']['username']], 'body' => $comment['content'], 'created_at' => new \DateTime($comment['utc_created_on']), 'updated_at' => !empty($comment['utc_updated_on']) ? new \DateTime($comment['utc_updated_on']) : null];
}
return $comments;
}