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

DOMElementAsSoapHeaderElement   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
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
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 DOMElement;
7
use Raigu\XRoad\SoapEnvelope\Element\DOMElementInjection;
8
use Raigu\XRoad\SoapEnvelope\Element\XmlInjectable;
9
10
/**
11
 * I DOMElement of SOAP Header.
12
 *
13
 * I know how to inject myself into SOAP Header
14
 */
15
abstract class DOMElementAsSoapHeaderElement implements XmlInjectable
16
{
17
    /**
18
     * @var DOMElement
19
     */
20
    private $element;
21
22 2
    public function inject(DOMDocument $dom): void
23
    {
24 2
        $this->element->inject($dom);
0 ignored issues
show
Bug introduced by
The method inject() does not exist on DOMElement. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $this->element->/** @scrutinizer ignore-call */ 
25
                        inject($dom);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25 2
    }
26
27 2
    public function __construct(DOMElement $element)
28
    {
29 2
        $this->element = new DOMElementInjection(
0 ignored issues
show
Documentation Bug introduced by
It seems like new Raigu\XRoad\SoapEnve.../', 'Header', $element) of type Raigu\XRoad\SoapEnvelope...ent\DOMElementInjection is incompatible with the declared type DOMElement of property $element.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30 2
            'http://schemas.xmlsoap.org/soap/envelope/',
31 2
            'Header',
32
            $element
33
        );
34 2
    }
35
}
36