X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FController%2FGithub%2FIndex.php;h=7918e2df620a4152555ea9b0bd00bac740e775c0;hb=2198c781a021d85ee845f2f4b2f5c322f73e6bd5;hp=2b16c7bfe84994bcd67dce0e273e589b7cd0e8a1;hpb=c05a8f703d5a097355b5813154c264c87e3f71fe;p=pharext%2Fpharext.org diff --git a/app/Controller/Github/Index.php b/app/Controller/Github/Index.php index 2b16c7b..7918e2d 100644 --- a/app/Controller/Github/Index.php +++ b/app/Controller/Github/Index.php @@ -3,16 +3,21 @@ namespace app\Controller\Github; use app\Controller\Github; +use app\Github\API\Repos\ReposCallback; class Index extends Github { function __invoke(array $args = null) { if ($this->checkToken()) { - list($repos, $links) = $this->github->listRepos( - $this->app->getRequest()->getQuery("page"), - new \app\Github\API\Repos\ReposCallback($this->github) - )->send(); - $this->app->display("github/index", compact("repos", "links")); + $this->github->listRepos( + $this->app->getRequest()->getQuery("page") + )->then( + new ReposCallback($this->github) + )->done(function($results) { + list(list($repos, $links)) = $results; + $this->app->display("github/index", compact("repos", "links")); + }); + $this->github->drain(); } } }