Passed
Branch reduce-soap-envelope-builder-c... (f028c1)
by Rait
07:42
created

StrAsIssue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A inject() 0 3 1
A __construct() 0 9 1
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
use DOMDocument;
6
use Raigu\XRoad\SoapEnvelope\Element\DOMElementInjection;
7
use Raigu\XRoad\SoapEnvelope\Element\XmlInjectable;
8
9
final class StrAsIssue implements XmlInjectable
10
{
11
    /**
12
     * @var DOMElementInjection
13
     */
14
    private $injection;
15
16 1
    public function inject(DOMDocument $dom): void
17
    {
18 1
        $this->injection->inject($dom);
19 1
    }
20
21 1
    public function __construct(string $issue)
22
    {
23 1
        $this->injection = new DOMElementInjection(
24 1
            'http://schemas.xmlsoap.org/soap/envelope/',
25 1
            'Header',
26 1
            new \DOMElement(
27 1
                'issue',
28
                $issue,
29 1
                'http://x-road.eu/xsd/xroad.xsd'
30
            )
31
        );
32 1
    }
33
}
34