public function __invoke() { $title = $this->event->getIssue()->getTitle(); $this->loadCard($title, true); $this->loadChecklist($this->card); $checkItem = $this->getTrelloApiHelper()->getChecklistItemByRepositoryInformation($this->checklist, $this->getRepositoryInformation()); if ($checkItem) { $this->updateItemIfStatusChanged($checkItem, ChecklistItem::STATUS_COMPLETE); } }
public function __invoke() { $title = $this->event->getIssue()->getTitle(); $this->loadCard($title, true); $this->loadChecklist($this->card, true); $repoInfo = $this->getRepositoryInformation(); if (!$repoInfo || !$this->checklist) { return; } $checkItem = $this->getTrelloApiHelper()->getChecklistItemByRepositoryInformation($this->checklist, $repoInfo); if (!$checkItem) { $this->createNewItem($repoInfo, $title); } else { $this->updateItemIfStatusChanged($checkItem, ChecklistItem::STATUS_INCOMPLETE); } }