/** * @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)]; }