Code Duplication    Length = 15-18 lines in 3 locations

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.

src/Mailgun/Api/Domain.php 1 location

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