class Client

Class GitHubClient.

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, string $repo_name, string $state = null, string $head = null, string $base = null, string $sort = null, string $direction = null)

No description

mixed
get(string $username, string $repo_name, int $pr_num)

Get a single pull request.

mixed
create(string $username, string $repo_name, int $from_issue, string $title, string $head, string $base, string $body = null, bool $maintainer_can_modify = true)

No description

mixed
update(string $username, string $repo_name, int $from_issue, string $title, string $head, string $base, string $body = null, bool $maintainer_can_modify = true)

No description

mixed
listCommits(string $username, string $repo_name, int $pr_num)

No description

mixed
listFiles(string $username, string $repo_name, int $pr_num)

List pull requests files.

bool
isMerged(string $username, string $repo_name, $pr_num)

Get if a pull request has been merged.

bool|mixed
merge(string $username, string $repo_name, int $pr_num, string $commit_title, string|null $commit_message, string $sha, int $merge_method)

No description

mixed
listReviews(string $repo_full_name, int $pull_number)

List reviews on a pull request.

mixed
getReview(string $repo_full_name, int $pull_number, int $review_id)

Get a single review.

void
deletePendingReview(string $repo_full_name, int $pull_number, int $review_id)

Delete a pending review.

mixed
getCommentsForReview(string $repo_full_name, int $pull_number, int $review_id)

Get comments for a single review.

void
createReview(string $repo_full_name, int $pull_number, string $commit_id, string $body, string $event, array $comments)

Create a pull request review.

void
submitReview(string $repo_full_name, int $pull_number, int $review_id, string $body, string $event)

Submit a pull request review.

void
dismissReview(string $repo_full_name, int $pull_number, int $review_id, string $message)

Dismiss a pull request review.

mixed
listComments(string $repo_full_name, int $pull_number, string $sort, string|null $direction, string|null $since)

List comments on a pull request.

mixed
ListCommentsInRepository(string $repo_full_name, string $sort, string $direction, string $since)

List comments in a repository.

mixed
getComment(string $repo_full_name, int $comment_id)

Get a single comment.

void
createComment(string $repo_full_name, int $pull_number, string $body, string $commit_id, string $path, string $position, int|null $in_reply_to)

Create a comment.

void
editComment(string $repo_full_name, int $comment_id, string $body)

Edit a comment.

void
deleteComment(string $repo_full_name, int $comment_id)

Delete a comment.

void
listReviewRequests(string $repo_full_name, int $pull_number)

List review requests.

void
createReviewRequest(string $repo_full_name, int $pull_number, array $reviewers, array $team_reviewers)

Create a review request.

void
deleteReviewRequest(string $repo_full_name, int $pull_number, array $reviewers, array $team_reviewers)

Delete a review request.

Details

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

CICommon constructor.

Parameters

Curl $curl
string $api_url

at line 40
mixed list(string $username, string $repo_name, string $state = null, string $head = null, string $base = null, string $sort = null, string $direction = null)

Parameters

string $username
string $repo_name
string $state
string $head
string $base
string $sort
string $direction

Return Value

mixed

Exceptions

Exception

at line 68
mixed get(string $username, string $repo_name, int $pr_num)

Get a single pull request.

Parameters

string $username
string $repo_name
int $pr_num

Return Value

mixed

Exceptions

Exception

at line 82
mixed create(string $username, string $repo_name, int $from_issue, string $title, string $head, string $base, string $body = null, bool $maintainer_can_modify = true)

Parameters

string $username
string $repo_name
int $from_issue
string $title
string $head
string $base
string $body
bool $maintainer_can_modify

Return Value

mixed

Exceptions

Exception

at line 120
mixed update(string $username, string $repo_name, int $from_issue, string $title, string $head, string $base, string $body = null, bool $maintainer_can_modify = true)

Parameters

string $username
string $repo_name
int $from_issue
string $title
string $head
string $base
string $body
bool $maintainer_can_modify

Return Value

mixed

Exceptions

Exception

at line 141
mixed listCommits(string $username, string $repo_name, int $pr_num)

Parameters

string $username
string $repo_name
int $pr_num

Return Value

mixed

Exceptions

Exception

at line 155
mixed listFiles(string $username, string $repo_name, int $pr_num)

List pull requests files.

Parameters

string $username
string $repo_name
int $pr_num

Return Value

mixed

Exceptions

Exception

