3 namespace app\Controller\Github
;
5 use app\Controller\Github
;
7 class Index
extends Github
9 function __invoke(array $args = null) {
10 if ($this->checkToken()) {
11 $this->github
->fetchRepos(
12 $this->app
->getRequest()->getQuery("page"),
13 [$this, "reposCallback"]
15 $this->app
->display("github/index");
19 function reposCallback($repos, $links) {
20 $this->app
->getView()->addData(compact("repos", "links"));
22 foreach ($repos as $repo) {
23 $this->github
->fetchHooks($repo->full_name
, function($hooks) use($repo) {
24 $repo->hooks
= $hooks;