OriginMock::removeFeed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TreeHouse\IoBundle\Test\Mock;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use TreeHouse\IoBundle\Entity\Feed;
8
use TreeHouse\IoBundle\Model\OriginInterface;
9
10
class OriginMock implements OriginInterface
11
{
12
    /**
13
     * @var int
14
     */
15
    protected $id;
16
17
    /**
18
     * @var string
19
     */
20
    protected $name;
21
22
    /**
23
     * @var string
24
     */
25
    protected $title;
26
27
    /**
28
     * @var int
29
     */
30
    protected $priority;
31
32
    /**
33
     * @var Collection|Feed[]
34
     */
35
    protected $feeds;
36
37
    /**
38
     * @param int $id
39
     */
40
    public function __construct($id)
41
    {
42
        $this->id = $id;
43
        $this->feeds = new ArrayCollection();
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function getId()
50
    {
51
        return $this->id;
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    public function setName($name)
58
    {
59
        $this->name = $name;
60
61
        return $this;
62
    }
63
64
    /**
65
     * @inheritdoc
66
     */
67
    public function getName()
68
    {
69
        return $this->name;
70
    }
71
72
    /**
73
     * @inheritdoc
74
     */
75
    public function setTitle($title)
76
    {
77
        $this->title = $title;
78
79
        return $this;
80
    }
81
82
    /**
83
     * @inheritdoc
84
     */
85
    public function getTitle()
86
    {
87
        return $this->title;
88
    }
89
90
    /**
91
     * @inheritdoc
92
     */
93
    public function setPriority($priority)
94
    {
95
        $this->priority = $priority;
96
97
        return $this;
98
    }
99
100
    /**
101
     * @inheritdoc
102
     */
103
    public function getPriority()
104
    {
105
        return $this->priority;
106
    }
107
108
    /**
109
     * @inheritdoc
110
     */
111
    public function addFeed(Feed $feeds)
112
    {
113
        $this->feeds[] = $feeds;
114
115
        return $this;
116
    }
117
118
    /**
119
     * @inheritdoc
120
     */
121
    public function removeFeed(Feed $feeds)
122
    {
123
        $this->feeds->removeElement($feeds);
124
    }
125
126
    /**
127
     * @inheritdoc
128
     */
129
    public function getFeeds()
130
    {
131
        return $this->feeds;
132
    }
133
}
134