| @@ 36-45 (lines=10) @@ | ||
| 33 | * @param int $id |
|
| 34 | * @return PromiseInterface |
|
| 35 | */ |
|
| 36 | public function job(int $id): PromiseInterface |
|
| 37 | { |
|
| 38 | return $this->handleCommand( |
|
| 39 | new SimpleRequestCommand('jobs/' . $id) |
|
| 40 | )->then(function (ResponseInterface $response) { |
|
| 41 | return $this->handleCommand( |
|
| 42 | new HydrateCommand('Job', $response->getBody()->getJson()['job']) |
|
| 43 | ); |
|
| 44 | }); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function refresh(): PromiseInterface |
|
| 48 | { |
|
| @@ 47-56 (lines=10) @@ | ||
| 44 | }); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function refresh(): PromiseInterface |
|
| 48 | { |
|
| 49 | return $this->handleCommand( |
|
| 50 | new SimpleRequestCommand('builds/' . $this->id) |
|
| 51 | )->then(function (ResponseInterface $response) { |
|
| 52 | return resolve($this->handleCommand( |
|
| 53 | new SimpleRequestCommand('Build', $response->getBody()->getJson()['build']) |
|
| 54 | )); |
|
| 55 | }); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| @@ 15-22 (lines=8) @@ | ||
| 12 | ||
| 13 | class Commit extends BaseCommit |
|
| 14 | { |
|
| 15 | public function refresh(): PromiseInterface |
|
| 16 | { |
|
| 17 | return $this->handleCommand( |
|
| 18 | new SimpleRequestCommand('builds/' . $this->id) |
|
| 19 | )->then(function (ResponseInterface $response) { |
|
| 20 | return resolve($this->handleCommand(new HydrateCommand('Build', $response->getBody()->getJosn()['build']))); |
|
| 21 | }); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||
| @@ 17-24 (lines=8) @@ | ||
| 14 | /** |
|
| 15 | * @return PromiseInterface |
|
| 16 | */ |
|
| 17 | public function refresh() : PromiseInterface |
|
| 18 | { |
|
| 19 | return $this->handleCommand( |
|
| 20 | new SimpleRequestCommand('settings/ssh_key/' . $this->id()) |
|
| 21 | )->then(function ($json) { |
|
| 22 | return resolve($this->handleCommand(new HydrateCommand('SSHKey', $json['ssh_key']))); |
|
| 23 | }); |
|
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| @@ 20-27 (lines=8) @@ | ||
| 17 | /** |
|
| 18 | * @return PromiseInterface |
|
| 19 | */ |
|
| 20 | public function refresh() : PromiseInterface |
|
| 21 | { |
|
| 22 | return $this->handleCommand( |
|
| 23 | new SimpleRequestCommand('users/' . $this->id()) |
|
| 24 | )->then(function (ResponseInterface $response) { |
|
| 25 | return resolve($this->handleCommand(new HydrateCommand('User', $response->getBody()->getJson()['user']))); |
|
| 26 | }); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @return PromiseInterface |
|
| @@ 50-59 (lines=10) @@ | ||
| 47 | * @param int $id |
|
| 48 | * @return PromiseInterface |
|
| 49 | */ |
|
| 50 | public function build(int $id): PromiseInterface |
|
| 51 | { |
|
| 52 | return $this->handleCommand( |
|
| 53 | new SimpleRequestCommand('repos/' . $this->slug() . '/builds/' . $id) |
|
| 54 | )->then(function (ResponseInterface $response) { |
|
| 55 | return resolve($this->handleCommand( |
|
| 56 | new HydrateCommand('Build', $response->getBody()->getJson()['build']) |
|
| 57 | )); |
|
| 58 | }); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @return ObservableInterface |
|
| @@ 110-119 (lines=10) @@ | ||
| 107 | /** |
|
| 108 | * @return PromiseInterface |
|
| 109 | */ |
|
| 110 | public function settings(): PromiseInterface |
|
| 111 | { |
|
| 112 | return $this->handleCommand( |
|
| 113 | new SimpleRequestCommand('repos/' . $this->id() . '/settings') |
|
| 114 | )->then(function (ResponseInterface $response) { |
|
| 115 | return resolve($this->handleCommand( |
|
| 116 | new HydrateCommand('Settings', $response->getBody()->getJson()['settings']) |
|
| 117 | )); |
|
| 118 | }); |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * @return PromiseInterface |
|
| @@ 226-233 (lines=8) @@ | ||
| 223 | /** |
|
| 224 | * @return PromiseInterface |
|
| 225 | */ |
|
| 226 | public function key(): PromiseInterface |
|
| 227 | { |
|
| 228 | return $this->handleCommand( |
|
| 229 | new SimpleRequestCommand('repos/' . $this->slug() . '/key') |
|
| 230 | )->then(function (ResponseInterface $response) { |
|
| 231 | return resolve($this->handleCommand(new HydrateCommand('RepositoryKey', $response->getBody()->getJson()))); |
|
| 232 | }); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function refresh(): PromiseInterface |
|
| 236 | { |
|