JGithubPulls
Extends \JGithubObjectGitHub 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)
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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $title
string
The title of the new pull request.- $base
string
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.- $head
string
The branch (or git ref) where your changes are implemented.- $body
string
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $body
string
The comment body text.- $commitId
string
The SHA1 hash of the commit to comment on.- $filePath
string
The Relative path of the file to comment on.- $position
string
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $body
string
The comment body text.- $inReplyTo
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $issueId
integer
The issue number for which to attach the new pull request.- $base
string
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.- $head
string
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $commentId
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $title
string
The optional new title for the pull request.- $body
string
The optional new body text for the pull request.- $state
string
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $commentId
integer
The id of the comment to update.- $body
string
The 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
since |
11.3 |
---|
Arguments
- $path
string
URL to inflect- $page
integer
Page to request- $limit
integer
Number of results to return per page
Response
string
The request URL.
get
Method to get a single pull request.
get(string $user, string $repo, integer $pullId) : object
since |
11.3 |
---|
Arguments
- $user
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $commentId
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $page
integer
The page number from which to get items.- $limit
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $page
integer
The page number from which to get items.- $limit
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $page
integer
The page number from which to get items.- $limit
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $state
string
The optional state to filter requests by. [open, closed]- $page
integer
The page number from which to get items.- $limit
integer
The 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number. The pull request number.
Response
boolean
True 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
string
The name of the owner of the GitHub repository.- $repo
string
The name of the GitHub repository.- $pullId
integer
The pull request number.- $message
string
The message that will be used for the merge commit.
Response
object
Properties
client
The HTTP client object to use in sending HTTP requests.