Passed
Branch develop (cd7fef)
by Mikaël
01:30
created

DomDocumentHandler   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 20
ccs 0
cts 8
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeHandler() 0 3 1
A getAttributeHandler() 0 3 1
A getElementHandler() 0 3 1
A getRootElement() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WsdlToPhp\DomHandler;
6
7
use DOMAttr;
8
use DOMElement;
9
use DOMNode;
10
11
class DomDocumentHandler extends AbstractDomDocumentHandler
12
{
13
    public function getRootElement(): ?ElementHandler
14
    {
15
        return $this->rootElement;
16
    }
17
18
    protected function getNodeHandler(DOMNode $node, AbstractDomDocumentHandler $domDocument, int $index = -1): NodeHandler
19
    {
20
        return new NodeHandler($node, $domDocument, $index);
21
    }
22
23
    protected function getElementHandler(DOMElement $element, AbstractDomDocumentHandler $domDocument, int $index = -1): ElementHandler
24
    {
25
        return new ElementHandler($element, $domDocument, $index);
26
    }
27
28
    protected function getAttributeHandler(DOMAttr $attribute, AbstractDomDocumentHandler $domDocument, int $index = -1): AttributeHandler
29
    {
30
        return new AttributeHandler($attribute, $domDocument, $index);
31
    }
32
}
33