Completed
Pull Request — master (#302)
by Leny
10:15
created

StyleSMTrait   A

Complexity

Total Complexity 26

Size/Duplication

Total Lines 357
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 26
lcom 0
cbo 0
dl 0
loc 357
rs 10

26 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainerMarginSM() 0 4 1
A getContainerPaddingSM() 0 4 1
A getContainerWidthSM() 0 4 1
A getContainerHeightSM() 0 4 1
A getTextAlignSM() 0 4 1
A getContainerBackgroundSM() 0 4 1
A getContainerBackgroundTypeSM() 0 4 1
A getContainerBackgroundRepeatSM() 0 4 1
A getContainerBackgroundPositionSM() 0 4 1
A getContainerBackgroundSizeSM() 0 4 1
A getContainerBackgroundImageSM() 0 4 1
A getContainerBackgroundOverlaySM() 0 4 1
A setContainerMarginSM() 0 6 1
A setContainerPaddingSM() 0 6 1
A setContainerWidthSM() 0 6 1
A setContainerHeightSM() 0 6 1
A setTextAlignSM() 0 6 1
A setContainerBackgroundSM() 0 6 1
A setContainerBackgroundTypeSM() 0 6 1
A setContainerBackgroundRepeatSM() 0 6 1
A setContainerBackgroundPositionSM() 0 6 1
A setContainerBackgroundSizeSM() 0 6 1
A getContainerBackgroundColorSM() 0 4 1
A setContainerBackgroundColorSM() 0 6 1
A setContainerBackgroundImageSM() 0 6 1
A setContainerBackgroundOverlaySM() 0 6 1
1
<?php
2
3
namespace Victoire\Bundle\WidgetBundle\Entity\Traits\StyleTraits;
4
5
use Victoire\Bundle\MediaBundle\Entity\Media;
6
7
trait StyleSMTrait
8
{
9
    /**
10
     * @var string
11
     *
12
     * @ORM\Column(name="container_margin_sm", type="string", length=255, nullable=true)
13
     */
14
    protected $containerMarginSM;
15
16
    /**
17
     * @var string
18
     *
19
     * @ORM\Column(name="container_padding_sm", type="string", length=255, nullable=true)
20
     */
21
    protected $containerPaddingSM;
22
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="container_width_sm", type="string", length=255, nullable=true)
27
     */
28
    protected $containerWidthSM;
29
30
    /**
31
     * @var string
32
     *
33
     * @ORM\Column(name="container_height_sm", type="string", length=255, nullable=true)
34
     */
35
    protected $containerHeightSM;
36
37
    /**
38
     * @var string
39
     *
40
     * @ORM\Column(name="text_align_sm", type="string", length=15, nullable=true)
41
     */
42
    protected $textAlignSM;
43
44
    /**
45
     * @var string
46
     *
47
     * @deprecated
48
     * @ORM\Column(name="container_background_sm", type="string", length=255, nullable=true)
49
     */
50
    protected $containerBackgroundSM;
51
52
    /**
53
     * @var string
54
     *
55
     * @ORM\Column(name="container_background_type_sm", type="string", length=255, nullable=true)
56
     */
57
    protected $containerBackgroundTypeSM;
58
59
    /**
60
     * @var string
61
     *
62
     * @ORM\Column(name="container_background_repeat_sm", type="string", length=255, nullable=true)
63
     */
64
    protected $containerBackgroundRepeatSM;
65
66
    /**
67
     * @var string
68
     *
69
     * @ORM\Column(name="container_background_position_sm", type="string", length=255, nullable=true)
70
     */
71
    protected $containerBackgroundPositionSM;
72
73
    /**
74
     * @var string
75
     *
76
     * @ORM\Column(name="container_background_size_sm", type="string", length=255, nullable=true)
77
     */
78
    protected $containerBackgroundSizeSM;
79
80
    /**
81
     * @var string
82
     *
83
     * @ORM\Column(name="container_background_color_sm", type="string", length=255, nullable=true)
84
     */
85
    protected $containerBackgroundColorSM;
86
87
    /**
88
     * @var string
89
     *
90
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\MediaBundle\Entity\Media")
91
     * @ORM\JoinColumn(name="container_background_image_sm_id", referencedColumnName="id", onDelete="SET NULL", nullable=true)
92
     */
93
    protected $containerBackgroundImageSM;
94
95
    /**
96
     * @var string
97
     *
98
     * @ORM\Column(name="container_background_overlay_sm", type="string", length=255, nullable=true)
99
     */
100
    protected $containerBackgroundOverlaySM;
101
102
    /**
103
     * @return string
104
     */
105
    public function getContainerMarginSM()
106
    {
107
        return $this->containerMarginSM;
108
    }
109
110
    /**
111
     * @param string $containerMarginSM
112
     *
113
     * @return $this
114
     */
115
    public function setContainerMarginSM($containerMarginSM)
116
    {
117
        $this->containerMarginSM = $containerMarginSM;
118
119
        return $this;
120
    }
121
122
    /**
123
     * @return string
124
     */
125
    public function getContainerPaddingSM()
126
    {
127
        return $this->containerPaddingSM;
128
    }
129
130
    /**
131
     * @param string $containerPaddingSM
132
     *
133
     * @return $this
134
     */
135
    public function setContainerPaddingSM($containerPaddingSM)
136
    {
137
        $this->containerPaddingSM = $containerPaddingSM;
138
139
        return $this;
140
    }
141
142
    /**
143
     * @return string
144
     */
145
    public function getContainerWidthSM()
146
    {
147
        return $this->containerWidthSM;
148
    }
149
150
    /**
151
     * @param string $containerWidthSM
152
     *
153
     * @return $this
154
     */
155
    public function setContainerWidthSM($containerWidthSM)
156
    {
157
        $this->containerWidthSM = $containerWidthSM;
158
159
        return $this;
160
    }
161
162
    /**
163
     * @return string
164
     */
165
    public function getContainerHeightSM()
166
    {
167
        return $this->containerHeightSM;
168
    }
169
170
    /**
171
     * @param string $containerHeightSM
172
     *
173
     * @return $this
174
     */
175
    public function setContainerHeightSM($containerHeightSM)
176
    {
177
        $this->containerHeightSM = $containerHeightSM;
178
179
        return $this;
180
    }
181
182
    /**
183
     * @return string
184
     */
185
    public function getTextAlignSM()
186
    {
187
        return $this->textAlignSM;
188
    }
189
190
    /**
191
     * @param string $textAlignSM
192
     *
193
     * @return $this
194
     */
195
    public function setTextAlignSM($textAlignSM)
196
    {
197
        $this->textAlignSM = $textAlignSM;
198
199
        return $this;
200
    }
201
202
    /**
203
     * @return string
204
     */
205
    public function getContainerBackgroundSM()
206
    {
207
        return $this->containerBackgroundSM;
0 ignored issues
show
Deprecated Code introduced by
The property Victoire\Bundle\WidgetBu...:$containerBackgroundSM has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
208
    }
209
210
    /**
211
     * @param string $containerBackgroundSM
212
     *
213
     * @return $this
214
     */
215
    public function setContainerBackgroundSM($containerBackgroundSM)
216
    {
217
        $this->containerBackgroundSM = $containerBackgroundSM;
0 ignored issues
show
Deprecated Code introduced by
The property Victoire\Bundle\WidgetBu...:$containerBackgroundSM has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
218
219
        return $this;
220
    }
221
222
    /**
223
     * @return string
224
     */
225
    public function getContainerBackgroundTypeSM()
226
    {
227
        return $this->containerBackgroundTypeSM;
228
    }
229
230
    /**
231
     * @param string $containerBackgroundTypeSM
232
     *
233
     * @return $this
234
     */
235
    public function setContainerBackgroundTypeSM($containerBackgroundTypeSM)
236
    {
237
        $this->containerBackgroundTypeSM = $containerBackgroundTypeSM;
238
239
        return $this;
240
    }
241
242
    /**
243
     * @return string
244
     */
245
    public function getContainerBackgroundRepeatSM()
246
    {
247
        return $this->containerBackgroundRepeatSM;
248
    }
249
250
    /**
251
     * @param string $containerBackgroundRepeatSM
252
     *
253
     * @return $this
254
     */
255
    public function setContainerBackgroundRepeatSM($containerBackgroundRepeatSM)
256
    {
257
        $this->containerBackgroundRepeatSM = $containerBackgroundRepeatSM;
258
259
        return $this;
260
    }
261
262
    /**
263
     * @return string
264
     */
265
    public function getContainerBackgroundPositionSM()
266
    {
267
        return $this->containerBackgroundPositionSM;
268
    }
269
270
    /**
271
     * @param string $containerBackgroundPositionSM
272
     *
273
     * @return $this
274
     */
275
    public function setContainerBackgroundPositionSM($containerBackgroundPositionSM)
276
    {
277
        $this->containerBackgroundPositionSM = $containerBackgroundPositionSM;
278
279
        return $this;
280
    }
281
282
    /**
283
     * @return string
284
     */
285
    public function getContainerBackgroundSizeSM()
286
    {
287
        return $this->containerBackgroundSizeSM;
288
    }
289
290
    /**
291
     * @param string $containerBackgroundSizeSM
292
     *
293
     * @return $this
294
     */
295
    public function setContainerBackgroundSizeSM($containerBackgroundSizeSM)
296
    {
297
        $this->containerBackgroundSizeSM = $containerBackgroundSizeSM;
298
299
        return $this;
300
    }
301
302
    /**
303
     * @return string
304
     */
305
    public function getContainerBackgroundColorSM()
306
    {
307
        return $this->containerBackgroundColorSM;
308
    }
309
310
    /**
311
     * @param string $containerBackgroundColorSM
312
     *
313
     * @return $this
314
     */
315
    public function setContainerBackgroundColorSM($containerBackgroundColorSM)
316
    {
317
        $this->containerBackgroundColorSM = $containerBackgroundColorSM;
318
319
        return $this;
320
    }
321
322
    /**
323
     * @return string
324
     */
325
    public function getContainerBackgroundImageSM()
326
    {
327
        return $this->containerBackgroundImageSM;
328
    }
329
330
    /**
331
     * Set image.
332
     *
333
     * @param Media $image
334
     *
335
     * @return $this
336
     */
337
    public function setContainerBackgroundImageSM(Media $image = null)
338
    {
339
        $this->containerBackgroundImageSM = $image;
0 ignored issues
show
Documentation Bug introduced by
It seems like $image can also be of type object<Victoire\Bundle\MediaBundle\Entity\Media>. However, the property $containerBackgroundImageSM is declared as type string. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
340
341
        return $this;
342
    }
343
344
    /**
345
     * @return string
346
     */
347
    public function getContainerBackgroundOverlaySM()
348
    {
349
        return $this->containerBackgroundOverlaySM;
350
    }
351
352
    /**
353
     * @param string $containerBackgroundOverlaySM
354
     *
355
     * @return $this
356
     */
357
    public function setContainerBackgroundOverlaySM($containerBackgroundOverlaySM)
358
    {
359
        $this->containerBackgroundOverlaySM = $containerBackgroundOverlaySM;
360
361
        return $this;
362
    }
363
}
364