| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function getArray(AbstractNode $node, $embedded = false) |
||
| 16 | { |
||
| 17 | if (!$node instanceof ObjectNode) { |
||
| 18 | throw new \InvalidArgumentException("Invalid node type!"); |
||
| 19 | } |
||
| 20 | |||
| 21 | $array = array(); |
||
| 22 | |||
| 23 | foreach ($node->getAttributes() as $attribute) { |
||
| 24 | $array[$attribute->getFormattedName()] =$this->getMainHandler()->getArray($attribute, true); |
||
| 25 | } |
||
| 26 | |||
| 27 | foreach ($node->getNodes() as $name => $childNode) { |
||
| 28 | $array[$name] = $this->getMainHandler()->getArray($childNode, true); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $array; |
||
| 32 | } |
||
| 33 | |||
| 43 |