10 defined(
'JPATH_PLATFORM') or die;
33 public function create($user, $repo, $org =
'')
36 $path =
'/repos/' . $user .
'/' . $repo .
'/forks';
46 $data = json_encode(array());
50 $response = $this->client->post($this->fetchUrl($path), $data);
53 if ($response->code != 202)
56 $error = json_decode($response->body);
57 throw new DomainException($error->message, $response->code);
60 return json_decode($response->body);
76 public function getList($user, $repo, $page = 0, $limit = 0)
79 $path =
'/repos/' . $user .
'/' . $repo .
'/forks';
82 $response = $this->client->get($this->fetchUrl($path, $page, $limit));
85 if ($response->code != 200)
88 $error = json_decode($response->body);
89 throw new DomainException($error->message, $response->code);
92 return json_decode($response->body);