BoxDimension::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
namespace Soluble\Media;
3
4
class BoxDimension
5
{
6
    /**
7
     *
8
     * @var integer
9
     */
10
    protected $width;
11
    /**
12
     *
13
     * @var integer
14
     */
15
    protected $height;
16
17
    /**
18
     *
19
     * @param int $width
20
     * @param int $height
21
     */
22 4
    public function __construct($width = null, $height = null)
23
    {
24 4
        $this->setWidth($width);
25 4
        $this->setHeight($height);
26 4
    }
27
28
29
    /**
30
     *
31
     * @param int $width
32
     * @return \Soluble\Media\BoxDimension
33
     */
34 4
    public function setWidth($width)
35
    {
36 4
        $this->width = $width;
37 4
        return $this;
38
    }
39
40
    /**
41
     *
42
     * @return int
43
     */
44 1
    public function getWidth()
45
    {
46 1
        return $this->width;
47
    }
48
49
    /**
50
     *
51
     * @param int $height
52
     * @return \Soluble\Media\BoxDimension
53
     */
54 4
    public function setHeight($height)
55
    {
56 4
        $this->height = $height;
57 4
        return $this;
58
    }
59
60
    /**
61
     *
62
     * @return int
63
     */
64 1
    public function getHeight()
65
    {
66 1
        return $this->height;
67
    }
68
}
69