Passed
Branch master (7a0b0e)
by Randy
02:56
created

Address::setPlz()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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