Completed
Push — master ( 7c119a...543e78 )
by Pierre
06:35 queued 03:38
created

Dimensions::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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