X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FController%2FGithub%2FIndex.php;h=2b16c7bfe84994bcd67dce0e273e589b7cd0e8a1;hb=2f593903bb0b095e3ecaece6c8e73ab3410af64f;hp=935f249e3fa6e0238f8881c2d31d2bae694622be;hpb=07b87ac26f62bc3c069bb16983fe7500272e19b4;p=pharext%2Fpharext.org diff --git a/app/Controller/Github/Index.php b/app/Controller/Github/Index.php index 935f249..2b16c7b 100644 --- a/app/Controller/Github/Index.php +++ b/app/Controller/Github/Index.php @@ -8,21 +8,11 @@ class Index extends Github { function __invoke(array $args = null) { if ($this->checkToken()) { - $this->github->fetchRepos( + list($repos, $links) = $this->github->listRepos( $this->app->getRequest()->getQuery("page"), - [$this, "reposCallback"] + new \app\Github\API\Repos\ReposCallback($this->github) )->send(); - $this->app->display("github/index"); - } - } - - function reposCallback($repos, $links) { - $this->app->getView()->addData(compact("repos", "links")); - - foreach ($repos as $repo) { - $this->github->fetchHooks($repo->full_name, function($hooks) use($repo) { - $repo->hooks = $hooks; - }); + $this->app->display("github/index", compact("repos", "links")); } } }