Skip to content

Commit db1995b

Browse files
Add the activity() method to return a year's worth of commit activity, grouped by week.
1 parent dfc9ea0 commit db1995b

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

lib/Github/Api/Repo.php

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,33 @@ public function find($keyword, array $params = array())
3939
}
4040

4141
/**
42-
* Get contributor commit statistics for a repository
43-
* @link http://developer.github.com/v3/repos/statistics/#contributors
42+
* Get the last year of commit activity for a repository grouped by week
43+
* @link http://developer.github.com/v3/repos/statistics/#commit-activity
4444
*
4545
* @param string $username the user who owns the repository
4646
* @param string $repository the name of the repository
4747
*
48-
* @return array list of contributors and their commit statistics
48+
* @return array commit activity grouped by week
4949
*/
50-
public function statistics($username, $repository)
50+
public function activity($username, $repository)
5151
{
52-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors');
52+
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/commit_activity');
5353
}
5454

55+
/**
56+
* Get contributor commit statistics for a repository
57+
* @link http://developer.github.com/v3/repos/statistics/#contributors
58+
*
59+
* @param string $username the user who owns the repository
60+
* @param string $repository the name of the repository
61+
*
62+
* @return array list of contributors and their commit statistics
63+
*/
64+
public function statistics($username, $repository)
65+
{
66+
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors');
67+
}
68+
5569
/**
5670
* List all repositories for an organization
5771
* @link http://developer.github.com/v3/repos/#list-organization-repositories

0 commit comments

Comments
 (0)