Passed
Branch master (b34e2b)
by Rait
01:39
created

SoapHeaderElement::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
use Raigu\XRoad\SoapEnvelope\Element\AbstractElement;
6
use Raigu\XRoad\SoapEnvelope\Element\DOMElementInjection;
7
8
/**
9
 * I am an X-Road Message SOAP header element
10
 *
11
 * I know how to inject myself into SOAP header with proper XML namespace.
12
 */
13
final class SoapHeaderElement extends AbstractElement
14
{
15
    public function __construct(string $tagName, string $tagValue)
16
    {
17
        parent::__construct(
18
            new DOMElementInjection(
19
                'http://schemas.xmlsoap.org/soap/envelope/',
20
                'Header',
21
                new \DOMElement(
22
                    $tagName,
23
                    $tagValue,
24
                    'http://x-road.eu/xsd/xroad.xsd'
25
                )
26
            )
27
        );
28
    }
29
}
30