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

NameSpaceHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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