| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 8 | ||
| Bugs | 2 | Features | 2 |
| 1 | <?php |
||
| 13 | 5 | public function add($name, AbstractNode $node, $allowDefault = false) |
|
| 14 | { |
||
| 15 | 5 | if (isset($this->children[$name])) { |
|
| 16 | 1 | throw new \InvalidArgumentException(sprintf('There is already a node with name %s!', $name)); |
|
| 17 | } |
||
| 18 | |||
| 19 | 5 | $node->setParent($this); |
|
| 20 | |||
| 21 | 5 | $this->children[$name] = $node; |
|
| 22 | 5 | $this->allowDefault[$name] = $allowDefault; |
|
| 23 | |||
| 24 | 5 | return $this; |
|
| 25 | } |
||
| 26 | |||
| 66 |