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) {
11 if (!$this->checkToken()) {
16 $this->github
->readRepo("$owner/$name")->then(
17 new RepoCallback($this->github
)
18 )->done(function($result) use($owner, $name) {
19 list($repo) = $result;
20 $hook = $this->github
->checkRepoHook($repo);
22 $this->app
->getView()->addData(compact("owner", "name", "repo", "hook"));
25 $this->github
->drain();
27 if (($modal = $this->app
->getRequest()->getQuery("modal"))) {
28 $action = $this->app
->getRequest()->getQuery($modal);
29 $this->app
->getView()->addData(compact("modal", "action"));
32 $this->app
->display("github/repo");