class Client

Traits

Properties

protected $curl from CICommon
protected $api_url from CICommon

Methods

__construct(Curl $curl, string $api_url)

CICommon constructor.

from CICommon
mixed
list(string $username = null, string $since)

List a user's gists.

all()

GitHub 所有用户发布的最新 30*100 条 gists.

mixed
ListStarred(string $since = null)

List starred gists.

mixed
find(string $gist_id)

Get a single gist.

mixed
getSpecificRevision(string $gist_id, string $sha)

Get a specific revision of a gist.

void
create(array $files, string $description, bool $public = true)

Create a gist.

void
edit(array $files, string $description, string $gist_id)

Edit a gist.

mixed
listCommits(string $gist_id)

List gist commits.

void
star(string $gist_id)

Star a gist.

void
unstar(string $gist_id)

Unstar a gist.

bool
isStarred(string $gist_id)

Check if a gist is starred.

void
fork(string $gist_id)

Fork a gist.

mixed
listFork(string $gist_id)

List gist forks.

void
delete(string $gist_id)

Delete a gist.

Details

in CICommon at line 18
__construct(Curl $curl, string $api_url)

CICommon constructor.

Parameters

Curl $curl
string $api_url

at line 25
mixed list(string $username = null, string $since)

List a user's gists.

Parameters

string $username
string $since

Return Value

mixed

Exceptions

Exception

See also

at line 39
all()

GitHub 所有用户发布的最新 30*100 条 gists.

at line 51
mixed ListStarred(string $since = null)

List starred gists.

Parameters

string $since

Return Value

mixed

Exceptions

Exception

at line 63
mixed find(string $gist_id)

Get a single gist.

Parameters

string $gist_id

Return Value

mixed

Exceptions

Exception

at line 75
mixed getSpecificRevision(string $gist_id, string $sha)

Get a specific revision of a gist.

Parameters

string $gist_id
string $sha

Return Value

mixed

Exceptions

Exception

at line 89
void create(array $files, string $description, bool $public = true)

Create a gist.

201

Parameters

array $files
string $description
bool $public

Return Value

void

Exceptions

Exception

at line 107
void edit(array $files, string $description, string $gist_id)

Edit a gist.

Parameters

array $files
string $description
string $gist_id

Return Value

void

Exceptions

Exception

at line 124
mixed listCommits(string $gist_id)

List gist commits.

Parameters

string $gist_id

Return Value

mixed

Exceptions

Exception

at line 134
void star(string $gist_id)

Star a gist.

Parameters

string $gist_id

Return Value

void

Exceptions

Exception

at line 144
void unstar(string $gist_id)

Unstar a gist.

Parameters

string $gist_id

Return Value

void

Exceptions

Exception

at line 158
bool isStarred(string $gist_id)

Check if a gist is starred.

204

Parameters

string $gist_id

Return Value

bool

Exceptions

Exception

at line 182
void fork(string $gist_id)

Fork a gist.

201

Parameters

string $gist_id

Return Value

void

Exceptions

Exception

at line 194
mixed listFork(string $gist_id)

List gist forks.

Parameters

string $gist_id

Return Value

mixed

Exceptions

Exception

at line 206
void delete(string $gist_id)

Delete a gist.

204

Parameters

string $gist_id

Return Value

void

Exceptions

Exception