Code Duplication    Length = 8-15 lines in 5 locations

src/Mailgun/Api/Domain.php 1 location

@@ 204-218 (lines=15) @@
201
     *
202
     * @return DeleteCredentialResponse|array|ResponseInterface
203
     */
204
    public function deleteCredential($domain, $login)
205
    {
206
        Assert::stringNotEmpty($domain);
207
        Assert::stringNotEmpty($login);
208
209
        $response = $this->httpDelete(
210
            sprintf(
211
                '/v3/domains/%s/credentials/%s',
212
                $domain,
213
                $login
214
            )
215
        );
216
217
        return $this->deserializer->deserialize($response, DeleteCredentialResponse::class);
218
    }
219
220
    /**
221
     * Returns delivery connection settings for the specified domain.

src/Mailgun/Api/Stats.php 2 locations

@@ 29-36 (lines=8) @@
26
     *
27
     * @return TotalResponse|array
28
     */
29
    public function total($domain, array $params = [])
30
    {
31
        Assert::stringNotEmpty($domain);
32
33
        $response = $this->httpGet(sprintf('/v3/%s/stats/total', rawurlencode($domain)), $params);
34
35
        return $this->deserializer->deserialize($response, TotalResponse::class);
36
    }
37
38
    /**
39
     * @param $domain
@@ 44-51 (lines=8) @@
41
     *
42
     * @return AllResponse|array
43
     */
44
    public function all($domain, array $params = [])
45
    {
46
        Assert::stringNotEmpty($domain);
47
48
        $response = $this->httpGet(sprintf('/v3/%s/stats', rawurlencode($domain)), $params);
49
50
        return $this->deserializer->deserialize($response, AllResponse::class);
51
    }
52
}
53

src/Mailgun/Api/Webhook.php 2 locations

@@ 43-50 (lines=8) @@
40
     *
41
     * @return ShowResponse
42
     */
43
    public function show($domain, $webhook)
44
    {
45
        Assert::notEmpty($domain);
46
        Assert::notEmpty($webhook);
47
        $response = $this->httpGet(sprintf('/v3/domains/%s/webhooks/%s', $domain, $webhook));
48
49
        return $this->deserializer->deserialize($response, ShowResponse::class);
50
    }
51
52
    /**
53
     * @param string $domain
@@ 103-111 (lines=9) @@
100
     *
101
     * @return DeleteResponse
102
     */
103
    public function delete($domain, $id)
104
    {
105
        Assert::notEmpty($domain);
106
        Assert::notEmpty($id);
107
108
        $response = $this->httpDelete(sprintf('/v3/domains/%s/webhooks/%s', $domain, $id));
109
110
        return $this->deserializer->deserialize($response, DeleteResponse::class);
111
    }
112
}
113