/**
  * @param Checklist $checklist
  * @param RepositoryInformation $repositoryInformationNew
  * @return ChecklistItem|null
  */
 public function getChecklistItemByRepositoryInformation(Checklist $checklist = null, RepositoryInformation $repositoryInformationNew)
 {
     if (!$checklist || $checklist->getCheckItems() === null) {
         return null;
     }
     foreach ($checklist->getCheckItems() as $itemData) {
         $repoInfo = IssueReference::getRepositoryInformationFromUrl($itemData['name']);
         if (!$repoInfo) {
             continue;
         }
         if ($repoInfo->isSame($repositoryInformationNew)) {
             $checkItem = new ChecklistItem();
             $checkItem = ObjectPopulator::populate($checkItem, $itemData);
             $checkItem->setIdChecklist($checklist->getId());
             return $checkItem;
         }
     }
     return null;
 }
 /**
  * @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;
 }