3 namespace app\Github\Fetch
;
5 use app\Github\Exception\ReposFetchFailed
;
8 use http\Client\Request
;
10 class Repo
extends Fetch
12 function getRequest() {
13 $url = $this->url
->mod("/repos/" . $this->args
["repo"]);
14 return new Request("GET", $url, [
15 "Accept" => "application/vnd.github.v3+json",
16 "Authorization" => "token " . $this->api
->getToken(),
20 function getException($message, $code, $previous = null) {
21 return new ReposFetchFailed($message, $code, $previous);
24 function getCacheKey() {
25 return $this->api
->getCacheKey(sprintf("repo:%s", $this->args
["repo"]));