| @@ 15-24 (lines=10) @@ | ||
| 12 | ||
| 13 | class Build extends BaseBuild |
|
| 14 | { |
|
| 15 | public function jobs(): ObservableInterface |
|
| 16 | { |
|
| 17 | return Promise::toObservable( |
|
| 18 | $this->getTransport()->request('builds/' . $this->id()) |
|
| 19 | )->flatMap(function ($response) { |
|
| 20 | return Observable::fromArray($response['jobs']); |
|
| 21 | })->map(function ($job) { |
|
| 22 | return $this->getTransport()->getHydrator()->hydrate('Job', $job); |
|
| 23 | }); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function job(int $id): PromiseInterface |
|
| 27 | { |
|
| @@ 15-24 (lines=10) @@ | ||
| 12 | ||
| 13 | class Repository extends BaseRepository |
|
| 14 | { |
|
| 15 | public function builds(): ObservableInterface |
|
| 16 | { |
|
| 17 | return Promise::toObservable( |
|
| 18 | $this->getTransport()->request('repos/' . $this->slug() . '/builds') |
|
| 19 | )->flatMap(function ($response) { |
|
| 20 | return Observable::fromArray($response['builds']); |
|
| 21 | })->map(function ($build) { |
|
| 22 | return $this->getTransport()->getHydrator()->hydrate('Build', $build); |
|
| 23 | }); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function build(int $id): PromiseInterface |
|
| 27 | { |
|