Пример #1
0
 /**
  * @param $commit
  * @return array
  */
 public static function commitToArray(Commit $commit)
 {
     $branches = [];
     foreach ($commit->getIncludingBranches(true, false) as $branch) {
         $branches[] = $branch->getName();
     }
     return ['hash' => $commit->getHash(), 'shortHash' => $commit->getShortHash(), 'message' => $commit->getMessage(), 'shortMessage' => $commit->getShortMessage(), 'image' => "//www.gravatar.com/avatar/" . md5($commit->getAuthorEmail()), 'branches' => $branches, 'name' => $commit->getAuthorName(), 'email' => $commit->getAuthorEmail(), 'date' => $commit->getCommitterDate()->format(DATE_ISO8601)];
 }
Пример #2
0
 /**
  * @param Release $release
  * @param $commit
  * @return array
  */
 protected function describeCommitFields(Release $release, Commit $commit)
 {
     return [['title' => 'Commit', 'value' => $commit->getShortHash(), 'short' => true], ['title' => 'Message', 'value' => $commit->getShortMessage(), 'short' => true], ['title' => 'Author', 'value' => $commit->getAuthorName() . '(' . $commit->getAuthorEmail() . ')'], ['title' => 'Details', 'value' => $release->url()]];
 }
Пример #3
0
 protected function commitToArray(Commit $commit)
 {
     $commitData = array('hash' => $commit->getHash(), 'shortHash' => $commit->getShortHash(), 'parentHashes' => $commit->getParentHashes(), 'shortMessage' => $commit->getShortMessage(), 'authorName' => $commit->getAuthorName(), 'authorEmail' => $commit->getAuthorEmail(), 'authorDate' => $commit->getAuthorDate(), 'message' => $commit->getMessage());
     return $commitData;
 }