Code Duplication    Length = 8-9 lines in 14 locations

src/Api/EmailValidationV4.php 2 locations

@@ 109-116 (lines=8) @@
106
     *
107
     * @throws Exception
108
     */
109
    public function getBulkJob(string $listId)
110
    {
111
        Assert::stringNotEmpty($listId);
112
113
        $response = $this->httpGet(sprintf('/v4/address/validate/bulk/%s', $listId));
114
115
        return $this->hydrateResponse($response, GetBulkJobResponse::class);
116
    }
117
118
    /**
119
     * @param int $limit Jobs limit
@@ 191-198 (lines=8) @@
188
     *
189
     * @throws Exception
190
     */
191
    public function getBulkPreview(string $previewId)
192
    {
193
        Assert::stringNotEmpty($previewId);
194
195
        $response = $this->httpGet(sprintf('/v4/address/validate/preview/%s', $previewId));
196
197
        return $this->hydrateResponse($response, GetBulkPreviewResponse::class);
198
    }
199
200
    /**
201
     * @param string $previewId ID given when the list created

src/Api/MailingList.php 2 locations

@@ 99-106 (lines=8) @@
96
     *
97
     * @throws \Exception
98
     */
99
    public function show(string $address)
100
    {
101
        Assert::stringNotEmpty($address);
102
103
        $response = $this->httpGet(sprintf('/v3/lists/%s', $address));
104
105
        return $this->hydrateResponse($response, ShowResponse::class);
106
    }
107
108
    /**
109
     * Updates a mailing list.
@@ 188-195 (lines=8) @@
185
     *
186
     * @throws \Exception
187
     */
188
    public function getValidationStatus(string $address)
189
    {
190
        Assert::stringNotEmpty($address);
191
192
        $response = $this->httpGet(sprintf('/v3/lists/%s/validate', $address));
193
194
        return $this->hydrateResponse($response, ValidationStatusResponse::class);
195
    }
196
197
    /**
198
     * Cancel mailing list validation.

src/Api/MailingList/Member.php 1 location

@@ 70-78 (lines=9) @@
67
     *
68
     * @throws \Exception
69
     */
70
    public function show(string $list, string $address)
71
    {
72
        Assert::stringNotEmpty($list);
73
        Assert::stringNotEmpty($address);
74
75
        $response = $this->httpGet(sprintf('/v3/lists/%s/members/%s', $list, $address));
76
77
        return $this->hydrateResponse($response, ShowResponse::class);
78
    }
79
80
    /**
81
     * Creates (or updates) a member of the mailing list.

src/Api/Route.php 1 location

@@ 59-66 (lines=8) @@
56
     *
57
     * @return ShowResponse
58
     */
59
    public function show(string $routeId)
60
    {
61
        Assert::stringNotEmpty($routeId);
62
63
        $response = $this->httpGet(sprintf('/v3/routes/%s', $routeId));
64
65
        return $this->hydrateResponse($response, ShowResponse::class);
66
    }
67
68
    /**
69
     * Creates a new Route.

src/Api/Suppression/Bounce.php 1 location

@@ 57-65 (lines=9) @@
54
     *
55
     * @return ShowResponse
56
     */
57
    public function show(string $domain, string $address)
58
    {
59
        Assert::stringNotEmpty($domain);
60
        Assert::stringNotEmpty($address);
61
62
        $response = $this->httpGet(sprintf('/v3/%s/bounces/%s', $domain, $address));
63
64
        return $this->hydrateResponse($response, ShowResponse::class);
65
    }
66
67
    /**
68
     * @param string $domain  Domain to create a bounce for

src/Api/Suppression/Complaint.php 1 location

@@ 57-64 (lines=8) @@
54
     *
55
     * @return ShowResponse
56
     */
57
    public function show(string $domain, string $address)
58
    {
59
        Assert::stringNotEmpty($domain);
60
        Assert::stringNotEmpty($address);
61
        $response = $this->httpGet(sprintf('/v3/%s/complaints/%s', $domain, $address));
62
63
        return $this->hydrateResponse($response, ShowResponse::class);
64
    }
65
66
    /**
67
     * @param string $domain    Domain to create complaint for

src/Api/Suppression/Unsubscribe.php 1 location

@@ 57-65 (lines=9) @@
54
     *
55
     * @return ShowResponse
56
     */
57
    public function show(string $domain, string $address)
58
    {
59
        Assert::stringNotEmpty($domain);
60
        Assert::stringNotEmpty($address);
61
62
        $response = $this->httpGet(sprintf('/v3/%s/unsubscribes/%s', $domain, $address));
63
64
        return $this->hydrateResponse($response, ShowResponse::class);
65
    }
66
67
    /**
68
     * @param string $domain  Domain to create unsubscribe for

src/Api/Suppression/Whitelist.php 1 location

@@ 60-68 (lines=9) @@
57
     *
58
     * @return ShowResponse
59
     */
60
    public function show(string $domain, string $address)
61
    {
62
        Assert::stringNotEmpty($domain);
63
        Assert::stringNotEmpty($address);
64
65
        $response = $this->httpGet(sprintf('/v3/%s/whitelists/%s', $domain, $address));
66
67
        return $this->hydrateResponse($response, ShowResponse::class);
68
    }
69
70
    /**
71
     * @param string $domain  Domain to create whitelist for

src/Api/Tag.php 4 locations

@@ 59-67 (lines=9) @@
56
     *
57
     * @return ShowResponse|ResponseInterface
58
     */
59
    public function show(string $domain, string $tag)
60
    {
61
        Assert::stringNotEmpty($domain);
62
        Assert::stringNotEmpty($tag);
63
64
        $response = $this->httpGet(sprintf('/v3/%s/tags/%s', $domain, $tag));
65
66
        return $this->hydrateResponse($response, ShowResponse::class);
67
    }
68
69
    /**
70
     * Update a tag.
@@ 121-129 (lines=9) @@
118
    /**
119
     * @return CountryResponse|ResponseInterface
120
     */
121
    public function countries(string $domain, string $tag)
122
    {
123
        Assert::stringNotEmpty($domain);
124
        Assert::stringNotEmpty($tag);
125
126
        $response = $this->httpGet(sprintf('/v3/%s/tags/%s/stats/aggregates/countries', $domain, $tag));
127
128
        return $this->hydrateResponse($response, CountryResponse::class);
129
    }
130
131
    /**
132
     * @return ProviderResponse|ResponseInterface
@@ 134-142 (lines=9) @@
131
    /**
132
     * @return ProviderResponse|ResponseInterface
133
     */
134
    public function providers(string $domain, string $tag)
135
    {
136
        Assert::stringNotEmpty($domain);
137
        Assert::stringNotEmpty($tag);
138
139
        $response = $this->httpGet(sprintf('/v3/%s/tags/%s/stats/aggregates/providers', $domain, $tag));
140
141
        return $this->hydrateResponse($response, ProviderResponse::class);
142
    }
143
144
    /**
145
     * @return DeviceResponse|ResponseInterface
@@ 147-155 (lines=9) @@
144
    /**
145
     * @return DeviceResponse|ResponseInterface
146
     */
147
    public function devices(string $domain, string $tag)
148
    {
149
        Assert::stringNotEmpty($domain);
150
        Assert::stringNotEmpty($tag);
151
152
        $response = $this->httpGet(sprintf('/v3/%s/tags/%s/stats/aggregates/devices', $domain, $tag));
153
154
        return $this->hydrateResponse($response, DeviceResponse::class);
155
    }
156
}
157