2nd round
[pharext/pharext.org] / app / Controller / Github / Index.php
1 <?php
2
3 namespace app\Controller\Github;
4
5 use app\Controller\Github;
6 use app\Github\API\Repos\ReposCallback;
7
8 class Index extends Github
9 {
10 function __invoke(array $args = null) {
11 if ($this->checkToken()) {
12 $this->github->listRepos(
13 $this->app->getRequest()->getQuery("page")
14 )->then(
15 new ReposCallback($this->github)
16 )->done(function($results) {
17 list(list($repos, $links)) = $results;
18 $this->app->display("github/index", compact("repos", "links"));
19 });
20
21 $this->github->drain();
22 }
23 }
24 }