Code Duplication    Length = 15-18 lines in 3 locations

src/Mailgun/Api/Domain.php 1 location

@@ 129-143 (lines=15) @@
126
     *
127
     * @return CredentialResponse
128
     */
129
    public function credentials($domain, $limit = 100, $skip = 0)
130
    {
131
        Assert::stringNotEmpty($domain);
132
        Assert::integer($limit);
133
        Assert::integer($skip);
134
135
        $params = [
136
            'limit' => $limit,
137
            'skip' => $skip,
138
        ];
139
140
        $response = $this->httpGet(sprintf('/v3/domains/%s/credentials', $domain), $params);
141
142
        return $this->hydrateResponse($response, CredentialResponse::class);
143
    }
144
145
    /**
146
     * Create a new SMTP credential pair for the specified domain.

src/Mailgun/Api/Route.php 2 locations

@@ 34-49 (lines=16) @@
31
     *
32
     * @return IndexResponse
33
     */
34
    public function index($limit = 100, $skip = 0)
35
    {
36
        Assert::integer($limit);
37
        Assert::integer($skip);
38
        Assert::greaterThan($limit, 0);
39
        Assert::greaterThanEq($skip, 0);
40
41
        $params = [
42
            'limit' => $limit,
43
            'skip' => $skip,
44
        ];
45
46
        $response = $this->httpGet('/v3/routes', $params);
47
48
        return $this->hydrateResponse($response, IndexResponse::class);
49
    }
50
51
    /**
52
     * Returns a single Route object based on its ID.
@@ 77-94 (lines=18) @@
74
     *
75
     * @return CreateResponse
76
     */
77
    public function create($expression, array $actions, $description, $priority = 0)
78
    {
79
        Assert::string($expression);
80
        Assert::isArray($actions);
81
        Assert::string($description);
82
        Assert::integer($priority);
83
84
        $params = [
85
            'priority' => $priority,
86
            'expression' => $expression,
87
            'action' => $actions,
88
            'description' => $description,
89
        ];
90
91
        $response = $this->httpPost('/v3/routes', $params);
92
93
        return $this->hydrateResponse($response, CreateResponse::class);
94
    }
95
96
    /**
97
     * Updates a given Route by ID. All parameters are optional.