StringNode::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\Jom;
4
5
final class StringNode extends Node
6
{
7
    private $value;
8
9 64
    public function __construct(?string $value = '', ?Document $ownerDocument = null)
10
    {
11 64
        parent::__construct($ownerDocument);
12
13 64
        $this->value = $value ?? '';
14
    }
15
16
    public function getValue(): string
17
    {
18
        return $this->value;
19
    }
20
21
    public function setValue(string $value): void
22
    {
23
        $this->value = $value;
24
    }
25
26
    public function jsonSerialize(): string
27
    {
28
        return $this->value;
29
    }
30
}
31