DOMElementWrapper::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace nstdio\svg\xml;
3
4
use DOMElement;
5
6
/**
7
 * Class DOMElementWrapper
8
 *
9
 * @package nstdio\svg\xml
10
 * @author  Edgar Asatryan <[email protected]>
11
 */
12
class DOMElementWrapper extends DOMNode
13
{
14
    /**
15
     * @var DOMElement
16
     */
17
    private $element;
18
19
    /**
20
     * DOMElementWrapper constructor.
21
     *
22
     * @param DOMElement $element
23
     */
24 150
    public function __construct(DOMElement $element)
25
    {
26 150
        $this->element = $element;
27 150
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32 150
    public function getElement()
33
    {
34 150
        return $this->element;
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 4
    public function setNodeValue($value)
41
    {
42 4
        $this->element->nodeValue = $value;
43 4
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 3
    public function getNodeValue()
49
    {
50 3
        return $this->element->nodeValue;
51
    }
52
}
53