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

Phone::setValue()   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\Attribute\Attribute;
6
use Dgame\Soap\Element;
7
use Dgame\Soap\Hydrator\Dom\AssemblableInterface;
8
use Dgame\Soap\Hydrator\Hydratable;
9
10
/**
11
 * Class Phone
12
 * @package Dgame\Soap\Test\Object
13
 */
14
final class Phone extends Hydratable implements AssemblableInterface
15
{
16
    /**
17
     * @var string
18
     */
19
    private $name;
20
    /**
21
     * @var string
22
     */
23
    private $version;
24
25
    /**
26
     * @param string $name
27
     */
28
    public function setName(string $name)
29
    {
30
        $this->name = $name;
31
    }
32
33
    /**
34
     * @param string $value
35
     */
36
    public function setValue(string $value)
37
    {
38
        $this->version = $value;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getName(): string
45
    {
46
        return $this->name;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getValue(): string
53
    {
54
        return $this->version;
55
    }
56
57
    /**
58
     * @return Element
59
     */
60
    public function assemble(): Element
61
    {
62
        $element = new Element('phone', $this->version);
63
        $element->setAttribute(new Attribute('name', $this->name));
64
65
        return $element;
66
    }
67
}