123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Gogs\API\Request {
- /**
- * A single Branch
- *
- * @author Joachim M. Giaever (joachim[]giaever.org)
- * @version 0.1
- */
- final class Branch extends Base {
- private $repo;
- public $branch_name;
- public $branch_commit;
-
- public function __construct(string $api_url, string $api_token, Repo $repo) {
- parent::__construct($api_url, $api_token);
- $this->repo = $repo;
- }
-
- protected function set_scope(string $method) {
- switch ($method) {
- case "load":
- $this->scope = sprintf("/repos/%s/%s/branches/%s", $this->repo->owner, $this->repo->name, $this->name);
- return true;
- }
- return false;
- }
- }
- }
- ?>
|