JGithubPackageRepositoriesStatistics
Extends \JGithubPackageGitHub 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.
documentation | |
---|---|
since |
3.3 |
deprecated |
4.0 Use the |
package |
Joomla.Platform |
Methods
__construct
Constructor.
__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null)
since |
1.7.3 |
---|
Arguments
- $options
\Joomla\Registry\Registry
GitHub options object.- $client
\JGithubHttp
The HTTP client object.
__get
Magic method to lazily create API objects
__get(string $name) : \JGithubPackage
since |
3.3 |
---|---|
throws |
|
Arguments
- $name
string
Name of property to retrieve
Response
\JGithubPackage
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, integer $page, integer $limit) : string
since |
1.7.3 |
---|
Arguments
- $path
string
URL to inflect- $page
integer
Page to request- $limit
integer
Number of results to return per page
Response
string
The request URL.
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 repo 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(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
throws |
|
---|---|
since |
3.3.0 |
Arguments
- $response
\JHttpResponse
The response.- $expectedCode
integer
The expected "good" code.- $decode
boolean
If the should be response be JSON decoded.
Response
mixed
Properties
name
since |
3.3 |
---|
Type(s)
string
packages
since |
3.3 |
---|
Type(s)
array
client
The HTTP client object to use in sending HTTP requests.