Code Duplication    Length = 18-19 lines in 2 locations

src/Mailgun/Api/Attachment.php 1 location

@@ 18-35 (lines=18) @@
15
/**
16
 * @author Tobias Nyholm <[email protected]>
17
 */
18
class Attachment extends HttpApi
19
{
20
    /**
21
     * @param string $url
22
     *
23
     * @return Model
24
     */
25
    public function show($url)
26
    {
27
        Assert::stringNotEmpty($url);
28
        Assert::regex($url, '@https://.*mailgun\.(net|org)/v.+@');
29
        Assert::regex($url, '|/attachments/[0-9]+|');
30
31
        $response = $this->httpGet($url);
32
33
        return $this->hydrateResponse($response, Model::class);
34
    }
35
}
36

src/Mailgun/Api/Event.php 1 location

@@ 20-38 (lines=19) @@
17
 *
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
class Event extends HttpApi
21
{
22
    use Pagination;
23
24
    /**
25
     * @param string $domain
26
     * @param array  $params
27
     *
28
     * @return EventResponse
29
     */
30
    public function get($domain, array $params = [])
31
    {
32
        Assert::stringNotEmpty($domain);
33
34
        $response = $this->httpGet(sprintf('/v3/%s/events', $domain), $params);
35
36
        return $this->hydrateResponse($response, EventResponse::class);
37
    }
38
}
39