Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
19 | final class SimpleArray implements ImporterInterface |
||
20 | { |
||
21 | 1 | public function import($data): NodeInterface |
|
22 | { |
||
23 | 1 | return $this->parseNode(new AttributeNode(['label' => 'root']), $data); |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Create a node. |
||
28 | * |
||
29 | * @param mixed $data |
||
30 | * The arguments |
||
31 | * |
||
32 | * @return AttributeNodeInterface |
||
33 | * The node |
||
34 | */ |
||
35 | 1 | private function createNode($data): AttributeNodeInterface |
|
36 | { |
||
37 | 1 | return new AttributeNode([ |
|
38 | 1 | 'data' => $data, |
|
39 | ]); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param array ...$nodes |
||
44 | */ |
||
45 | 1 | private function parseNode(AttributeNodeInterface $parent, array ...$nodes): NodeInterface |
|
61 | ); |
||
62 | } |
||
63 | } |
||
64 |