| @@ 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 | { |
|
| @@ 35-44 (lines=10) @@ | ||
| 32 | }); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function commits(): ObservableInterface |
|
| 36 | { |
|
| 37 | return Promise::toObservable( |
|
| 38 | $this->getTransport()->request('repos/' . $this->slug() . '/builds') |
|
| 39 | )->flatMap(function ($response) { |
|
| 40 | return Observable::fromArray($response['commits']); |
|
| 41 | })->map(function ($build) { |
|
| 42 | return $this->getTransport()->getHydrator()->hydrate('Commit', $build); |
|
| 43 | }); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function key(): PromiseInterface |
|
| 47 | { |
|