@@ -12,62 +12,62 @@ |
||
| 12 | 12 | class Commits extends AbstractRepositories |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * List commits on a repository |
|
| 17 | - * |
|
| 18 | - * @link https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository |
|
| 19 | - * |
|
| 20 | - * @param string $sha |
|
| 21 | - * @param string|null $path |
|
| 22 | - * @param string|null $author |
|
| 23 | - * @param string|null $since |
|
| 24 | - * @param string|null $until |
|
| 25 | - * |
|
| 26 | - * @return array |
|
| 27 | - */ |
|
| 28 | - public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null, |
|
| 29 | - string $since = null, string $until = null, $page = null, $per_page = null): array |
|
| 30 | - { |
|
| 31 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args', |
|
| 32 | - $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([ |
|
| 33 | - "sha" => $sha, |
|
| 34 | - "path" => $path, |
|
| 35 | - "author" => $author, |
|
| 36 | - "since" => $since, |
|
| 37 | - "until" => $until, |
|
| 15 | + /** |
|
| 16 | + * List commits on a repository |
|
| 17 | + * |
|
| 18 | + * @link https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository |
|
| 19 | + * |
|
| 20 | + * @param string $sha |
|
| 21 | + * @param string|null $path |
|
| 22 | + * @param string|null $author |
|
| 23 | + * @param string|null $since |
|
| 24 | + * @param string|null $until |
|
| 25 | + * |
|
| 26 | + * @return array |
|
| 27 | + */ |
|
| 28 | + public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null, |
|
| 29 | + string $since = null, string $until = null, $page = null, $per_page = null): array |
|
| 30 | + { |
|
| 31 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args', |
|
| 32 | + $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([ |
|
| 33 | + "sha" => $sha, |
|
| 34 | + "path" => $path, |
|
| 35 | + "author" => $author, |
|
| 36 | + "since" => $since, |
|
| 37 | + "until" => $until, |
|
| 38 | 38 | "page" => $page, |
| 39 | 39 | "per_page" => $per_page |
| 40 | - ]))); |
|
| 41 | - } |
|
| 40 | + ]))); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Get a single commit |
|
| 45 | - * |
|
| 46 | - * @link https://developer.github.com/v3/repos/commits/#get-a-single-commit |
|
| 47 | - * |
|
| 48 | - * @param string $sha |
|
| 49 | - * |
|
| 50 | - * @return array |
|
| 51 | - */ |
|
| 52 | - public function getSingleCommit(string $sha): array |
|
| 53 | - { |
|
| 54 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha', |
|
| 55 | - $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha)); |
|
| 56 | - } |
|
| 43 | + /** |
|
| 44 | + * Get a single commit |
|
| 45 | + * |
|
| 46 | + * @link https://developer.github.com/v3/repos/commits/#get-a-single-commit |
|
| 47 | + * |
|
| 48 | + * @param string $sha |
|
| 49 | + * |
|
| 50 | + * @return array |
|
| 51 | + */ |
|
| 52 | + public function getSingleCommit(string $sha): array |
|
| 53 | + { |
|
| 54 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha', |
|
| 55 | + $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha)); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Compare two commits |
|
| 60 | - * |
|
| 61 | - * @link https://developer.github.com/v3/repos/commits/#compare-two-commits |
|
| 62 | - * |
|
| 63 | - * @param string $base |
|
| 64 | - * @param string $head |
|
| 65 | - * |
|
| 66 | - * @return array |
|
| 67 | - */ |
|
| 68 | - public function compareTwoCommits(string $base, string $head): array |
|
| 69 | - { |
|
| 70 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/compare/:base...:head', |
|
| 71 | - $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $base, $head)); |
|
| 72 | - } |
|
| 58 | + /** |
|
| 59 | + * Compare two commits |
|
| 60 | + * |
|
| 61 | + * @link https://developer.github.com/v3/repos/commits/#compare-two-commits |
|
| 62 | + * |
|
| 63 | + * @param string $base |
|
| 64 | + * @param string $head |
|
| 65 | + * |
|
| 66 | + * @return array |
|
| 67 | + */ |
|
| 68 | + public function compareTwoCommits(string $base, string $head): array |
|
| 69 | + { |
|
| 70 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/compare/:base...:head', |
|
| 71 | + $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $base, $head)); |
|
| 72 | + } |
|
| 73 | 73 | } |