Code Duplication    Length = 12-12 lines in 2 locations

src/ApiDriver.php 2 locations

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