AbstractElement   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 73
rs 10
c 0
b 0
f 0
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getWidth() 0 3 1
A setHeight() 0 3 1
A getId() 0 3 1
A setWidth() 0 3 1
A __construct() 0 6 1
A getHeight() 0 3 1
A setY() 0 3 1
A getX() 0 3 1
A getY() 0 3 1
A setId() 0 3 1
A setX() 0 3 1
1
<?php
2
3
namespace EaselDrawing;
4
5
abstract class AbstractElement implements ElementInterface
6
{
7
    /** @var string */
8
    private $id = '';
9
10
    /** @var int x-axis position */
11
    private $x = 0;
12
13
    /** @var int x-axis position */
14
    private $y = 0;
15
16
    /** @var int width of the element */
17
    private $width;
18
19
    /** @var int height of the element */
20
    private $height;
21
22
    public function __construct(int $x, int $y, int $width, int $height)
23
    {
24
        $this->setX($x);
25
        $this->setY($y);
26
        $this->setWidth($width);
27
        $this->setHeight($height);
28
    }
29
30
    public function setId(string $id)
31
    {
32
        $this->id = $id;
33
    }
34
35
    public function setX(int $x)
36
    {
37
        $this->x = $x;
38
    }
39
40
    public function setY(int $y)
41
    {
42
        $this->y = $y;
43
    }
44
45
    public function setWidth(int $width)
46
    {
47
        $this->width = $width;
48
    }
49
50
    public function setHeight(int $height)
51
    {
52
        $this->height = $height;
53
    }
54
55
    public function getId(): string
56
    {
57
        return $this->id;
58
    }
59
60
    public function getX(): int
61
    {
62
        return $this->x;
63
    }
64
65
    public function getY(): int
66
    {
67
        return $this->y;
68
    }
69
70
    public function getWidth(): int
71
    {
72
        return $this->width;
73
    }
74
75
    public function getHeight(): int
76
    {
77
        return $this->height;
78
    }
79
}
80