class JGithubPackageRepositoriesCommits extends JGithubPackage

GitHub API Repositories Commits class for the Joomla Platform.

Methods

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

Constructor.

__get( string $name)

Magic method to lazily create API objects

array
getList( string $user, string $repo, string $sha = '', string $path = '', string $author = '', JDate $since = null, JDate $until = null)

Method to list commits for a repository.

array
get( string $user, string $repo, string $sha)

Method to get a single commit for a repository.

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

Method to get a diff for two commits.

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

array getList( string $user, string $repo, string $sha = '', string $path = '', string $author = '', JDate $since = null, JDate $until = null)

Method to list commits for a repository.

A special note on pagination: Due to the way Git works, commits are paginated based on SHA instead of page number. Please follow the link headers as outlined in the pagination overview instead of constructing page links yourself.

Parameters

string $user The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.
string $sha Sha or branch to start listing commits from.
string $path Only commits containing this file path will be returned.
string $author GitHub login, name, or email by which to filter by commit author.
JDate $since ISO 8601 Date - Only commits after this date will be returned.
JDate $until ISO 8601 Date - Only commits before this date will be returned.

Return Value

array

Exceptions

DomainException

array get( string $user, string $repo, string $sha)

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.

Return Value

array

Exceptions

DomainException

array compare( 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