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

NodeDocStart   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
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
}