3 namespace app\Controller\Github
;
5 use app\Controller\Github
;
6 use app\Github\API\Repos\RepoCallback
;
8 class Repo
extends Github
10 function __invoke(array $args = null) {
12 if ($this->checkToken()) {
13 $this->github
->readRepo("$owner/$name")->then(
14 new RepoCallback($this->github
)
15 )->done(function($result) use($owner, $name) {
16 list($repo) = $result;
17 $hook = $this->github
->checkRepoHook($repo);
19 $this->app
->getView()->addData(compact("owner", "name", "repo", "hook"));
21 $this->github
->drain();
24 if (($modal = $this->app
->getRequest()->getQuery("modal"))) {
25 $action = $this->app
->getRequest()->getQuery($modal);
26 $this->app
->getView()->addData(compact("modal", "action"));
29 $this->app
->display("github/repo");