github: fix notices
[pharext/pharext.org] / app / Controller / Github / Repo.php
index bf61387330b295114da2172c854dd1359c9c6fe9..3c166ad51c5c8812fbf90e87a6fccd7820707868 100644 (file)
@@ -8,20 +8,22 @@ use app\Github\API\Repos\RepoCallback;
 class Repo extends Github
 {
        function __invoke(array $args = null) {
-               extract($args);
-               if ($this->checkToken()) {
-                       $this->github->readRepo("$owner/$name")->then(
-                               new RepoCallback($this->github)
-                       )->done(function($result) use($owner, $name) {
-                               list($repo) = $result;
-                               $hook = $this->github->checkRepoHook($repo);
-
-                               $this->app->getView()->addData(compact("owner", "name", "repo", "hook"));
-                       });
-                       
-                       $this->github->drain();
+               if (!$this->checkToken()) {
+                       return;
                }
 
+               extract($args);
+               $this->github->readRepo("$owner/$name")->then(
+                       new RepoCallback($this->github)
+               )->done(function($result) use($owner, $name) {
+                       list($repo) = $result;
+                       $hook = $this->github->checkRepoHook($repo);
+
+                       $this->app->getView()->addData(compact("owner", "name", "repo", "hook"));
+               });
+
+               $this->github->drain();
+
                if (($modal = $this->app->getRequest()->getQuery("modal"))) {
                        $action = $this->app->getRequest()->getQuery($modal);
                        $this->app->getView()->addData(compact("modal", "action"));