Code Duplication    Length = 12-12 lines in 2 locations

src/Node/ArrayNode.php 1 location

@@ 21-32 (lines=12) @@
18
        return $node;
19
    }
20
21
    public function __clone()
22
    {
23
        parent::__clone();
24
25
        $children = $this->children;
26
27
        $this->children = [];
28
29
        foreach ($children as $node) {
30
            $this->add(clone $node);
31
        }
32
    }
33
34
    /**
35
     * @param AbstractNode $node

src/Node/ObjectNode.php 1 location

@@ 21-32 (lines=12) @@
18
        return $node;
19
    }
20
21
    public function __clone()
22
    {
23
        parent::__clone();
24
25
        $children = $this->children;
26
27
        $this->children = [];
28
29
        foreach ($children as $key => $node) {
30
            $this->add($key, clone $node);
31
        }
32
    }
33
34
    /**
35
     * @param string       $key