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