Completed
Pull Request — master (#95)
by
unknown
02:28
created

abstractUiElement   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 51
rs 10
c 0
b 0
f 0
ccs 0
cts 22
cp 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setPosition() 0 9 1
A setX() 0 6 1
A setY() 0 6 1
A setZ() 0 6 1
render() 0 1 ?
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
    /**
15
     * @param int $posX
16
     * @param int $posY
17
     * @param int $posZ
18
     */
19
    public function setPosition($posX = 0, $posY = 0, $posZ = 0)
20
    {
21
        $this->posX = $posX;
22
        $this->posY = $posY;
23
        $this->posZ = $posZ;
24
25
        return $this;
26
27
    }
28
29
    public function setX($X)
30
    {
31
        $this->posX = $X;
32
33
        return $this;
34
    }
35
36
    public function setY($Y)
37
    {
38
        $this->posY = $Y;
39
40
        return $this;
41
    }
42
43
    public function setZ($Z)
44
    {
45
        $this->posZ = $Z;
46
47
        return $this;
48
    }
49
50
    /**
51
     * Render the XML element
52
     *
53
     * @param \DOMDocument $domDocument DOMDocument for which the XML element should be rendered
54
     * @return \DOMElement
55
     */
56
    abstract public function render(\DOMDocument $domDocument);
57
58
}
59