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

SoapHeaderElement   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
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