Statistics
Extends AbstractPackageGitHub API class for the Joomla Framework.
The Repository Statistics API allows you to fetch the data that GitHub uses for visualizing different types of repository activity.
| link | |
|---|---|
| since |
1.0 |
| package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(\Joomla\Registry\Registry options = null, \Joomla\Http\Http client = null) :
__get
Magic method to lazily create API objects
__get( name) : \Joomla\Github\AbstractPackage
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- name
stringName of property to retrieve
Response
AbstractPackageGitHub API package 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( path, page, limit) : \Joomla\Uri\Uri
| since |
1.0 |
|---|
Arguments
- path
stringURL to inflect- page
intPage to request- limit
intNumber of results to return per page
Response
getActivityData
Get the last year of commit activity data.
getActivityData( owner, repo) :
Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday.
| since |
1.0 |
|---|
Arguments
- owner
stringThe owner of the repository.- repo
stringThe repository name.
Response
object
getCodeFrequency
Get the number of additions and deletions per week.
getCodeFrequency( owner, repo) :
Response returns a weekly aggregate of the number of additions and deletions pushed to a repository.
| since |
1.0 |
|---|
Arguments
- owner
stringThe owner of the repository.- repo
stringThe repository name.
Response
object
getListContributors
Get contributors list with additions, deletions, and commit counts.
getListContributors( owner, repo) :
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
| since |
1.0 |
|---|
Arguments
- owner
stringThe owner of the repository.- repo
stringThe repository name.
Response
object
getParticipation
Get the weekly commit count for the repository owner and everyone else.
getParticipation( owner, repo) :
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.
| since |
1.0 |
|---|
Arguments
- owner
stringThe owner of the repository.- repo
stringThe repository name.
Response
object
getPunchCard
Get the number of commits per hour in each day.
getPunchCard( owner, repo) :
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.
| since |
1.0 |
|---|
Arguments
- owner
stringThe owner of the repository.- repo
stringThe repository name.
Response
object
processResponse
Process the response and decode it.
processResponse(\Joomla\Http\Response response, expectedCode = 200) :
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- response
ResponseThe response.- expectedCode
intThe expected "good" code.
Response
mixed
Properties
package
The package the object resides in
| since |
1.0 |
|---|
Type(s)
string
hookEvents
Array containing the allowed hook events
| since |
1.5.2 |
|---|---|
| link | |
| note |
From 1.4.0 to 1.5.1 this was named $events, it was renamed due to naming conflicts with package subclasses |
Type(s)
array<string|int, mixed>