class JGithubCommits extends JGithubObject

GitHub API Commits class for the Joomla Platform.

Methods

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

Constructor.

object
create( string $user, string $repo, string $message, string $tree, array $parents = array())

Method to create a commit.

object
createCommitComment( string $user, string $repo, string $sha, string $comment, integer $line, string $filepath, integer $position)

Method to create a comment on a commit.

object
deleteCommitComment( string $user, string $repo, string $id)

Method to delete a comment on a commit.

object
editCommitComment( string $user, string $repo, string $id, string $comment)

Method to edit a comment on a commit.

array
getCommit( string $user, string $repo, string $sha, integer $page, integer $limit)

Method to get a single commit for a repository.

array
getCommitComment( string $user, string $repo, integer $id)

Method to get a single comment on a commit.

array
getCommitComments( string $user, string $repo, string $sha, integer $page, integer $limit)

Method to get a list of comments for a single commit for a repository.

array
getDiff( string $user, string $repo, string $base, string $head)

Method to get a diff for two commits.

array
getList( string $user, string $repo, integer $page, integer $limit)

Method to list commits for a repository.

array
getListComments( string $user, string $repo, integer $page, integer $limit)

Method to get a list of commit comments for a repository.

Details

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

Constructor.

Parameters

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

object create( string $user, string $repo, string $message, string $tree, array $parents = array())

Method to create a commit.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $message The commit message.
string $tree SHA of the tree object this commit points to.
array $parents Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided. For a merge commit, an array of more than one should be provided.

Return Value

object

object createCommitComment( string $user, string $repo, string $sha, string $comment, integer $line, string $filepath, integer $position)

Method to create a comment on a commit.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $sha The SHA of the commit to comment on.
string $comment The text of the comment.
integer $line The line number of the commit to comment on.
string $filepath A relative path to the file to comment on within the commit.
integer $position Line index in the diff to comment on.

Return Value

object

object deleteCommitComment( string $user, string $repo, string $id)

Method to delete a comment on a commit.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $id The ID of the comment to edit.

Return Value

object

object editCommitComment( string $user, string $repo, string $id, string $comment)

Method to edit a comment on a commit.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $id The ID of the comment to edit.
string $comment The text of the comment.

Return Value

object

array getCommit( string $user, string $repo, string $sha, integer $page, integer $limit)

Method to get a single commit for a repository.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $sha The SHA of the commit to retrieve.
integer $page Page to request
integer $limit Number of results to return per page

Return Value

array

array getCommitComment( string $user, string $repo, integer $id)

Method to get a single comment on a commit.

Parameters

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

Return Value

array

array getCommitComments( string $user, string $repo, string $sha, integer $page, integer $limit)

Method to get a list of comments for a single commit for a repository.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $sha The SHA of the commit to retrieve.
integer $page Page to request
integer $limit Number of results to return per page

Return Value

array

array getDiff( string $user, string $repo, string $base, string $head)

Method to get a diff for two commits.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $base The base of the diff, either a commit SHA or branch.
string $head The head of the diff, either a commit SHA or branch.

Return Value

array

array getList( string $user, string $repo, integer $page, integer $limit)

Method to list commits for a repository.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $page Page to request
integer $limit Number of results to return per page

Return Value

array

array getListComments( string $user, string $repo, integer $page, integer $limit)

Method to get a list of commit comments for a repository.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
integer $page Page to request
integer $limit Number of results to return per page

Return Value

array