@@ 10-54 (lines=45) @@ | ||
7 | * @link https://developer.github.com/v3/issues/events/ |
|
8 | * @package FlexyProject\GitHub\Receiver\Issues |
|
9 | */ |
|
10 | class Events extends AbstractIssues |
|
11 | { |
|
12 | ||
13 | /** |
|
14 | * List events for an issue |
|
15 | * |
|
16 | * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue |
|
17 | * |
|
18 | * @param int $issueNumber |
|
19 | * |
|
20 | * @return array |
|
21 | */ |
|
22 | public function listIssueEvents(int $issueNumber): array |
|
23 | { |
|
24 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:issue_number/events', |
|
25 | $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $issueNumber)); |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * List events for a repository |
|
30 | * |
|
31 | * @link https://developer.github.com/v3/issues/events/#list-events-for-a-repository |
|
32 | * @return array |
|
33 | */ |
|
34 | public function listRepositoryEvents(): array |
|
35 | { |
|
36 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events', |
|
37 | $this->getIssues()->getOwner(), $this->getIssues()->getRepo())); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * Get a single event |
|
42 | * |
|
43 | * @link https://developer.github.com/v3/issues/events/#get-a-single-event |
|
44 | * |
|
45 | * @param int $id |
|
46 | * |
|
47 | * @return array |
|
48 | */ |
|
49 | public function getEvent(int $id): array |
|
50 | { |
|
51 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events/:id', |
|
52 | $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id)); |
|
53 | } |
|
54 | } |
@@ 10-48 (lines=39) @@ | ||
7 | * @link https://developer.github.com/v3/repos/pages/ |
|
8 | * @package FlexyProject\GitHub\Receiver\Repositories |
|
9 | */ |
|
10 | class Pages extends AbstractRepositories |
|
11 | { |
|
12 | ||
13 | /** |
|
14 | * Get information about a Pages site |
|
15 | * |
|
16 | * @link https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site |
|
17 | * @return array |
|
18 | */ |
|
19 | public function getInformation(): array |
|
20 | { |
|
21 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages', |
|
22 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo())); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * List Pages builds |
|
27 | * |
|
28 | * @link https://developer.github.com/v3/repos/pages/#list-pages-builds |
|
29 | * @return array |
|
30 | */ |
|
31 | public function listPagesBuilds(): array |
|
32 | { |
|
33 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds', |
|
34 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo())); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * List latest Pages build |
|
39 | * |
|
40 | * @link https://developer.github.com/v3/repos/pages/#list-latest-pages-build |
|
41 | * @return array |
|
42 | */ |
|
43 | public function listLatestPagesBuilds(): array |
|
44 | { |
|
45 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds/latest', |
|
46 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo())); |
|
47 | } |
|
48 | } |