Code Duplication    Length = 20-21 lines in 2 locations

src/Repo/Issue/Converter/GithubIssueConvertTrait.php 1 location

@@ 22-41 (lines=20) @@
19
     *
20
     * @return GithubIssueSource
21
     */
22
    protected function convertIssue(array $data)
23
    {
24
        return new GithubIssueSource(
25
            new GithubIssueId($data['id']),
26
            $this->githubRepo,
27
            $data['number'],
28
            GithubIssueStateFactory::create($data['state']),
29
            $data['title'],
30
            $data['body'],
31
            $this->getUser($data['user']),
32
            $this->getUserIfExists($data['assignee']),
33
            $this->getMilestoneIfExists($data['milestone']),
34
            $data['comments'],
35
36
            new DateTime($data['created_at']),
37
            new DateTime($data['updated_at']),
38
            $this->getDateIfExists($data['closed_at'])
39
40
        );
41
    }
42
}
43

src/Repo/Milestone/Converter/GithubMilestoneConvertTrait.php 1 location

@@ 22-42 (lines=21) @@
19
     *
20
     * @return GithubMilestoneSource
21
     */
22
    protected function convertMilestone(array $data)
23
    {
24
        $milestone = new GithubMilestoneSource(
25
            new GithubMilestoneId($data['id']),
26
            $this->githubRepo,
27
            $data['number'],
28
            GithubMilestoneStateFactory::create($data['state']),
29
            $data['title'],
30
            $data['description'],
31
            $this->getUserIfExists($data['creator']),
32
            $data['open_issues'],
33
            $data['closed_issues'],
34
            $this->getDateIfExists($data['due_on']),
35
            new DateTime($data['created_at']),
36
            new DateTime($data['updated_at']),
37
            $this->getDateIfExists($data['closed_at'])
38
39
        );
40
41
        return $milestone;
42
    }
43
44
    /**
45
     * @param array|null $data