MailChimpResponse::addList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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