Completed
Push — master ( baef0b...706633 )
by Randy
02:37
created

TestAddress::assemble()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Dgame\Soap\Test\Object;
4
5
use Dgame\Soap\Hydrator\Dom\AssemblableInterface;
6
use Dgame\Soap\XmlElement;
7
use Dgame\Soap\XmlNode;
8
9
/**
10
 * Class TestAddress
11
 * @package Dgame\Soap\Test\Object
12
 */
13
final class TestAddress implements AssemblableInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    private $street;
19
    /**
20
     * @var int
21
     */
22
    private $plz;
23
24
    /**
25
     * @param string $street
26
     */
27
    public function setStreet(string $street)
28
    {
29
        $this->street = $street;
30
    }
31
32
    /**
33
     * @param int $plz
34
     */
35
    public function setPlz(int $plz)
36
    {
37
        $this->plz = $plz;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getStreet(): string
44
    {
45
        return $this->street;
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getPlz(): int
52
    {
53
        return $this->plz;
54
    }
55
56
    /**
57
     * @return XmlElement
58
     */
59
    public function assemble(): XmlElement
60
    {
61
        $node = new XmlNode('address');
62
        $node->appendElement(new XmlElement('street', $this->street));
63
        $node->appendElement(new XmlElement('plz', $this->plz));
64
65
        return $node;
66
    }
67
}