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

TestRoot   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A appendTestPerson() 0 4 1
A getPersons() 0 4 1
A assemble() 0 9 2
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
}