3 namespace app\Github\Fetch
;
5 use app\Github\Exeption\UserFetchFailed
;
7 use http\Client\Request
;
9 class User
extends Fetch
11 function getRequest() {
12 $url = $this->url
->mod("/user");
13 return new Request("GET", $url, [
14 "Accept" => "application/vnd.github.v3+json",
15 "Authorization" => "token " . $this->api
->getToken()
19 function getException($message, $code, $previous = null) {
20 return new UserFetchFailed($message, $code, $previous);
23 function getCacheKey() {
24 return $this->api
->getCacheKey("user");