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

Dimensions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 60
ccs 0
cts 10
cp 0
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
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