Total Complexity | 4 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 |
||
65 | } |
||
66 | } |
||
67 |