Completed
Push — develop ( 6eec50...8b93b9 )
by Mikaël
03:30
created

DomDocumentHandler::getRootElement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace WsdlToPhp\DomHandler;
4
5
use WsdlToPhp\DomHandler\AbstractDomDocumentHandler;
6
7
class DomDocumentHandler extends AbstractDomDocumentHandler
8
{
9
    /**
10
     * @param \DOMNode $node
11
     * @param \WsdlToPhp\DomHandler\AbstractDomDocumentHandler $domDocument
12
     * @param int $index
13
     * @return NodeHandler
14
     * @see \WsdlToPhp\DomHandler\AbstractDomDocumentHandler::getNodeHandler()
15
     */
16 88
    protected function getNodeHandler(\DOMNode $node, AbstractDomDocumentHandler $domDocument, $index = -1)
17
    {
18 88
        return new NodeHandler($node, $domDocument, $index);
19
    }
20
    /**
21
     * @param \DOMElement $element
22
     * @param \WsdlToPhp\DomHandler\AbstractDomDocumentHandler $domDocument
23
     * @param int $index
24
     * @return ElementHandler
25
     * @see \WsdlToPhp\DomHandler\AbstractDomDocumentHandler::getNodeHandler()
26
     */
27 148
    protected function getElementHandler(\DOMElement $element, AbstractDomDocumentHandler $domDocument, $index = -1)
28
    {
29 148
        return new ElementHandler($element, $domDocument, $index);
30
    }
31
    /**
32
     * @param \DOMAttr $attribute
33
     * @param \WsdlToPhp\DomHandler\AbstractDomDocumentHandler $domDocument
34
     * @param int $index
35
     * @return AttributeHandler
36
     * @see \WsdlToPhp\DomHandler\AbstractDomDocumentHandler::getAttributeHandler()
37
     */
38 92
    protected function getAttributeHandler(\DOMAttr $attribute, AbstractDomDocumentHandler $domDocument, $index = -1)
39
    {
40 92
        return new AttributeHandler($attribute, $domDocument, $index);
41
    }
42
    /**
43
     * @return ElementHandler
44
     */
45 28
    public function getRootElement()
46
    {
47 28
        return $this->rootElement;
48
    }
49
}
50