Completed
Push — master ( c45521...844759 )
by stéphane
08:22
created

NodeQuoted::getValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Dallgoot\Yaml;
4
5
/**
6
 *
7
 * @author  Stéphane Rebai <[email protected]>
8
 * @license Apache 2.0
9
 * @link    TODO : url to specific online doc
10
 */
11
class NodeQuoted extends Node
12
{
13
    public function __construct(string $nodeValue, $line)
14
    {
15
        $this->line  = $line;
16
        $this->value = trim($nodeValue);
17
    }
18
19
    public function getValue(&$parent = null)
20
    {
21
        return is_null($this->value) ? null : substr(trim((string) $this->value), 1, -1);
22
    }
23
}