JGithubPackageRepositoriesStatistics

Extends \JGithubPackage

GitHub API class for the Joomla Platform.

deprecated

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

documentation

https://developer.github.com/v3/repos/statistics

since

3.3

deprecated

4.0 Use the joomla/github package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JGithubHttp $client = null) 
inherited
since

1.7.3

Arguments

$options

\Joomla\Registry\RegistryGitHub options object.

$client

\JGithubHttpThe HTTP client object.

__get

Magic method to lazily create API objects

__get(string $name) : \JGithubPackage
inherited
since

3.3

throws

\RuntimeException

Arguments

$name

stringName of property to retrieve

Response

\JGithubPackageGitHub 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
inherited
since

1.7.3

Arguments

$path

stringURL to inflect

$page

integerPage to request

$limit

integerNumber of results to return per page

Response

stringThe 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

stringThe owner of the repository.

$repo

stringThe 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

stringThe owner of the repository.

$repo

stringThe 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

stringThe owner of the repository.

$repo

stringThe 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

stringThe owner of the repository.

$repo

stringThe 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

stringThe owner of the repository.

$repo

stringThe repository name.

Response

object

processResponse

Process the response and decode it.

processResponse(\JHttpResponse $response, integer $expectedCode = 200, boolean $decode = true) : mixed
inherited
throws

\DomainException

since

3.3.0

Arguments

$response

\JHttpResponseThe response.

$expectedCode

integerThe expected "good" code.

$decode

booleanIf the should be response be JSON decoded.

Response

mixed

Properties

name

inherited
since

3.3

Type(s)

string

packages

inherited
since

3.3

Type(s)

array

options

Options for the GitHub object.

inherited
since

1.7.3

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.7.3

Type(s)

\JGithubHttp