forked from KnpLabs/php-github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommits.php
More file actions
38 lines (31 loc) · 1.2 KB
/
Copy pathCommits.php
File metadata and controls
38 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Github\Api\Repository;
use Github\Api\AbstractApi;
/**
* @link http://developer.github.com/v3/repos/commits/
*
* @author Joseph Bielawski <stloyd@gmail.com>
*/
class Commits extends AbstractApi
{
public function all($username, $repository, array $params)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params);
}
public function compare($username, $repository, $base, $head, $mediaType = null, array $params = [])
{
$headers = [];
if (null !== $mediaType) {
$headers['Accept'] = $mediaType;
}
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), $params, $headers);
}
public function show($username, $repository, $sha)
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha));
}
public function pulls($username, $repository, $sha, array $params = [])
{
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/pulls', $params);
}
}