UserId   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 3
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
use Raigu\XRoad\SoapEnvelope\Element\AbstractElement;
6
7
/**
8
 * I am an user id of the person who initiates the X-Road request.
9
 *
10
 * I can inject myself into SOAP envelope header
11
 */
12
final class UserId extends AbstractElement
13
{
14
    /**
15
     * @param string $userId the user who is making the request
16
     *                   Format: {iso2LetterCountryCode}{personCode}
17
     *                   Example: EE0000000000
18
     */
19
    public function __construct(string $userId)
20
    {
21
        parent::__construct(
22
            new SoapHeaderElement(
23
                'userId',
24
                (new ValidatedUserId($userId))->asStr()
25
            )
26
        );
27
    }
28
}
29