Code Duplication    Length = 11-12 lines in 3 locations

lib/GitHub/Receiver/Issues/Milestones.php 2 locations

@@ 66-77 (lines=12) @@
63
     *
64
     * @return array
65
     */
66
    public function createMilestone(string $title, string $state = AbstractApi::STATE_OPEN, string $description = '',
67
                                    string $dueOn = ''): array
68
    {
69
        return $this->getApi()->request($this->getApi()
70
                                             ->sprintf('/repos/:owner/:repo/milestones', $this->getIssues()->getOwner(),
71
                                                 $this->getIssues()->getRepo()), Request::METHOD_POST, [
72
                'title'       => $title,
73
                'state'       => $state,
74
                'description' => $description,
75
                'due_on'      => (new DateTime($dueOn))->format(DateTime::ATOM)
76
            ]);
77
    }
78
79
    /**
80
     * Update a milestone
@@ 92-102 (lines=11) @@
89
     *
90
     * @return array
91
     */
92
    public function updateMilestone(int $number, string $title = '', string $state = AbstractApi::STATE_OPEN,
93
                                    string $description = '', string $dueOn = ''): array
94
    {
95
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number',
96
            $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_PATCH, [
97
                'title'       => $title,
98
                'state'       => $state,
99
                'description' => $description,
100
                'due_on'      => (new DateTime($dueOn))->format(DateTime::ATOM)
101
            ]);
102
    }
103
104
    /**
105
     * Delete a milestone

lib/GitHub/Receiver/PullRequests/ReviewComments.php 1 location

@@ 45-55 (lines=11) @@
42
     * @return array
43
     * @throws \Exception
44
     */
45
    public function listCommentsRepository(string $sort = AbstractApi::SORT_CREATED,
46
                                           string $direction = AbstractApi::DIRECTION_DESC,
47
                                           string $since = 'now'): array
48
    {
49
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments?:args',
50
            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), http_build_query([
51
                'sort'      => $sort,
52
                'direction' => $direction,
53
                'since'     => (new DateTime($since))->format(DateTime::ATOM)
54
            ])));
55
    }
56
57
    /**
58
     * Get a single comment