refactored 80%
[pharext/pharext.org] / app / Github / API / Repos / RepoCallback.php
1 <?php
2
3 namespace app\Github\API\Repos;
4
5 use app\Github\API\Callback;
6 use app\Github\API\Hooks\HooksCallback;
7 use app\Github\API\Tags\TagsCallback;
8
9 use React\Promise;
10
11 class RepoCallback extends Callback
12 {
13 protected function exec($repo, $links = null) {
14 return Promise\all([
15 $repo,
16 $this->api->listHooks($repo->full_name)->then(new HooksCallback($this->api, $repo)),
17 $this->api->listTags($repo->full_name, 1)->then(new TagsCallback($this->api, $repo)),
18 $this->api->listReleases($repo->full_name, 1)->then(new ReleasesCallback($this->api, $repo)),
19 $this->api->readContents($repo->full_name)->then(new ContentsCallback($this->api, $repo)),
20 ]);
21 }
22 }