1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the bitbucket-api package. |
5
|
|
|
* |
6
|
|
|
* (c) Alexandru G. <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Bitbucket\API\Repositories\Commits; |
13
|
|
|
|
14
|
|
|
use Bitbucket\API\Api; |
15
|
|
|
use Psr\Http\Message\ResponseInterface; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @author Alexandru G. <[email protected]> |
19
|
|
|
*/ |
20
|
|
|
class Comments extends Api |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Get a list of a commit comments |
24
|
|
|
* |
25
|
|
|
* @access public |
26
|
|
|
* @param string $account The team or individual account owning the repository. |
27
|
|
|
* @param string $repo The repository identifier. |
28
|
|
|
* @param string $revision A SHA1 value for the commit. |
29
|
|
|
* @return ResponseInterface |
30
|
|
|
*/ |
31
|
1 |
|
public function all($account, $repo, $revision) |
32
|
|
|
{ |
33
|
1 |
|
return $this->getClient()->setApiVersion('2.0')->get( |
34
|
1 |
|
sprintf('/repositories/%s/%s/commit/%s/comments', $account, $repo, $revision) |
35
|
|
|
); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Get an individual commit comment |
40
|
|
|
* |
41
|
|
|
* @access public |
42
|
|
|
* @param string $account The team or individual account owning the repository. |
43
|
|
|
* @param string $repo The repository identifier. |
44
|
|
|
* @param string $revision A SHA1 value for the commit. |
45
|
|
|
* @param int $commentID The comment identifier. |
46
|
|
|
* @return ResponseInterface |
47
|
|
|
*/ |
48
|
1 |
|
public function get($account, $repo, $revision, $commentID) |
49
|
|
|
{ |
50
|
1 |
|
return $this->getClient()->setApiVersion('2.0')->get( |
51
|
1 |
|
sprintf('/repositories/%s/%s/commit/%s/comments/%d', $account, $repo, $revision, $commentID) |
52
|
|
|
); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|