* @var \app\Session
*/
protected $session;
-
+
function __construct(Web $app, API $github, Session $session) {
$this->app = $app;
$this->github = $github;
return false;
}
+ /**
+ * Check if the pharext webhook is set for the repo and return its id
+ * @param object $repo
+ * @return int hook id
+ */
function checkRepoHook($repo) {
if ($repo->hooks) {
foreach ($repo->hooks as $hook) {
if ($hook->name === "web" && $hook->config->url === $this->github->getConfig()->hook->url) {
- return true;
+ return $hook->id;
}
}
}
- return false;
+ return null;
}
function createLinkGenerator($links) {