Total Complexity | 11 |
Total Lines | 73 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
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 |
||
73 | } |
||
74 | |||
75 | public function getHeight(): int |
||
76 | { |
||
77 | return $this->height; |
||
78 | } |
||
79 | } |
||
80 |