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

Address   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 55
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setStreet() 0 4 1
A setPlz() 0 4 1
A getStreet() 0 4 1
A getPlz() 0 4 1
A assemble() 0 8 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
}