Dimensions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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