+ /**
+ * Check if the pharext webhook is set for the repo and return it
+ * @param object $repo
+ * @return stdClass hook
+ */
+ function checkRepoHook($repo) {
+ if ($repo->hooks) {
+ foreach ($repo->hooks as $hook) {
+ if ($hook->name === "web" && $hook->config->url === $this->config->hook->url) {
+ return $hook;
+ }
+ }
+ }
+ return null;
+ }
+
+ function listHooks($repo, callable $callback) {
+ $call = new API\Hooks\ListHooks($this, compact("repo"));
+ return $call($callback);
+ }
+
+ function listReleases($repo, $page, callable $callback) {
+ $call = new API\Releases\ListReleases($this, compact("repo", "page"));
+ return $call($callback);
+ }
+
+ function listTags($repo, $page, callable $callback) {
+ $call = new API\Tags\ListTags($this, compact("repo", "page"));
+ return $call($callback);
+ }
+
+ function readContents($repo, $path, callable $callback) {
+ $call = new API\Repos\ReadContents($this, compact("repo", "path"));
+ return $call($callback);
+ }
+
+ function createRepoHook($repo, $conf, callable $callback) {
+ $call = new API\Hooks\CreateHook($this, compact("repo", "conf"));
+ return $call($callback);
+ }
+
+ function updateRepoHook($repo, $id, $conf, callable $callback) {
+ $call = new API\Hooks\UpdateHook($this, compact("repo", "id", "conf"));
+ return $call($callback);
+ }
+
+ function deleteRepoHook($repo, $id, callable $callback) {
+ $call = new API\Hooks\DeleteHook($this, compact("repo", "id"));
+ return $call($callback);
+ }
+
+ function createRelease($repo, $tag, callable $callback) {
+ $call = new API\Releases\CreateRelease($this, compact("repo", "tag"));
+ return $call($callback);