-
- function setSession(Session $session) {
- $this->session = $session;
- }
-
- 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 false;
- }
-
- function createLinkGenerator($links) {
- return function($which) use($links) {
- if (!isset($links[$which])) {
- if ($which !== "next" || !isset($links["last"])) {
- return null;
- } else {
- $which = "last";
- }
- }
- $url = new Url($links[$which], null, 0);
- $qry = new QueryString($url->query);
- return $qry->getInt("page", 1);
- };
- }
-