Completed
Pull Request — master (#95)
by
unknown
03:20
created

abstractUiElement::getWidth()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace eXpansion\Framework\Gui\Components;
4
5
use FML\Script\Features\ScriptFeature;
6
use FML\Types\Renderable;
7
8
abstract class abstractUiElement extends ScriptFeature implements Renderable
9
{
10
    protected $posX = 0;
11
    protected $posY = 0;
12
    protected $posZ = 0;
13
14
    protected $width;
15
    protected $height;
16
17
    /**
18
     * @param int $posX
19
     * @param int $posY
20
     * @param int $posZ
21
     */
22
    public function setPosition($posX = 0, $posY = 0, $posZ = 0)
23
    {
24
        $this->posX = $posX;
25
        $this->posY = $posY;
26
        $this->posZ = $posZ;
27
28
        return $this;
29
30
    }
31
32
    public function setX($X)
33
    {
34
        $this->posX = $X;
35
36
        return $this;
37
    }
38
39
    public function setY($Y)
40
    {
41
        $this->posY = $Y;
42
43
        return $this;
44
    }
45
46
    public function setZ($Z)
47
    {
48
        $this->posZ = $Z;
49
50
        return $this;
51
    }
52
53
    /**
54
     * Render the XML element
55
     *
56
     * @param \DOMDocument $domDocument DOMDocument for which the XML element should be rendered
57
     * @return \DOMElement
58
     */
59
    abstract public function render(\DOMDocument $domDocument);
60
61
    /**
62
     * @return int
63
     */
64
    public function getX()
65
    {
66
        return $this->posX;
67
    }
68
69
    /**
70
     * @return int
71
     */
72
    public function getY()
73
    {
74
        return $this->posY;
75
    }
76
77
    /**
78
     * @return int
79
     */
80
    public function getZ()
81
    {
82
        return $this->posZ;
83
    }
84
85
    /**
86
     * @return mixed
87
     */
88
    public function getWidth()
89
    {
90
        return $this->width;
91
    }
92
93
    /**
94
     * @param mixed $width
95
     */
96
    public function setWidth($width)
97
    {
98
        $this->width = $width;
99
100
        return $this;
101
    }
102
103
    /**
104
     * @param mixed $height
105
     * @return abstractUiElement
106
     */
107
    public function setHeight($height)
108
    {
109
        $this->height = $height;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @return mixed
116
     */
117
    public function getHeight()
118
    {
119
        return $this->height;
120
    }
121
122
    public function setSize($x, $y)
123
    {
124
        $this->width = $x;
125
        $this->height = $y;
126
    }
127
128
129
}
130