Example #1
0
File: Repo.php Project: jankal/mvc
 /**
  * @return array[\GitHub\WebhookList]
  */
 public function webhooks()
 {
     $url = \GitHub::$endpoint . "repositories/{$this->id}/hooks";
     $data = \GitHub::request($url);
     $return = new WebhookList((array) $data, $this);
     return $return;
 }
Example #2
0
File: User.php Project: jankal/mvc
 /**
  * @return array[\GitHub\Repo]
  */
 public function getRepos()
 {
     $url = \GitHub::$endpoint . "users/{$this->login}/repos";
     $data = \GitHub::request($url);
     $return = [];
     foreach ($data as $repo) {
         $return[$repo->name] = new Repo();
         $return[$repo->name]->setData($repo);
     }
     return (array) $return;
 }