Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function addNode(AbstractElement $node) |
||
12 | { |
||
13 | if (in_array($node, $this->nodes, true)) { |
||
14 | throw new \InvalidArgumentException("You can't add the same node twice!"); |
||
15 | } |
||
16 | |||
17 | $this->checkNode($node); |
||
18 | $this->removeNodeFromParent($node); |
||
19 | Document::setProperty($node, 'parent', $this); |
||
20 | $this->nodes[] = $node; |
||
21 | } |
||
22 | |||
36 |