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

Id   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
/**
6
 * I am a X-Request id.
7
 *
8
 * I can inject myself into SOAP envelope header
9
 */
10
final class Id extends DOMElementAsSoapHeaderElement
11
{
12
    /**
13
     * @param string $id Unique identifier of X-Road message.
14
     *             According to the specification recommended
15
     *             form of message id is UUID.
16
     * @see https://www.x-tee.ee/docs/live/xroad/pr-mess_x-road_message_protocol.html#22-message-headers
17
     */
18 2
    public function __construct(string $id)
19
    {
20 2
        parent::__construct(
21 2
            new \DOMElement(
22 2
                'id',
23
                $id,
24 2
                'http://x-road.eu/xsd/xroad.xsd'
25
            )
26
        );
27 2
    }
28
}
29