| @@ 10-29 (lines=20) @@ | ||
| 7 | use WyriHaximus\Travis\Resource\Build as BaseBuild; |
|
| 8 | use function Clue\React\Block\await; |
|
| 9 | ||
| 10 | class Build extends BaseBuild |
|
| 11 | { |
|
| 12 | public function jobs(): array |
|
| 13 | { |
|
| 14 | return await( |
|
| 15 | Promise::fromObservable( |
|
| 16 | $this->getTransport()->getHydrator()->buildAsyncFromSync('Build', $this)->jobs()->toArray() |
|
| 17 | ), |
|
| 18 | $this->getTransport()->getLoop() |
|
| 19 | ); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function job(int $id): Job |
|
| 23 | { |
|
| 24 | return await( |
|
| 25 | $this->getTransport()->getHydrator()->buildAsyncFromSync('Build', $this)->job($id), |
|
| 26 | $this->getTransport()->getLoop() |
|
| 27 | ); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| @@ 12-31 (lines=20) @@ | ||
| 9 | use function Clue\React\Block\await; |
|
| 10 | use function React\Promise\resolve; |
|
| 11 | ||
| 12 | class Repository extends BaseRepository |
|
| 13 | { |
|
| 14 | public function builds(): array |
|
| 15 | { |
|
| 16 | return await( |
|
| 17 | Promise::fromObservable( |
|
| 18 | $this->getTransport()->getHydrator()->buildAsyncFromSync('Repository', $this)->builds()->toArray() |
|
| 19 | ), |
|
| 20 | $this->getTransport()->getLoop() |
|
| 21 | ); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function build(int $id): Build |
|
| 25 | { |
|
| 26 | return await( |
|
| 27 | $this->getTransport()->getHydrator()->buildAsyncFromSync('Repository', $this)->build($id), |
|
| 28 | $this->getTransport()->getLoop() |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||