Skip to content

Commit 72c60bc

Browse files
committed
Merge pull request #109 from yesdevnull/patch-1
Added contributor commit statistics for repository
2 parents 13cac64 + 2aafb2c commit 72c60bc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ public function find($keyword, array $params)
3737
{
3838
return $this->get('legacy/repos/search/'.rawurlencode($keyword), array_merge(array('start_page' => 1), $params));
3939
}
40+
41+
/**
42+
* Get contributor commit statistics for a repository
43+
* @link http://developer.github.com/v3/repos/statistics/#contributors
44+
*
45+
* @param string $username the user who owns the repository
46+
* @param string $repository the name of the repository
47+
*
48+
* @return array list of contributors and their commit statistics
49+
*/
50+
public function statistics($username, $repository)
51+
{
52+
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors');
53+
}
4054

4155
/**
4256
* List all repositories for an organization

0 commit comments

Comments
 (0)