Total Complexity | 6 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | class SetValue extends NodeGeneric |
||
15 | { |
||
16 | 3 | public function __construct(string $nodeString, int $line) |
|
24 | } |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Builds a set value. |
||
29 | * |
||
30 | * @param object $parent The parent (the document object or any previous object created through a mapping key) |
||
31 | */ |
||
32 | 1 | public function build(&$parent = null) |
|
33 | { |
||
34 | 1 | $prop = array_keys(get_object_vars((object) $parent)); |
|
35 | 1 | $key = end($prop); |
|
36 | 1 | $parent->{$key} = is_null($this->value) ? null : $this->value->build(); |
|
37 | 1 | return null; |
|
38 | } |
||
39 | |||
40 | 1 | public function isAwaitingChild(NodeGeneric $node): bool |
|
43 | } |
||
44 | } |
||
45 |