X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FGithub%2FAPI%2FRepos%2FReposCallback.php;h=34e49aa2da166680ad8c25cbca2a6ce69e517fa3;hb=2198c781a021d85ee845f2f4b2f5c322f73e6bd5;hp=78d68c9d0403bcf75f0b8f1e3e6646516dfeefe1;hpb=c05a8f703d5a097355b5813154c264c87e3f71fe;p=pharext%2Fpharext.org diff --git a/app/Github/API/Repos/ReposCallback.php b/app/Github/API/Repos/ReposCallback.php index 78d68c9..34e49aa 100644 --- a/app/Github/API/Repos/ReposCallback.php +++ b/app/Github/API/Repos/ReposCallback.php @@ -5,11 +5,17 @@ namespace app\Github\API\Repos; use app\Github\API\Callback; use app\Github\API\Hooks\HooksCallback; +use React\Promise; + class ReposCallback extends Callback { - function __invoke($json, $links = null) { + protected function exec($json, $links = null) { + $promises = array([$json, $links]); foreach ($json as $repo) { - $this->api->listHooks($repo->full_name, new HooksCallback($this->api, $repo)); + $promises[] = $this->api + ->listHooks($repo->full_name) + ->then(new HooksCallback($this->api, $repo)); } + return Promise\all($promises); } }