src/Resource/Async/Build.php 1 location
|
@@ 21-30 (lines=10) @@
|
| 18 |
|
/** |
| 19 |
|
* @return ObservableInterface |
| 20 |
|
*/ |
| 21 |
|
public function jobs(): ObservableInterface |
| 22 |
|
{ |
| 23 |
|
return Promise::toObservable( |
| 24 |
|
$this->handleCommand(new SimpleRequestCommand('builds/' . $this->id())) |
| 25 |
|
)->flatMap(function ($response) { |
| 26 |
|
return Observable::fromArray($response->getBody()->getJson()['jobs']); |
| 27 |
|
})->flatMap(function ($job) { |
| 28 |
|
return Promise::toObservable($this->handleCommand(new HydrateCommand('Job', $job))); |
| 29 |
|
}); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
/** |
| 33 |
|
* @param int $id |
src/Resource/Async/Job.php 1 location
|
@@ 46-55 (lines=10) @@
|
| 43 |
|
/** |
| 44 |
|
* @return ObservableInterface |
| 45 |
|
*/ |
| 46 |
|
public function annotations(): ObservableInterface |
| 47 |
|
{ |
| 48 |
|
return Promise::toObservable( |
| 49 |
|
$this->handleCommand(new SimpleRequestCommand('jobs/' . $this->id() . '/annotations')) |
| 50 |
|
)->flatMap(function ($response) { |
| 51 |
|
return Observable::fromArray($response['annotations']); |
| 52 |
|
})->flatMap(function ($annotation) { |
| 53 |
|
return Promise::toObservable($this->handleCommand(new HydrateCommand('Annotation', $annotation))); |
| 54 |
|
}); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
/** |
| 58 |
|
* @return PromiseInterface |
src/Resource/Async/Repository.php 1 location
|
@@ 34-43 (lines=10) @@
|
| 31 |
|
|
| 32 |
|
class Repository extends BaseRepository |
| 33 |
|
{ |
| 34 |
|
public function builds(): Observable |
| 35 |
|
{ |
| 36 |
|
return Promise::toObservable( |
| 37 |
|
$this->handleCommand(new SimpleRequestCommand('repos/' . $this->slug() . '/builds')) |
| 38 |
|
)->flatMap(function (ResponseInterface $response) { |
| 39 |
|
return Observable::fromArray($response->getBody()->getJson()['builds']); |
| 40 |
|
})->flatMap(function (array $build) { |
| 41 |
|
return Promise::toObservable($this->handleCommand(new HydrateCommand('Build', $build))); |
| 42 |
|
}); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function jobs(int $buildId): Observable |
| 46 |
|
{ |