ulogin = (strlen($user) == 0 || $user == "me" ? "me" : $user); $this->authenticated = $this->ulogin == "me"; parent::__construct($api_url, $api_token); } protected function set_scope(string $method) { switch($method) { default: $this->scope = ($this->ulogin == "me" ? "/user" : "/users/" . $this->ulogin); } } public function authenticated() { return $this->authenticated; } public function repos() { return new Repos($this->url, $this->token, $this); } public function repo(string $name) { return (new Repo($this->url, $this->token, $this, $name))->load(); } protected function json_set_property($obj) { foreach ($obj as $key => $value) { $key = 'u' . $key; if (property_exists($this, $key)) $this->{$key} = $value; } } } ?>