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

DomDocumentHandler   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 4
dl 0
loc 43
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeHandler() 0 4 1
A getElementHandler() 0 4 1
A getAttributeHandler() 0 4 1
A getRootElement() 0 4 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