12345678910111213141516171819202122232425262728 |
- <?php
- namespace Gogs\API\Request {
- final class Brances extends Collection {
- protected $repo;
- public function __construct(string $api_url, string $api_token, Repo $repo) {
- $this->repo = $repo;
- parent::__construct($api_url, $api_token);
- }
- protected function set_scope(string $method) {
- switch ($method) {
- case "get":
- case "load":
- if ($owner == null)
- throw new Exception\InvalidMethodRequestException("Missing repository for branches");
- $this->scope = sprintf("/repos/%s/%s/branches", $this->repo->owner, $this->repo->name);
- return true;
- }
- return false;
- }
- }
- }
|