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

TestRoot::getPersons()   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 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 TestRoot
11
 * @package Dgame\Soap\Test\Object
12
 */
13
final class TestRoot implements AssemblableInterface
14
{
15
    /**
16
     * @var TestPerson[]
17
     */
18
    private $persons = [];
19
20
    /**
21
     * @param TestPerson $person
22
     */
23
    public function appendTestPerson(TestPerson $person)
24
    {
25
        $this->persons[] = $person;
26
    }
27
28
    /**
29
     * @return TestPerson[]
30
     */
31
    public function getPersons(): array
32
    {
33
        return $this->persons;
34
    }
35
36
    /**
37
     * @return XmlElement
38
     */
39
    public function assemble(): XmlElement
40
    {
41
        $node = new XmlNode('soap-env');
42
        foreach ($this->persons as $person) {
43
            $node->appendElement($person->assemble());
44
        }
45
46
        return $node;
47
    }
48
}