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

NodeDocStart::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 7
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 NodeDocStart extends Node
12
{
13
    public function __construct(string $nodeString, int $line)
14
    {
15
        parent::__construct($nodeString, $line);
16
        $rest = trim(substr($nodeString, 3));
17
        if (!empty($rest)) {
18
            // $n->indent = $indent + 4;
19
            $this->add(NodeFactory::get($rest, $line));
20
        }
21
    }
22
23
    // public function build(&$parent = NULL)
24
    // {
25
        // if (is_scalar($child->value)) {
26
        //     $parent->setText(Node2PHP::get($child));
27
        // } elseif ($child->value instanceof NodeTag){
28
        //     $parent->addTag($child->value->identifier);
29
        // } else {
30
        //     $parent->setText(self::build($child->value));
31
        // }
32
    // }
33
}