/** * @param $checklistId * @return Checklist|false */ public function getChecklistById($checklistId) { $checklist = new Checklist(); $checklist->setId($checklistId); $checklistRequest = new GetChecklistRequest($checklist); return $this->getResponse($checklistRequest); }
/** * @return string */ public function getRelativeUrl() { return 'checklists/' . $this->object->getId(); }
/** * @return string */ public function getRelativeUrl() { return 'cards/' . $this->card->getId() . '/checklist/' . $this->checklist->getId() . '/checkItem/' . $this->object->getId() . '/state'; }
/** * @return array */ public function getData() { return ['name' => $this->object->getName(), 'idBoard' => $this->object->getIdBoard(), 'idCard' => $this->object->getIdCard()]; }
/** * @param Checklist $checklist * @param RepositoryInformation $repoInfo * @param $title * @return ChecklistItem */ public function createChecklistItem(Checklist $checklist, RepositoryInformation $repoInfo, $title) { $itemName = IssueReference::createReferenceFromRepositoryInformation($repoInfo, $title); $checklistItem = new ChecklistItem(); $checklistItem->setIdChecklist($checklist->getId()); $checklistItem->setName($itemName); return $this->api->createChecklistItem($checklistItem); }
/** * @param $comment * @param Checklist $checklist * @return mixed|string */ private function prepareBadgeCommentForMentionedRepositories($comment, Checklist $checklist) { $replaceWords = []; /* @var RepositoryInformation $mentionedIssue */ foreach ($this->mentionedRepositories as $mentionedRepository) { //--___________________________________________________--> //-- if checklist items are mentioned add badge foreach ($checklist->getCheckItems() as $checkItem) { if (!$checkItem instanceof ChecklistItem) { //--___________________________________________________--> //-- prepare /* @var CheckListItem $checkListItem */ $checkListItem = ObjectPopulator::populate(new ChecklistItem(), $checkItem); $checkListItemName = $checkListItem->getName(); $repositoryInformationFromChecklistItemName = IssueReference::getRepositoryInformationFromUrl($checkListItemName); //--___________________________________________________--> //-- check if repository exists try { $this->githubClient->issues()->show($this->getGithubUserName(), $repositoryInformationFromChecklistItemName->getRepositoryName(), $repositoryInformationFromChecklistItemName->getIssueId()); } catch (\Github\Exception\RuntimeException $runtimeException) { continue; } //--___________________________________________________--> //-- add issue badge if repository was mentioned if ($repositoryInformationFromChecklistItemName->getRepositoryName() == $mentionedRepository) { $comment .= $this->getIssueBadge($repositoryInformationFromChecklistItemName); } } } $replaceWords[] = '[' . $mentionedRepository . ']'; } $comment = str_replace($replaceWords, '', $comment); return $comment; }