3 namespace app\Github\API\Repos
;
5 use app\Github\API\Call
;
6 use app\Github\Exception\RequestException
;
7 use http\Client\Request
;
8 use http\Client\Response
;
10 class ReadRepo
extends Call
13 $url = $this->url
->mod(uri_template("./repos/{+repo}", $this->args
));
14 $request = new Request("GET", $url, [
15 "Authorization" => "token " . $this->api
->getToken(),
16 "Accept" => $this->config
->api
->accept
,
21 function response(Response
$response) {
22 if ($response->getResponseCode() >= 400 ||
null === ($json = json_decode($response->getBody()))) {
23 throw new RequestException($response);
26 $this->saveToCache($result);