Completed
Push — develop ( 35b748...409669 )
by Mikaël
02:12 queued 14s
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
0 ignored issues
show
Security Bug introduced by
It is not recommended to output anything before PHP's opening tag in non-template files.
Loading history...
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 5 and the first side effect is on line 1.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace WsdlToPhp\DomHandler;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Namespace declaration statement has to be the very first statement in the script
Loading history...
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