Esempio n. 1
0
 /**
  * (non-PHPdoc)
  * @see \MB\DashboardBundle\Model\Connector\ConnectorInterface::fillCommit()
  */
 public function fillCommit(CommitInterface $commit, \stdClass $data, SourceProjectInterface $project)
 {
     $commit->setSourceId($data->id);
     $commit->setAuthorEmail($data->author->emailAddress);
     $commit->setAuthorName(isset($data->author->displayName) ? $data->author->displayName : $data->author->name);
     $commit->setHash($data->id);
     $commit->setComment($data->message);
     $commit->setProject($project);
     $commit->setUrl($this->host . '/projects/' . $project->getSourceGroup()->getPath() . '/repos/' . $project->getSourcePath() . '/commits/' . $data->id);
     $datetime = new \DateTime();
     $datetime->setTimestamp($data->authorTimestamp / 1000);
     $commit->setDatetime($datetime);
     return $commit;
 }
Esempio n. 2
0
 /**
  * (non-PHPdoc)
  * @see \MB\DashboardBundle\Model\Connector\ConnectorInterface::fillCommit()
  */
 public function fillCommit(CommitInterface $commit, \stdClass $data, SourceProjectInterface $project)
 {
     $commit->setSourceId($data->sha);
     $commit->setAuthorEmail($data->commit->author->email);
     $commit->setAuthorName($data->commit->author->name);
     $commit->setHash($data->sha);
     $commit->setComment($data->commit->message);
     $commit->setProject($project);
     $commit->setUrl($data->html_url);
     $commit->setDatetime(\DateTime::createFromFormat(\DateTime::ISO8601, $data->commit->author->date));
     return $commit;
 }
Esempio n. 3
0
 /**
  * (non-PHPdoc)
  * @see \MB\DashboardBundle\Model\Connector\ConnectorInterface::fillCommit()
  */
 public function fillCommit(CommitInterface $commit, \stdClass $data, SourceProjectInterface $project)
 {
     $commit->setSourceId($data->id);
     $commit->setAuthorEmail($data->author_email);
     $commit->setAuthorName($data->author_name);
     $commit->setHash($data->id);
     $commit->setComment($data->message);
     $commit->setProject($project);
     $commit->setUrl($project->getSourceUrl() . '/commit/' . $data->id);
     $datetime = substr($data->created_at, 0, 19) . substr($data->created_at, -6);
     dump($data->created_at);
     dump($datetime);
     $commit->setDatetime(\DateTime::createFromFormat(\DateTime::ISO8601, $datetime));
     return $commit;
 }