@@ 12-41 (lines=30) @@ | ||
9 | use React\Promise\PromiseInterface; |
|
10 | use function React\Promise\resolve; |
|
11 | ||
12 | final class AnnotationsHandler |
|
13 | { |
|
14 | /** |
|
15 | * @var FetchAndHydrateService |
|
16 | */ |
|
17 | private $service; |
|
18 | ||
19 | /** |
|
20 | * @param FetchAndIterateService $service |
|
21 | */ |
|
22 | public function __construct(FetchAndIterateService $service) |
|
23 | { |
|
24 | $this->service = $service; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * Fetch the given repository and hydrate it. |
|
29 | * |
|
30 | * @param AnnotationsCommand $command |
|
31 | * @return PromiseInterface |
|
32 | */ |
|
33 | public function handle(AnnotationsCommand $command): PromiseInterface |
|
34 | { |
|
35 | return resolve($this->service->iterate( |
|
36 | 'jobs/' . (string)$command->getRepositoryId() . '/annotations', |
|
37 | 'annotations', |
|
38 | AnnotationInterface::HYDRATE_CLASS |
|
39 | )); |
|
40 | } |
|
41 | } |
|
42 |
@@ 12-41 (lines=30) @@ | ||
9 | use React\Promise\PromiseInterface; |
|
10 | use function React\Promise\resolve; |
|
11 | ||
12 | final class BranchesHandler |
|
13 | { |
|
14 | /** |
|
15 | * @var FetchAndHydrateService |
|
16 | */ |
|
17 | private $service; |
|
18 | ||
19 | /** |
|
20 | * @param FetchAndIterateService $service |
|
21 | */ |
|
22 | public function __construct(FetchAndIterateService $service) |
|
23 | { |
|
24 | $this->service = $service; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * Fetch the given repository and hydrate it. |
|
29 | * |
|
30 | * @param BranchesCommand $command |
|
31 | * @return PromiseInterface |
|
32 | */ |
|
33 | public function handle(BranchesCommand $command): PromiseInterface |
|
34 | { |
|
35 | return resolve($this->service->iterate( |
|
36 | 'repos/' . (string)$command->getRepositoryId() . '/branches', |
|
37 | 'branches', |
|
38 | BranchInterface::HYDRATE_CLASS |
|
39 | )); |
|
40 | } |
|
41 | } |
|
42 |
@@ 12-41 (lines=30) @@ | ||
9 | use React\Promise\PromiseInterface; |
|
10 | use function React\Promise\resolve; |
|
11 | ||
12 | final class CachesHandler |
|
13 | { |
|
14 | /** |
|
15 | * @var FetchAndHydrateService |
|
16 | */ |
|
17 | private $service; |
|
18 | ||
19 | /** |
|
20 | * @param FetchAndIterateService $service |
|
21 | */ |
|
22 | public function __construct(FetchAndIterateService $service) |
|
23 | { |
|
24 | $this->service = $service; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * Fetch the given repository and hydrate it. |
|
29 | * |
|
30 | * @param CachesCommand $command |
|
31 | * @return PromiseInterface |
|
32 | */ |
|
33 | public function handle(CachesCommand $command): PromiseInterface |
|
34 | { |
|
35 | return resolve($this->service->iterate( |
|
36 | 'repos/' . (string)$command->getRepositoryId() . '/caches', |
|
37 | 'caches', |
|
38 | CacheInterface::HYDRATE_CLASS |
|
39 | )); |
|
40 | } |
|
41 | } |
|
42 |
@@ 12-41 (lines=30) @@ | ||
9 | use React\Promise\PromiseInterface; |
|
10 | use function React\Promise\resolve; |
|
11 | ||
12 | final class VarsHandler |
|
13 | { |
|
14 | /** |
|
15 | * @var FetchAndHydrateService |
|
16 | */ |
|
17 | private $service; |
|
18 | ||
19 | /** |
|
20 | * @param FetchAndIterateService $service |
|
21 | */ |
|
22 | public function __construct(FetchAndIterateService $service) |
|
23 | { |
|
24 | $this->service = $service; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * Fetch the given repository and hydrate it. |
|
29 | * |
|
30 | * @param VarsCommand $command |
|
31 | * @return PromiseInterface |
|
32 | */ |
|
33 | public function handle(VarsCommand $command): PromiseInterface |
|
34 | { |
|
35 | return resolve($this->service->iterate( |
|
36 | 'settings/env_vars?repository_id=' . (string)$command->getRepositoryId(), |
|
37 | 'env_vars', |
|
38 | EnvironmentVariableInterface::HYDRATE_CLASS |
|
39 | )); |
|
40 | } |
|
41 | } |
|
42 |