class JGithubPackageRepositoriesStatistics extends JGithubPackage

GitHub API class for the Joomla Platform.

The Repository Statistics API allows you to fetch the data that GitHub uses for visualizing different types of repository activity.

Methods

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

Constructor.

__get( string $name)

Magic method to lazily create API objects

object
getListContributors( string $owner, string $repo)

Get contributors list with additions, deletions, and commit counts.

object
getActivityData( string $owner, string $repo)

Get the last year of commit activity data.

object
getCodeFrequency( string $owner, string $repo)

Get the number of additions and deletions per week.

object
getParticipation( string $owner, string $repo)

Get the weekly commit count for the repo owner and everyone else.

object
getPunchCard( string $owner, string $repo)

Get the number of commits per hour in each day.

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 getListContributors( string $owner, string $repo)

Get contributors list with additions, deletions, and commit counts.

Response include: total - The Total number of commits authored by the contributor.

Weekly Hash

w - Start of the week a - Number of additions d - Number of deletions c - Number of commits

Parameters

string $owner The owner of the repository.
string $repo The repository name.

Return Value

object

object getActivityData( string $owner, string $repo)

Get the last year of commit activity data.

Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday.

Parameters

string $owner The owner of the repository.
string $repo The repository name.

Return Value

object

object getCodeFrequency( string $owner, string $repo)

Get the number of additions and deletions per week.

Response returns a weekly aggregate of the number of additions and deletions pushed to a repository.

Parameters

string $owner The owner of the repository.
string $repo The repository name.

Return Value

object

object getParticipation( string $owner, string $repo)

Get the weekly commit count for the repo owner and everyone else.

Returns the total commit counts for the "owner" and total commit counts in "all". "all" is everyone combined, including the owner in the last 52 weeks. If you’d like to get the commit counts for non-owners, you can subtract all from owner.

The array order is oldest week (index 0) to most recent week.

Parameters

string $owner The owner of the repository.
string $repo The repository name.

Return Value

object

object getPunchCard( string $owner, string $repo)

Get the number of commits per hour in each day.

Response Each array contains the day number, hour number, and number of commits:

0-6: Sunday - Saturday 0-23: Hour of day Number of commits

For example, [2, 14, 25] indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.

Parameters

string $owner The owner of the repository.
string $repo The repository name.

Return Value

object