Code Duplication    Length = 14-14 lines in 2 locations

src/Newsletter.php 2 locations

@@ 45-58 (lines=14) @@
42
        return $this->subscribe($email, $mergeFields, $listName, $options);
43
    }
44
45
    public function subscribeOrUpdate(string $email, array $mergeFields = [], string $listName = '', array $options = [])
46
    {
47
        $list = $this->lists->findByName($listName);
48
49
        $options = $this->getSubscriptionOptions($email, $mergeFields, $options);
50
51
        $response = $this->mailChimp->put("lists/{$list->getId()}/members/{$this->getSubscriberHash($email)}", $options);
52
53
        if (! $this->lastActionSucceeded()) {
54
            return false;
55
        }
56
57
        return $response;
58
    }
59
60
    public function getMembers(string $listName = '', array $parameters = [])
61
    {
@@ 23-36 (lines=14) @@
20
        $this->lists = $lists;
21
    }
22
23
    public function subscribe(string $email, array $mergeFields = [], string $listName = '', array $options = [])
24
    {
25
        $list = $this->lists->findByName($listName);
26
27
        $options = $this->getSubscriptionOptions($email, $mergeFields, $options);
28
29
        $response = $this->mailChimp->post("lists/{$list->getId()}/members", $options);
30
31
        if (! $this->lastActionSucceeded()) {
32
            return false;
33
        }
34
35
        return $response;
36
    }
37
38
    public function subscribePending(string $email, array $mergeFields = [], string $listName = '', array $options = [])
39
    {