Ejemplo n.º 1
0
 public function apiRepositories()
 {
     $api = new API\Repositories();
     $api->setClient($this->httpClient);
     return $api;
 }
Ejemplo n.º 2
0
 /**
  * Access the number of repositories owned by the user
  * (No way of getting all repos he contributed to)
  * @param  string $user the username of the user (login)
  * @return array of repositories
  */
 public function getUserRepositories($user)
 {
     $reps = [];
     $page = 1;
     $done = false;
     $rep = new Repositories();
     while (!$done) {
         $response = $rep->all($user, ['page' => $page, 'pagelen' => 50]);
         $res = json_decode($response->getContent(), true);
         $reps = array_merge($reps, $res['values']);
         if (count($res['values']) < 50) {
             $done = true;
         }
         $page++;
     }
     return $reps;
 }