Code Duplication    Length = 7-14 lines in 3 locations

lib/GitHub/Receiver/Repositories/Commits.php 1 location

@@ 28-39 (lines=12) @@
25
     *
26
     * @return array
27
     */
28
    public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null,
29
                                string $since = null, string $until = null): array
30
    {
31
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args',
32
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([
33
                "sha"    => $sha,
34
                "path"   => $path,
35
                "author" => $author,
36
                "since"  => $since,
37
                "until"  => $until
38
            ])));
39
    }
40
41
    /**
42
     * Get a single commit

lib/GitHub/Receiver/Repositories/Deployments.php 1 location

@@ 28-34 (lines=7) @@
25
     *
26
     * @return array
27
     */
28
    public function listDeployments(string $sha = null, string $ref = null, string $task = null,
29
                                    string $environment = null): array
30
    {
31
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
32
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
33
            http_build_query(['sha' => $sha, 'ref' => $ref, 'task' => $task, 'environment' => $environment])));
34
    }
35
36
    /**
37
     * Create a Deployment

lib/GitHub/Receiver/Repositories/Releases.php 1 location

@@ 87-100 (lines=14) @@
84
     *
85
     * @return array
86
     */
87
    public function createRelease(string $tagName, string $targetCommitish = AbstractApi::BRANCH_MASTER,
88
                                  string $name = null, string $body = null, bool $draft = false,
89
                                  bool $preRelease = false): array
90
    {
91
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases',
92
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
93
                'tag_name'         => $tagName,
94
                'target_commitish' => $targetCommitish,
95
                'name'             => $name,
96
                'body'             => $body,
97
                'draft'            => $draft,
98
                'prerelease'       => $preRelease
99
            ]);
100
    }
101
102
    /**
103
     * Edit a release