| @@ 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 | ||
| @@ 53-62 (lines=10) @@ | ||
| 50 | * @param int $id |
|
| 51 | * @return PromiseInterface |
|
| 52 | */ |
|
| 53 | public function build(int $id): PromiseInterface |
|
| 54 | { |
|
| 55 | return $this->handleCommand( |
|
| 56 | new SimpleRequestCommand('repos/' . $this->slug() . '/builds/' . $id) |
|
| 57 | )->then(function (ResponseInterface $response) { |
|
| 58 | return resolve($this->handleCommand( |
|
| 59 | new HydrateCommand('Build', $response->getBody()->getJson()['build']) |
|
| 60 | )); |
|
| 61 | }); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @return ObservableInterface |
|