MailChimpResponse   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 57
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getLists() 0 3 1
A removeWebhook() 0 5 1
A __construct() 0 4 1
A addWebhook() 0 5 1
A removeList() 0 5 1
A addList() 0 5 1
A getWebhooks() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlexCk\MailchimpBundle\Model\MailChimp;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\Common\Collections\Collection;
9
10
class MailChimpResponse
11
{
12
    /**
13
     * @var ArrayCollection<ListItem>
14
     */
15
    private $lists;
16
17
    /**
18
     * @var ArrayCollection<MailChimpWebHook>
19
     */
20
    private $webhooks;
21
22
    /**
23
     * MailChimpResponse constructor.
24
     */
25
    public function __construct()
26
    {
27
        $this->lists = new ArrayCollection();
28
        $this->webhooks = new ArrayCollection();
29
    }
30
31
    public function getLists(): Collection
32
    {
33
        return $this->lists;
34
    }
35
36
    public function addList(ListItem $list): MailChimpResponse
37
    {
38
        $this->getLists()->add($list);
39
40
        return $this;
41
    }
42
43
    public function removeList(ListItem $list): MailChimpResponse
44
    {
45
        $this->getLists()->removeElement($list);
46
47
        return $this;
48
    }
49
50
    public function getWebhooks(): Collection
51
    {
52
        return $this->webhooks;
53
    }
54
55
    public function addWebhook(MailChimpWebHook $webhook): MailChimpResponse
56
    {
57
        $this->webhooks->add($webhook);
58
59
        return $this;
60
    }
61
62
    public function removeWebhook(MailChimpWebHook $webhook): MailChimpResponse
63
    {
64
        $this->webhooks->removeElement($webhook);
65
66
        return $this;
67
    }
68
}
69