class JGithubPackagePulls extends JGithubPackage

GitHub API Pull Requests class for the Joomla Platform.

Methods

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

__get( string $name)

Magic method to lazily create API objects

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

Method to create a pull request.

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

Method to create a pull request from an existing issue.

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

Method to update a pull request.

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

Method to get a single pull request.

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

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

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

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

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

Method to list pull requests.

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

Method to check if a pull request has been merged.

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

Method to merge a pull request.

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

Method to create a comment on a pull request.

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

Method to create a comment in reply to another comment.

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

Method to delete a comment on a pull request.

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

Method to update a comment on a pull request.

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

Method to get a specific comment on a pull request.

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

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

Details

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

Parameters

Registry $options GitHub options object.
JGithubHttp $client The HTTP client object.

JGithubPackage __get( string $name)

Magic method to lazily create API objects

Parameters

string $name Name of property to retrieve

Return Value

JGithubPackage GitHub API package object.

Exceptions

RuntimeException

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

Method to create a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $title The title of the new pull request.
string $base The 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.
string $head The branch (or git ref) where your changes are implemented.
string $body The body text for the new pull request.

Return Value

object

Exceptions

DomainException

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

Method to create a pull request from an existing issue.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $issueId The issue number for which to attach the new pull request.
string $base The 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.
string $head The branch (or git ref) where your changes are implemented.

Return Value

object

Exceptions

DomainException

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

Method to update a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
string $title The optional new title for the pull request.
string $body The optional new body text for the pull request.
string $state The optional new state for the pull request. [open, closed]

Return Value

object

Exceptions

DomainException

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

Method to get a single pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.

Return Value

object

Exceptions

DomainException

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

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

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

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

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

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

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

Method to list pull requests.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $state The optional state to filter requests by. [open, closed]
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array

Exceptions

DomainException

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

Method to check if a pull request has been merged.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number. The pull request number.

Return Value

boolean True if the pull request has been merged.

Exceptions

DomainException

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

Method to merge a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
string $message The message that will be used for the merge commit.

Return Value

object

Exceptions

DomainException

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

Method to create a comment on a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
string $body The comment body text.
string $commitId The SHA1 hash of the commit to comment on.
string $filePath The Relative path of the file to comment on.
string $position The line index in the diff to comment on.

Return Value

object

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

Method to create a comment in reply to another comment.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
string $body The comment body text.
integer $inReplyTo The id of the comment to reply to.

Return Value

object

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

Method to delete a comment on a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $commentId The id of the comment to delete.

Return Value

void

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

Method to update a comment on a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $commentId The id of the comment to update.
string $body The new body text for the comment.

Return Value

object

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

Method to get a specific comment on a pull request.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $commentId The comment id to get.

Return Value

object

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

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

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $pullId The pull request number.
integer $page The page number from which to get items.
integer $limit The number of items on a page.

Return Value

array