@@ 12-79 (lines=68) @@ | ||
9 | /** |
|
10 | * Class GithubBranchSource. |
|
11 | */ |
|
12 | class GithubBranchSource implements GithubBranch |
|
13 | { |
|
14 | /** @var GithubBranchId */ |
|
15 | private $id; |
|
16 | ||
17 | /** @var GithubRepo */ |
|
18 | private $repo; |
|
19 | ||
20 | /** @var string */ |
|
21 | private $name; |
|
22 | ||
23 | /** @var GithubCommit */ |
|
24 | private $lastCommit; |
|
25 | ||
26 | /** |
|
27 | * GithubBranchSource constructor. |
|
28 | * |
|
29 | * @param GithubBranchId $id |
|
30 | * @param GithubRepo $repo |
|
31 | * @param string $name |
|
32 | * @param GithubCommit $lastCommit |
|
33 | */ |
|
34 | public function __construct(GithubBranchId $id, GithubRepo $repo, $name, GithubCommit $lastCommit) |
|
35 | { |
|
36 | $this->id = $id; |
|
37 | $this->repo = $repo; |
|
38 | $this->name = $name; |
|
39 | $this->lastCommit = $lastCommit; |
|
40 | } |
|
41 | ||
42 | /** @return GithubBranchId */ |
|
43 | public function getId() |
|
44 | { |
|
45 | return $this->id; |
|
46 | } |
|
47 | ||
48 | /** @return GithubRepoId */ |
|
49 | public function getRepoId() |
|
50 | { |
|
51 | return $this->repo->getId(); |
|
52 | } |
|
53 | ||
54 | /** @return GithubRepo */ |
|
55 | public function getRepo() |
|
56 | { |
|
57 | return $this->repo; |
|
58 | } |
|
59 | ||
60 | /** @return string */ |
|
61 | public function getName() |
|
62 | { |
|
63 | return $this->name; |
|
64 | } |
|
65 | ||
66 | /** @return GithubCommitId */ |
|
67 | public function getLastCommitId() |
|
68 | { |
|
69 | return $this->lastCommit->getId(); |
|
70 | } |
|
71 | ||
72 | /** @return GithubCommit */ |
|
73 | public function getLastCommit() |
|
74 | { |
|
75 | return $this->lastCommit; |
|
76 | } |
|
77 | } |
|
78 |
@@ 12-79 (lines=68) @@ | ||
9 | /** |
|
10 | * Class GithubTagSource. |
|
11 | */ |
|
12 | class GithubTagSource implements GithubTag |
|
13 | { |
|
14 | /** @var GithubTagId */ |
|
15 | private $id; |
|
16 | ||
17 | /** @var GithubRepo */ |
|
18 | private $repo; |
|
19 | ||
20 | /** @var string */ |
|
21 | private $name; |
|
22 | ||
23 | /** @var GithubCommit */ |
|
24 | private $lastCommit; |
|
25 | ||
26 | /** |
|
27 | * GithubTagSource constructor. |
|
28 | * |
|
29 | * @param GithubTagId $id |
|
30 | * @param GithubRepo $repo |
|
31 | * @param string $name |
|
32 | * @param GithubCommit $lastCommit |
|
33 | */ |
|
34 | public function __construct(GithubTagId $id, GithubRepo $repo, $name, GithubCommit $lastCommit) |
|
35 | { |
|
36 | $this->id = $id; |
|
37 | $this->repo = $repo; |
|
38 | $this->name = $name; |
|
39 | $this->lastCommit = $lastCommit; |
|
40 | } |
|
41 | ||
42 | /** @return GithubTagId */ |
|
43 | public function getId() |
|
44 | { |
|
45 | return $this->id; |
|
46 | } |
|
47 | ||
48 | /** @return GithubRepoId */ |
|
49 | public function getRepoId() |
|
50 | { |
|
51 | return $this->repo->getId(); |
|
52 | } |
|
53 | ||
54 | /** @return GithubRepo */ |
|
55 | public function getRepo() |
|
56 | { |
|
57 | return $this->repo; |
|
58 | } |
|
59 | ||
60 | /** @return string */ |
|
61 | public function getName() |
|
62 | { |
|
63 | return $this->name; |
|
64 | } |
|
65 | ||
66 | /** @return GithubCommitId */ |
|
67 | public function getLastCommitId() |
|
68 | { |
|
69 | return $this->lastCommit->getId(); |
|
70 | } |
|
71 | ||
72 | /** @return GithubCommitId */ |
|
73 | public function getLastCommit() |
|
74 | { |
|
75 | return $this->lastCommit; |
|
76 | } |
|
77 | } |
|
78 |