Skip to content

Commit b571ad2

Browse files
committed
Added two new endpoints
1 parent 7089069 commit b571ad2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,36 @@ public function statistics($username, $repository)
8888
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors');
8989
}
9090

91+
/**
92+
* Get a weekly aggregate of the number of additions and deletions pushed to a repository.
93+
*
94+
* @link http://developer.github.com/v3/repos/statistics/#code-frequency
95+
*
96+
* @param string $username the user who owns the repository
97+
* @param string $repository the name of the repository
98+
*
99+
* @return array list of weeks and their commit statistics
100+
*/
101+
public function frequency($username, $repository)
102+
{
103+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/code_frequency');
104+
}
105+
106+
/**
107+
* Get the weekly commit count for the repository owner and everyone else.
108+
*
109+
* @link http://developer.github.com/v3/repos/statistics/#participation
110+
*
111+
* @param string $username the user who owns the repository
112+
* @param string $repository the name of the repository
113+
*
114+
* @return array list of weekly commit count grouped by 'all' and 'owner'
115+
*/
116+
public function participation($username, $repository)
117+
{
118+
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/participation');
119+
}
120+
91121
/**
92122
* List all repositories for an organization.
93123
*

0 commit comments

Comments
 (0)