Passed
Push — master ( ccee81...9f8f58 )
by Dominik
04:31
created

StringNode::serialize()   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
2
3
declare(strict_types=1);
4
5
namespace Saxulum\ElasticSearchQueryBuilder\Node;
6
7
final class StringNode extends AbstractNode
8
{
9
    /**
10
     * @var string|null
11
     */
12
    private $value;
13
14
    /**
15
     * @param string|null $value
16
     */
17 4
    public function __construct(string $value = null)
18
    {
19 4
        $this->value = $value;
20 4
    }
21
22 1
    public function getDefault()
23
    {
24 1
        return;
25
    }
26
27
    /**
28
     * @return string|null
29
     */
30 2
    public function serialize()
31
    {
32 2
        return $this->value;
33
    }
34
}
35