Code Duplication    Length = 12-12 lines in 2 locations

src/Newsletter.php 2 locations

@@ 190-201 (lines=12) @@
187
        return $this->mailChimp->get("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags");
188
    }
189
190
    public function addTags(array $tags, string $email, string $listName = '')
191
    {
192
        $list = $this->lists->findByName($listName);
193
194
        $payload = collect($tags)->mapWithKeys(function ($tag) {
195
            return [$tag => 'active'];
196
        })->toArray();
197
198
        return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [
199
            'tags' => $payload,
200
        ]);
201
    }
202
203
    public function removeTags(array $tags, string $email, string $listName = '')
204
    {
@@ 203-214 (lines=12) @@
200
        ]);
201
    }
202
203
    public function removeTags(array $tags, string $email, string $listName = '')
204
    {
205
        $list = $this->lists->findByName($listName);
206
207
        $payload = collect($tags)->mapWithKeys(function ($tag) {
208
            return [$tag => 'inactive'];
209
        })->toArray();
210
211
        return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [
212
            'tags' => $payload,
213
        ]);
214
    }
215
216
    public function createCampaign(
217
        string $fromName,