@@ 8-42 (lines=35) @@ | ||
5 | use Psr\Http\Message\RequestInterface; |
|
6 | use Psr\Http\Message\ResponseInterface; |
|
7 | ||
8 | class Repository implements EndpointInterface |
|
9 | { |
|
10 | use ParentHasClientAwareTrait; |
|
11 | ||
12 | /** |
|
13 | * @var string |
|
14 | */ |
|
15 | protected $repository; |
|
16 | ||
17 | public function __construct(Travis $parent, string $repository) |
|
18 | { |
|
19 | $this->setParent($parent); |
|
20 | $this->repository = $repository; |
|
21 | } |
|
22 | ||
23 | public function getRepository(): string |
|
24 | { |
|
25 | return $this->repository; |
|
26 | } |
|
27 | ||
28 | public function builds(): Builds |
|
29 | { |
|
30 | return new Builds($this); |
|
31 | } |
|
32 | ||
33 | public function getRequest(): RequestInterface |
|
34 | { |
|
35 | // TODO: Implement getRequest() method. |
|
36 | } |
|
37 | ||
38 | public function fromResponse(ResponseInterface $response): EndpointInterface |
|
39 | { |
|
40 | // TODO: Implement fromResponse() method. |
|
41 | } |
|
42 | } |
|
43 |
@@ 10-45 (lines=36) @@ | ||
7 | use Psr\Http\Message\RequestInterface; |
|
8 | use Psr\Http\Message\ResponseInterface; |
|
9 | ||
10 | class BuildCollection implements EndpointInterface, IteratorAggregate |
|
11 | { |
|
12 | use ParentHasClientAwareTrait; |
|
13 | ||
14 | /** |
|
15 | * @var Repository |
|
16 | */ |
|
17 | protected $repository; |
|
18 | ||
19 | /** |
|
20 | * @var array |
|
21 | */ |
|
22 | protected $builds; |
|
23 | ||
24 | public function __construct(Repository $repository, array $builds) |
|
25 | { |
|
26 | $this->setParent($repository); |
|
27 | $this->repository = $repository; |
|
28 | $this->builds = $builds; |
|
29 | } |
|
30 | ||
31 | public function getRequest(): RequestInterface |
|
32 | { |
|
33 | // TODO: Implement getRequest() method. |
|
34 | } |
|
35 | ||
36 | public function fromResponse(ResponseInterface $response): EndpointInterface |
|
37 | { |
|
38 | // TODO: Implement fromResponse() method. |
|
39 | } |
|
40 | ||
41 | public function getIterator() |
|
42 | { |
|
43 | return new ArrayIterator($this->builds); |
|
44 | } |
|
45 | } |
|
46 |
@@ 8-52 (lines=45) @@ | ||
5 | use Psr\Http\Message\RequestInterface; |
|
6 | use Psr\Http\Message\ResponseInterface; |
|
7 | ||
8 | class Build implements EndpointInterface |
|
9 | { |
|
10 | use ParentHasClientAwareTrait; |
|
11 | ||
12 | /** |
|
13 | * @var Repository |
|
14 | */ |
|
15 | protected $repository; |
|
16 | ||
17 | /** |
|
18 | * @var int |
|
19 | */ |
|
20 | protected $id; |
|
21 | ||
22 | public function __construct(Repository $repository, \stdClass $build) |
|
23 | { |
|
24 | $this->setParent($repository); |
|
25 | $this->repository = $repository; |
|
26 | ||
27 | $this->id = $build->id; |
|
28 | } |
|
29 | ||
30 | public function getRequest(): RequestInterface |
|
31 | { |
|
32 | // TODO: Implement getRequest() method. |
|
33 | } |
|
34 | ||
35 | public function fromResponse(ResponseInterface $response): EndpointInterface |
|
36 | { |
|
37 | // TODO: Implement fromResponse() method. |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @return mixed |
|
42 | */ |
|
43 | public function getId(): int |
|
44 | { |
|
45 | return $this->id; |
|
46 | } |
|
47 | ||
48 | public function matrix() |
|
49 | { |
|
50 | return new BuildMatrix($this); |
|
51 | } |
|
52 | } |
|
53 |
@@ 10-53 (lines=44) @@ | ||
7 | use Psr\Http\Message\RequestInterface; |
|
8 | use Psr\Http\Message\ResponseInterface; |
|
9 | ||
10 | class JobCollection implements EndpointInterface, IteratorAggregate |
|
11 | { |
|
12 | use ParentHasClientAwareTrait; |
|
13 | ||
14 | /** |
|
15 | * @var Repository |
|
16 | */ |
|
17 | protected $build; |
|
18 | ||
19 | /** |
|
20 | * @var array |
|
21 | */ |
|
22 | protected $builds; |
|
23 | ||
24 | public function __construct(Build $build, array $builds) |
|
25 | { |
|
26 | $this->setParent($build); |
|
27 | $this->build = $build; |
|
28 | $this->builds = $builds; |
|
29 | } |
|
30 | ||
31 | public function getRequest(): RequestInterface |
|
32 | { |
|
33 | // TODO: Implement getRequest() method. |
|
34 | } |
|
35 | ||
36 | public function fromResponse(ResponseInterface $response): EndpointInterface |
|
37 | { |
|
38 | // TODO: Implement fromResponse() method. |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @return Repository |
|
43 | */ |
|
44 | public function getBuild() |
|
45 | { |
|
46 | return $this->build; |
|
47 | } |
|
48 | ||
49 | public function getIterator() |
|
50 | { |
|
51 | return new ArrayIterator($this->builds); |
|
52 | } |
|
53 | } |
|
54 |