Dimensions   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 60
ccs 10
cts 10
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A height() 0 3 1
A __construct() 0 3 1
A width() 0 3 1
A set() 0 5 1
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