/**
  * @param Commit $commit
  * @return array
  */
 protected function commitMessageArray(Commit $commit)
 {
     return array('hash' => $commit->getHash(), 'revision' => $commit->getRevision(), 'message' => $commit->getMessage(), 'committer' => $commit->getCommitterEmail(), 'data' => $commit->getCommitterDate());
 }
Exemple #2
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)];
 }