Completed
Push — master ( fb3943...fbbc4e )
by Edgar
04:02
created

DOMElementWrapper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 4
c 5
b 0
f 1
lcom 0
cbo 1
dl 0
loc 41
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getElement() 0 4 1
A setNodeValue() 0 4 1
A getNodeValue() 0 4 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 149
    public function __construct(DOMElement $element)
25
    {
26 149
        $this->element = $element;
27 149
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32 149
    public function getElement()
33
    {
34 149
        return $this->element;
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 2
    public function setNodeValue($value)
41
    {
42 2
        $this->element->nodeValue = $value;
43 2
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 1
    public function getNodeValue()
49
    {
50 1
        return $this->element->nodeValue;
51
    }
52
}
53