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

DomDocumentHandler::getAttributeHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 3
crap 2
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