@@ 9-39 (lines=31) @@ | ||
6 | use DevBoardLib\GithubObjectApiFacade\Repo\Milestone\Converter\GithubMilestoneConvertTrait; |
|
7 | use DevBoardLib\GithubObjectApiFacade\User\Converter\GithubUserConvertTrait; |
|
8 | ||
9 | class GithubIssueConverter |
|
10 | { |
|
11 | use GithubIssueConvertTrait; |
|
12 | use GithubMilestoneConvertTrait; |
|
13 | use GithubUserConvertTrait; |
|
14 | private $githubRepo; |
|
15 | ||
16 | /** |
|
17 | * GithubMilestoneConverter constructor. |
|
18 | * |
|
19 | * @param $githubRepo |
|
20 | */ |
|
21 | public function __construct(GithubRepo $githubRepo) |
|
22 | { |
|
23 | $this->githubRepo = $githubRepo; |
|
24 | } |
|
25 | ||
26 | public function convert($data) |
|
27 | { |
|
28 | return $this->convertIssue($data); |
|
29 | } |
|
30 | ||
31 | protected function getDateIfExists($dateString) |
|
32 | { |
|
33 | if (empty($dateString)) { |
|
34 | return null; |
|
35 | } |
|
36 | ||
37 | return new DateTime($dateString); |
|
38 | } |
|
39 | } |
|
40 |
@@ 8-37 (lines=30) @@ | ||
5 | use DevBoardLib\GithubCore\Repo\GithubRepo; |
|
6 | use DevBoardLib\GithubObjectApiFacade\User\Converter\GithubUserConvertTrait; |
|
7 | ||
8 | class GithubMilestoneConverter |
|
9 | { |
|
10 | use GithubMilestoneConvertTrait; |
|
11 | use GithubUserConvertTrait; |
|
12 | private $githubRepo; |
|
13 | ||
14 | /** |
|
15 | * GithubMilestoneConverter constructor. |
|
16 | * |
|
17 | * @param $githubRepo |
|
18 | */ |
|
19 | public function __construct(GithubRepo $githubRepo) |
|
20 | { |
|
21 | $this->githubRepo = $githubRepo; |
|
22 | } |
|
23 | ||
24 | public function convert($data) |
|
25 | { |
|
26 | return $this->convertMilestone($data); |
|
27 | } |
|
28 | ||
29 | protected function getDateIfExists($dateString) |
|
30 | { |
|
31 | if (empty($dateString)) { |
|
32 | return null; |
|
33 | } |
|
34 | ||
35 | return new DateTime($dateString); |
|
36 | } |
|
37 | } |
|
38 |