HasWidthAndHeight::getHeight()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace LaraComponents\Seo\OpenGraph\Traits;
4
5
trait HasWidthAndHeight
6
{
7
    /**
8
     * @var int
9
     */
10
    protected $width;
11
12
    /**
13
     * @var int
14
     */
15
    protected $height;
16
17
    /**
18
     * [setWidth description]
19
     * @param int $width
20
     */
21
    public function setWidth($width)
22
    {
23
        $width = (int) $width;
24
        if ($width > 0) {
25
            $this->width = $width;
26
        }
27
28
        return $this;
29
    }
30
31
    /**
32
     * [getWidth description]
33
     * @return int
34
     */
35
    public function getWidth()
36
    {
37
        return $this->width;
38
    }
39
40
    /**
41
     * [setHeight description]
42
     * @param int $height
43
     */
44
    public function setHeight($height)
45
    {
46
        $height = (int) $height;
47
        if ($height > 0) {
48
            $this->height = $height;
49
        }
50
51
        return $this;
52
    }
53
54
    /**
55
     * [getHeight description]
56
     * @return int
57
     */
58
    public function getHeight()
59
    {
60
        return $this->height;
61
    }
62
}
63