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

NodeSequence   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 8 3
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 NodeSequence extends Node
12
{
13
    public function build(&$parent = null)
14
    {
15
        $out = $parent ?? [];
16
        $tmp = $this->value instanceof Node ? new NodeList($this->value) : $this->value;
17
        foreach ($tmp as $child) {
18
            $child->build($out);
19
        }
20
        return $out;
21
    }
22
}