X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FGithub%2FAPI%2FRepos%2FRepoCallback.php;h=362d8921611f995bf5d4d6b7225e3fa3195a43fb;hb=2198c781a021d85ee845f2f4b2f5c322f73e6bd5;hp=a3621a5f28d82b9a3abb1bf7289b54aa5f28ab1c;hpb=c05a8f703d5a097355b5813154c264c87e3f71fe;p=pharext%2Fpharext.org diff --git a/app/Github/API/Repos/RepoCallback.php b/app/Github/API/Repos/RepoCallback.php index a3621a5..362d892 100644 --- a/app/Github/API/Repos/RepoCallback.php +++ b/app/Github/API/Repos/RepoCallback.php @@ -6,12 +6,17 @@ use app\Github\API\Callback; use app\Github\API\Hooks\HooksCallback; use app\Github\API\Tags\TagsCallback; +use React\Promise; + class RepoCallback extends Callback { - function __invoke($repo, $links = null) { - $this->api->listHooks($repo->full_name, new HooksCallback($this->api, $repo)); - $this->api->listTags($repo->full_name, 1, new TagsCallback($this->api, $repo)); - $this->api->listReleases($repo->full_name, 1, new ReleasesCallback($this->api, $repo)); - $this->api->readContents($repo->full_name, null, new ContentsCallback($this->api, $repo));; + protected function exec($repo, $links = null) { + return Promise\all([ + $repo, + $this->api->listHooks($repo->full_name)->then(new HooksCallback($this->api, $repo)), + $this->api->listTags($repo->full_name, 1)->then(new TagsCallback($this->api, $repo)), + $this->api->listReleases($repo->full_name, 1)->then(new ReleasesCallback($this->api, $repo)), + $this->api->readContents($repo->full_name)->then(new ContentsCallback($this->api, $repo)), + ]); } }