Completed
Branch master (220ce5)
by De Cramer
16:11
created

Manialink::getChildren()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace eXpansion\Framework\Core\Model\Gui;
4
5
use eXpansion\Framework\Core\Model\Data\DataStorageTrait;
6
use eXpansion\Framework\Core\Model\UserGroups\Group;
7
use FML\Types\Renderable;
8
9
class Manialink implements ManialinkInterface
10
{
11
    use DataStorageTrait;
12
13
    /** @var string */
14
    protected $id;
15
16
    /** @var string */
17
    protected $name;
18
19
    /** @var  Group */
20
    protected $group;
21
22
    /** @var float */
23
    protected $sizeX;
24
25
    /** @var float */
26
    protected $sizeY;
27
28
    /** @var float */
29
    protected $posX;
30
31
    /** @var float */
32
    protected $posY;
33
34
    /**
35
     * Manialive constructor.
36
     * @param Group $group
37
     */
38 21
    public function __construct(
39
        Group $group,
40
        $name,
41
        $sizeX,
42
        $sizeY,
43
        $posX = null,
44
        $posY = null
45
    ) {
46 21
        $this->group = $group;
47 21
        $this->name = $name;
48 21
        $this->sizeX = $sizeX;
49 21
        $this->sizeY = $sizeY;
50 21
        $this->posX = $posX;
51 21
        $this->posY = $posY;
52 21
        $this->id = uniqid("ml_", true); // originally: $this->id = spl_object_hash($this)... change back if needed
53 21
    }
54
55
    /**
56
     *
57
     * @return string
58
     */
59 10
    public function getXml()
60
    {
61
        return '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'
62 10
            .'<manialink version="3" id="'.$this->getId().'">'
63 10
            .'<label text="Hello World!" />'
64 10
            .'</manialink>';
65
    }
66
67
    /**
68
     *
69
     * @return Group
70
     */
71 11
    public function getUserGroup()
72
    {
73 11
        return $this->group;
74
    }
75
76
    /**
77
     *
78
     * @return string
79
     */
80 16
    public function getId()
81
    {
82 16
        return $this->id;
83
    }
84
85
    /**
86
     * @inheritdoc
87
     */
88
    public function addChild(Renderable $child)
89
    {
90
    }
91
92
    /**
93
     * @inheritdoc
94
     */
95
    public function getChildren()
96
    {
97
    }
98
99
    public function removeChild(Renderable $child)
100
    {
101
102
    }
103
104
    /**
105
     * @inheritdoc
106
     */
107
    public function getContentFrame()
108
    {
109
    }
110
}
111