Cloud::getWords()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace SixtyNine\Cloud\Model;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use JMS\Serializer\Annotation as JMS;
7
8
class Cloud
9
{
10
    /**
11
     * @var string
12
     * @JMS\Type("string")
13
     */
14
    protected $backgroundColor;
15
16
    /**
17
     * @var int
18
     * @JMS\Type("integer")
19
     */
20
    protected $backgroundOpacity;
21
22
    /**
23
     * @var int
24
     * @JMS\Type("integer")
25
     */
26
    protected $width;
27
28
    /**
29
     * @var int
30
     * @JMS\Type("integer")
31
     */
32
    protected $height;
33
34
    /**
35
     * @var string
36
     * @JMS\Type("string")
37
     */
38
    protected $font;
39
40
    /**
41
     * @var ArrayCollection
42
     * @JMS\Type("ArrayCollection<SixtyNine\Cloud\Model\CloudWord>")
43
     */
44
    protected $words;
45
46 4
    public function __construct()
47
    {
48 4
        $this->words = new ArrayCollection();
49 4
    }
50
51
    /**
52
     * @param string $backgroundColor
53
     * @return Cloud
54
     */
55 4
    public function setBackgroundColor($backgroundColor)
56
    {
57 4
        $this->backgroundColor = $backgroundColor;
58 4
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 2
    public function getBackgroundColor()
65
    {
66 2
        return $this->backgroundColor;
67
    }
68
69
    /**
70
     * @param int $backgroundOpacity
71
     * @return Cloud
72
     */
73 4
    public function setBackgroundOpacity($backgroundOpacity)
74
    {
75 4
        $this->backgroundOpacity = $backgroundOpacity;
76 4
        return $this;
77
    }
78
79
    /**
80
     * @return int
81
     */
82 1
    public function getBackgroundOpacity()
83
    {
84 1
        return $this->backgroundOpacity;
85
    }
86
87
    /**
88
     * @param string $font
89
     * @return Cloud
90
     */
91 4
    public function setFont($font)
92
    {
93 4
        $this->font = $font;
94 4
        return $this;
95
    }
96
97
    /**
98
     * @return string
99
     */
100 5
    public function getFont()
101
    {
102 5
        return $this->font;
103
    }
104
105
    /**
106
     * @param CloudWord $word
107
     * @return Cloud
108
     */
109 3
    public function addWord(CloudWord $word)
110
    {
111 3
        if (!$this->words->contains($word)) {
112 3
            $this->words->add($word);
113
        }
114 3
        return $this;
115
    }
116
117
    /**
118
     * @param CloudWord $word
119
     * @return Cloud
120
     */
121
    public function removeWord(CloudWord $word)
122
    {
123
        $this->words->removeElement($word);
124
        return $this;
125
    }
126
127
    /**
128
     * @return ArrayCollection
129
     */
130 5
    public function getWords()
131
    {
132 5
        return $this->words;
133
    }
134
135
    /**
136
     * @param int $height
137
     * @return Cloud
138
     */
139 4
    public function setHeight($height)
140
    {
141 4
        $this->height = $height;
142 4
        return $this;
143
    }
144
145
    /**
146
     * @return int
147
     */
148 5
    public function getHeight()
149
    {
150 5
        return $this->height;
151
    }
152
153
    /**
154
     * @param int $width
155
     * @return Cloud
156
     */
157 4
    public function setWidth($width)
158
    {
159 4
        $this->width = $width;
160 4
        return $this;
161
    }
162
163
    /**
164
     * @return int
165
     */
166 5
    public function getWidth()
167
    {
168 5
        return $this->width;
169
    }
170
}
171
172