Changeset View
Changeset View
Standalone View
Standalone View
src/applications/nuance/github/NuanceGitHubRawEvent.php
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | public function getID() { | ||||
if ($id) { | if ($id) { | ||||
return (int)$id; | return (int)$id; | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
public function getComment() { | public function getComment() { | ||||
return 'TODO: Actually extract comment text.'; | if ($this->type == self::TYPE_REPOSITORY) { | ||||
if ($this->isIssueEvent() || $this->isPullRequestEvent()) { | |||||
$raw = $this->raw; | |||||
$type = idx($raw, 'type'); | |||||
switch ($type) { | |||||
case 'IssueCommentEvent': | |||||
return idxv($raw, array('payload', 'comment', 'body')); | |||||
} | |||||
} | |||||
} | |||||
return null; | |||||
} | } | ||||
public function getURI() { | public function getURI() { | ||||
$raw = $this->raw; | $raw = $this->raw; | ||||
if ($this->isIssueEvent() || $this->isPullRequestEvent()) { | if ($this->isIssueEvent() || $this->isPullRequestEvent()) { | ||||
if ($this->type == self::TYPE_ISSUE) { | if ($this->type == self::TYPE_ISSUE) { | ||||
$uri = idxv($raw, array('issue', 'html_url')); | $uri = idxv($raw, array('issue', 'html_url')); | ||||
▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines |