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

StrAsBody   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

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