at line 171
bool isMerged(string $username, string $repo_name, $pr_num)

Get if a pull request has been merged.

Parameters

string $username
string $repo_name
$pr_num

Return Value

bool

Exceptions

Exception

at line 195
bool|mixed merge(string $username, string $repo_name, int $pr_num, string $commit_title, string|null $commit_message, string $sha, int $merge_method)

Parameters

string $username
string $repo_name
int $pr_num
string $commit_title
string|null $commit_message
string $sha
int $merge_method

Return Value

bool|mixed

Exceptions

Exception

at line 253
mixed listReviews(string $repo_full_name, int $pull_number)

List reviews on a pull request.

Parameters

string $repo_full_name
int $pull_number

Return Value

mixed

Exceptions

Exception

at line 265
mixed getReview(string $repo_full_name, int $pull_number, int $review_id)

Get a single review.

Parameters

string $repo_full_name
int $pull_number
int $review_id

Return Value

mixed

Exceptions

Exception

at line 275
void deletePendingReview(string $repo_full_name, int $pull_number, int $review_id)

Delete a pending review.

Parameters

string $repo_full_name
int $pull_number
int $review_id

Return Value

void

Exceptions

Exception

at line 287
mixed getCommentsForReview(string $repo_full_name, int $pull_number, int $review_id)

Get comments for a single review.

Parameters

string $repo_full_name
int $pull_number
int $review_id

Return Value

mixed

Exceptions

Exception

at line 299
void createReview(string $repo_full_name, int $pull_number, string $commit_id, string $body, string $event, array $comments)

Create a pull request review.

Parameters

string $repo_full_name
int $pull_number
string $commit_id
string $body
string $event
array $comments

Return Value

void

Exceptions

Exception

at line 316
void submitReview(string $repo_full_name, int $pull_number, int $review_id, string $body, string $event)

Submit a pull request review.

Parameters

string $repo_full_name
int $pull_number
int $review_id
string $body
string $event

Return Value

void

Exceptions

Exception

at line 331
void dismissReview(string $repo_full_name, int $pull_number, int $review_id, string $message)

Dismiss a pull request review.

Parameters

string $repo_full_name
int $pull_number
int $review_id
string $message

Return Value

void

Exceptions

Exception

at line 352
mixed listComments(string $repo_full_name, int $pull_number, string $sort, string|null $direction, string|null $since)

List comments on a pull request.

Parameters

string $repo_full_name
int $pull_number
string $sort
string|null $direction
string|null $since

Return Value

mixed

Exceptions

Exception

at line 374
mixed ListCommentsInRepository(string $repo_full_name, string $sort, string $direction, string $since)

List comments in a repository.

Parameters

string $repo_full_name
string $sort
string $direction
string $since

Return Value

mixed

Exceptions

Exception

at line 392
mixed getComment(string $repo_full_name, int $comment_id)

Get a single comment.

Parameters

string $repo_full_name
int $comment_id

Return Value

mixed

Exceptions

Exception

at line 402
void createComment(string $repo_full_name, int $pull_number, string $body, string $commit_id, string $path, string $position, int|null $in_reply_to)

Create a comment.

Parameters

string $repo_full_name
int $pull_number
string $body
string $commit_id
string $path
string $position
int|null $in_reply_to

Return Value

void

Exceptions

Exception

at line 426
void editComment(string $repo_full_name, int $comment_id, string $body)

Edit a comment.

Parameters

string $repo_full_name
int $comment_id
string $body

Return Value

void

Exceptions

Exception

at line 441
void deleteComment(string $repo_full_name, int $comment_id)

Delete a comment.

204

Parameters

string $repo_full_name
int $comment_id

Return Value

void

Exceptions

Exception

at line 451
void listReviewRequests(string $repo_full_name, int $pull_number)

List review requests.

Parameters

string $repo_full_name
int $pull_number

Return Value

void

Exceptions

Exception

at line 461
void createReviewRequest(string $repo_full_name, int $pull_number, array $reviewers, array $team_reviewers)

Create a review request.

Parameters

string $repo_full_name
int $pull_number
array $reviewers
array $team_reviewers

Return Value

void

Exceptions

Exception

at line 476
void deleteReviewRequest(string $repo_full_name, int $pull_number, array $reviewers, array $team_reviewers)

Delete a review request.

Parameters

string $repo_full_name
int $pull_number
array $reviewers
array $team_reviewers

Return Value

void

Exceptions

Exception