Passed
Branch reduce-soap-envelope-builder-c... (c98539)
by Rait
02:14
created

AggregatedElement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A inject() 0 4 2
A __construct() 0 3 1
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
use DOMDocument;
6
use Raigu\XRoad\SoapEnvelope\Element\XmlInjectable;
7
8
/**
9
 * I am an XML element aggregated from many elements
10
 */
11
abstract class AggregatedElement implements XmlInjectable
12
{
13
    /**
14
     * @var XmlInjectable[]
15
     */
16
    private $elements;
17
18 1
    public function inject(DOMDocument $dom): void
19
    {
20 1
        foreach ($this->elements as $element) {
21 1
            $element->inject($dom);
22
        }
23 1
    }
24
25 1
    public function __construct(XmlInjectable ...$elements)
26
    {
27 1
        $this->elements = $elements;
28 1
    }
29
}
30