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) : mixed
since |
1.0 |
---|
Arguments
- options
\Joomla\Registry\Registry
GitHub options object.- client
\Joomla\Http\Http
The HTTP client object.
Response
mixed
__get
Magic method to lazily create API objects
__get(string name) : \Joomla\Github\AbstractPackage
since |
1.0 |
---|---|
throws |
|
Arguments
- name
string
Name of property to retrieve
Response
\Joomla\Github\AbstractPackage
GitHub 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(string path, int page, int limit) : \Joomla\Uri\Uri
since |
1.0 |
---|
Arguments
- path
string
URL to inflect- page
int
Page to request- limit
int
Number of results to return per page
Response
\Joomla\Uri\Uri
getActivityData
Get the last year of commit activity data.
getActivityData(string owner, string repo) : object
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
string
The owner of the repository.- repo
string
The repository name.
Response
object
getCodeFrequency
Get the number of additions and deletions per week.
getCodeFrequency(string owner, string repo) : object
Response returns a weekly aggregate of the number of additions and deletions pushed to a repository.
since |
1.0 |
---|
Arguments
- owner
string
The owner of the repository.- repo
string
The repository name.
Response
object
getListContributors
Get contributors list with additions, deletions, and commit counts.
getListContributors(string owner, string repo) : object
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
string
The owner of the repository.- repo
string
The repository name.
Response
object
getParticipation
Get the weekly commit count for the repository owner and everyone else.
getParticipation(string owner, string repo) : object
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
string
The owner of the repository.- repo
string
The repository name.
Response
object
getPunchCard
Get the number of commits per hour in each day.
getPunchCard(string owner, string repo) : object
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
string
The owner of the repository.- repo
string
The repository name.
Response
object
processResponse
Process the response and decode it.
processResponse(\Joomla\Http\Response response, int expectedCode = 200) : mixed
since |
1.0 |
---|---|
throws |
|
Arguments
- response
\Joomla\Http\Response
The response.- expectedCode
int
The expected "good" code.
Response
mixed
Properties
options
Options for the GitHub object.
since |
1.0 |
---|
Type(s)
\Joomla\Registry\Registry
client
The HTTP client object to use in sending HTTP requests.
since |
1.0 |
---|
Type(s)
\Joomla\Http\Http
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