Code Duplication    Length = 8-15 lines in 4 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->safeDeserialize($response, DeleteCredentialResponse::class);
218
    }
219
220
    /**
221
     * Returns delivery connection settings for the specified domain.

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->safeDeserialize($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->safeDeserialize($response, DeleteResponse::class);
111
    }
112
}
113

src/Mailgun/Api/Routes.php 1 location

@@ 146-153 (lines=8) @@
143
     *
144
     * @return DeleteResponse
145
     */
146
    public function delete($routeId)
147
    {
148
        Assert::stringNotEmpty($routeId);
149
150
        $response = $this->httpDelete(sprintf('/v3/routes/%s', $routeId));
151
152
        return $this->safeDeserialize($response, DeleteResponse::class);
153
    }
154
}
155