f55eb0c2e4cdece8ebbc739199bd5f83705a2937
3 namespace app\Controller\Github
;
5 use app\Controller\Github
;
9 class Index
extends Github
11 function __invoke(array $args = null) {
12 if ($this->checkToken()) {
14 $this->github
->fetchRepos(
15 $this->app
->getRequest()->getQuery("page"),
16 [$this, "reposCallback"]
18 } catch (\app\Github\Exception
$exception) {
19 $this->view
->addData(compact("exception"));
21 $this->app
->display("github/index");
25 function reposCallback($repos, $links) {
26 $this->app
->getView()->addData(compact("repos"));
27 $this->app
->getView()->registerFunction("link", $this->createLinkGenerator($links));
29 foreach ($repos as $repo) {
30 $this->github
->fetchHooks($repo->full_name
, function($hooks) use($repo) {
31 $repo->hooks
= $hooks;