Ejemplo n.º 1
0
 /**
  * Get the instance as an array.
  *
  * @return array
  */
 public function toArray()
 {
     $commits = [];
     /** @var Commit $commit */
     foreach ($this->log->getCommits() as $commit) {
         $commits[] = $this->commitToArray($commit);
     }
     return $commits;
 }
Ejemplo n.º 2
0
 public function fromLog(Log $log)
 {
     $log->setLimit(self::DEFAULT_LIMIT);
     $commits = array();
     foreach ($log as $commit) {
         array_push($commits, array('hash' => $commit->getHash(), 'fixedShortHash' => $commit->getFixedShortHash(), 'message' => $commit->getMessage(), 'shortMessage' => $commit->getShortMessage(), 'authorName' => $commit->getAuthorName(), 'authorEmail' => $commit->getAuthorEmail()));
     }
     $this->setCommits($commits);
     $this->setCommitCount(count($log));
 }
 /**
  * {@inheritdoc}
  */
 public function count()
 {
     return $this->log->countCommits();
 }