Code Duplication    Length = 12-12 lines in 2 locations

src/Newsletter.php 2 locations

@@ 161-172 (lines=12) @@
158
        return $this->mailChimp->get("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags");
159
    }
160
161
    public function addTags(array $tags, string $email, string $listName = '')
162
    {
163
        $list = $this->lists->findByName($listName);
164
165
        $payload = collect($tags)->map(function ($tag) {
166
            return ['name' => $tag, 'status' => 'active'];
167
        })->toArray();
168
169
        return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [
170
            'tags' => $payload,
171
        ]);
172
    }
173
174
    public function removeTags(array $tags, string $email, string $listName = '')
175
    {
@@ 174-185 (lines=12) @@
171
        ]);
172
    }
173
174
    public function removeTags(array $tags, string $email, string $listName = '')
175
    {
176
        $list = $this->lists->findByName($listName);
177
178
        $payload = collect($tags)->map(function ($tag) {
179
            return ['name' => $tag, 'status' => 'inactive'];
180
        })->toArray();
181
182
        return $this->mailChimp->post("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}/tags", [
183
            'tags' => $payload,
184
        ]);
185
    }
186
187
    public function createCampaign(
188
        string $fromName,