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

NameSpaceHandler::getValueNamespace()   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
class NameSpaceHandler extends AttributeHandler
6
{
7
    /**
8
     * @var \DOMNameSpaceNode
9
     */
10
    private $nodeNameSpace;
11
    /**
12
     * @param \DOMNameSpaceNode $nameSpaceNode
13
     * @param AbstractDomDocumentHandler $domDocumentHandler
14
     * @param int $index
15
     */
16 8
    public function __construct(\DOMNameSpaceNode $nameSpaceNode, AbstractDomDocumentHandler $domDocumentHandler, $index = -1)
17
    {
18 8
        parent::__construct(new \DOMAttr($nameSpaceNode->nodeName, $nameSpaceNode->nodeValue), $domDocumentHandler, $index);
2 ignored issues
show
Bug introduced by
The property nodeName does not seem to exist in DOMNameSpaceNode.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
Bug introduced by
The property nodeValue does not seem to exist in DOMNameSpaceNode.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
19 8
        $this->nodeNameSpace = $nameSpaceNode;
20 8
    }
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
    public function getValue($withNamespace = false, $withinItsType = true, $asType = null)
29
    {
30
        return parent::getValue(true, $withinItsType, $asType);
31
    }
32
    /**
33
     * @return null|string
34
     */
35 4
    public function getValueNamespace()
36
    {
37 4
        return null;
38
    }
39
}
40