JGithubPulls

Extends \JGithubObject

GitHub API Pull Requests class for the Joomla Platform.

package

Joomla.Platform

subpackage

GitHub

since

11.3

Methods

__construct

Constructor.

__construct(\JRegistry &$options = null, \JGithubHttp $client = null) 
inherited
since

11.3

Arguments

$options

\JRegistry

$client

\JGithubHttpThe HTTP client object.

create

Method to create a pull request.

create(string $user, string $repo, string $title, string $base, string $head, string $body = '') : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$title

stringThe title of the new pull request.

$base

stringThe branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

$head

stringThe branch (or git ref) where your changes are implemented.

$body

stringThe body text for the new pull request.

Response

object

createComment

Method to create a comment on a pull request.

createComment(string $user, string $repo, integer $pullId, string $body, string $commitId, string $filePath, string $position) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$body

stringThe comment body text.

$commitId

stringThe SHA1 hash of the commit to comment on.

$filePath

stringThe Relative path of the file to comment on.

$position

stringThe line index in the diff to comment on.

Response

object

createCommentReply

Method to create a comment in reply to another comment.

createCommentReply(string $user, string $repo, integer $pullId, string $body, integer $inReplyTo) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$body

stringThe comment body text.

$inReplyTo

integerThe id of the comment to reply to.

Response

object

createFromIssue

Method to create a pull request from an existing issue.

createFromIssue(string $user, string $repo, integer $issueId, string $base, string $head) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$issueId

integerThe issue number for which to attach the new pull request.

$base

stringThe branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo.

$head

stringThe branch (or git ref) where your changes are implemented.

Response

object

deleteComment

Method to delete a comment on a pull request.

deleteComment(string $user, string $repo, integer $commentId) : void
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$commentId

integerThe id of the comment to delete.

edit

Method to update a pull request.

edit(string $user, string $repo, integer $pullId, string $title = null, string $body = null, string $state = null) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$title

stringThe optional new title for the pull request.

$body

stringThe optional new body text for the pull request.

$state

stringThe optional new state for the pull request. [open, closed]

Response

object

editComment

Method to update a comment on a pull request.

editComment(string $user, string $repo, integer $commentId, string $body) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$commentId

integerThe id of the comment to update.

$body

stringThe new body text for the comment.

Response

object

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, integer $page, integer $limit) : string
inherited
since

11.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe request URL.

get

Method to get a single pull request.

get(string $user, string $repo, integer $pullId) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

Response

object

getComment

Method to get a specific comment on a pull request.

getComment(string $user, string $repo, integer $commentId) : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$commentId

integerThe comment id to get.

Response

object

getComments

Method to get the list of comments on a pull request.

getComments(string $user, string $repo, integer $pullId, integer $page, integer $limit) : array
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getCommits

Method to get a list of commits for a pull request.

getCommits(string $user, string $repo, integer $pullId, integer $page, integer $limit) : array
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getFiles

Method to get a list of files for a pull request.

getFiles(string $user, string $repo, integer $pullId, integer $page, integer $limit) : array
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

getList

Method to list pull requests.

getList(string $user, string $repo, string $state = 'open', integer $page, integer $limit) : array
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$state

stringThe optional state to filter requests by. [open, closed]

$page

integerThe page number from which to get items.

$limit

integerThe number of items on a page.

Response

array

isMerged

Method to check if a pull request has been merged.

isMerged(string $user, string $repo, integer $pullId) : boolean
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number. The pull request number.

Response

booleanTrue if the pull request has been merged.

merge

Method to merge a pull request.

merge(string $user, string $repo, integer $pullId, string $message = '') : object
since

11.3

Arguments

$user

stringThe name of the owner of the GitHub repository.

$repo

stringThe name of the GitHub repository.

$pullId

integerThe pull request number.

$message

stringThe message that will be used for the merge commit.

Response

object

Properties

options

Options for the GitHub object.

inherited
since

11.3

Type(s)

\JRegistry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

11.3

Type(s)

\JGithubHttp