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

StrAsBody::inject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Raigu\XRoad\SoapEnvelope;
4
5
use DOMDocument;
6
use Raigu\XRoad\SoapEnvelope\Element\FragmentInjection;
7
use Raigu\XRoad\SoapEnvelope\Element\XmlInjectable;
8
9
final class StrAsBody implements XmlInjectable
10
{
11
    /**
12
     * @var XmlInjectable
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 $serviceRequest)
22
    {
23 1
        $this->injection = new FragmentInjection(
24 1
            'http://schemas.xmlsoap.org/soap/envelope/',
25 1
            'Body',
26
            $serviceRequest
27
        );
28 1
    }
29
}
30