Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
62 | 14 | public function add(Expr $expr) |
|
63 | { |
||
64 | 14 | $node = $expr->getNode(); |
|
65 | 14 | if ($this->node instanceof ArrayNode) { |
|
66 | 1 | $this->node->add($node, $expr->isAllowDefault()); |
|
67 | 14 | } elseif ($this->node instanceof ObjectNode) { |
|
68 | 14 | $this->node->add($expr->getKey(), $node, $expr->isAllowDefault()); |
|
69 | 14 | } else { |
|
70 | 1 | throw new \InvalidArgumentException(sprintf('Node does not support a child!')); |
|
71 | } |
||
72 | |||
73 | 14 | $this->node = $node; |
|
74 | |||
75 | 14 | return $this; |
|
76 | } |
||
77 | |||
96 |