Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
31 | 1 | public function build(&$parent = null): ?Compact |
|
32 | { |
||
33 | 1 | if (is_null($this->value)) { |
|
34 | 1 | return null; |
|
35 | } |
||
36 | 1 | if ($this->value instanceof NodeGeneric) { |
|
37 | 1 | $this->value = new NodeList($this->value); |
|
38 | 1 | $this->value->type = NodeList::MAPPING; |
|
39 | } |
||
40 | 1 | $obj = (object) $this->value->build(); |
|
41 | 1 | return new Compact($obj); |
|
42 | } |
||
44 |