| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 2 | public function copyTree(): Node |
|
| 30 | { |
||
| 31 | 2 | $newThis = new static(); |
|
| 32 | |||
| 33 | /** @var Node $child */ |
||
| 34 | 2 | foreach ($this->getIterator() as $child) { |
|
| 35 | 1 | $newChild = $child->copyTree(); |
|
| 36 | 1 | $newChild->setParent($newThis); |
|
| 37 | 1 | $newThis->addChild($newChild); |
|
| 38 | } |
||
| 39 | |||
| 40 | 2 | return $newThis; |
|
| 41 | } |
||
| 59 |