Completed
Push — develop ( 409669...a37748 )
by Mikaël
03:18
created

NameSpaceHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValueNamespace() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
namespace WsdlToPhp\DomHandler;
4
5
class NameSpaceHandler extends AttributeHandler
6
{
7
    /**
8
     * @var \DOMNameSpaceNode
9
     */
10
    protected $nodeNameSpace;
11
    /**
12
     * @param \DOMNameSpaceNode $nameSpaceNode
13
     * @param AbstractDomDocumentHandler $domDocumentHandler
14
     * @param int $index
15
     */
16 18
    public function __construct(\DOMNameSpaceNode $nameSpaceNode, AbstractDomDocumentHandler $domDocumentHandler, $index = -1)
17
    {
18 18
        parent::__construct(new \DOMAttr($nameSpaceNode->nodeName, $nameSpaceNode->nodeValue), $domDocumentHandler, $index);
19 18
        $this->nodeNameSpace = $nameSpaceNode;
20 18
    }
21
    /**
22
     * value is always with [http|https]:// so we need to keep the full value
23
     * @param bool $withNamespace
24
     * @param bool $withinItsType
25
     * @param string $asType
26
     * @return mixed
27
     */
28 6
    public function getValue($withNamespace = false, $withinItsType = true, $asType = null)
29
    {
30 6
        return parent::getValue(true, $withinItsType, $asType);
31
    }
32
    /**
33
     * @return null|string
34
     */
35 6
    public function getValueNamespace()
36
    {
37 6
        return null;
38
    }
39
}
40