/** * Transforms a string (number) to an object (issue). * * @param VersionControl\GitlabIssueBundle\Entity\Issues\IssueComment $issueCommentEntity * * @return array|null * * @throws TransformationFailedException if object (issue) is not found */ public function reverseTransform($issueCommentEntity) { if ($issueCommentEntity === null) { // causes a validation error throw new TransformationFailedException('issueCommentEntity is null'); } $issueComment = array('body' => $issueCommentEntity->getComment()); return $issueComment; }
/** * Creates a New issue Comment on github. * * @param \VersionControl\GitlabIssueBundle\Entity\Issues\IssueComment $issueCommentEntity */ public function createIssueComment(\VersionControl\GitlabIssueBundle\Entity\Issues\IssueComment $issueCommentEntity) { $this->authenticate(); $issueId = $issueCommentEntity->getIssue()->getId(); $comment = $this->client->api('issues')->addComment($this->issueIntegrator->getProjectName(), $issueId, $issueCommentEntity->getComment()); $issueCommentTransfomer = new IssueCommentToEntityTransformer(); return $issueCommentTransfomer->transform($comment); }