Code Duplication    Length = 11-11 lines in 2 locations

src/QueryBuilder.php 2 locations

@@ 35-45 (lines=11) @@
32
     *
33
     * @throws \Exception
34
     */
35
    public function addToArrayNode(AbstractNode $node, $allowDefault = false)
36
    {
37
        if (!$this->node instanceof ArrayNode) {
38
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
39
        }
40
41
        $this->node->add($node, $allowDefault);
42
        $this->reassignParent($node);
43
44
        return $this;
45
    }
46
47
    /**
48
     * @param string       $key
@@ 56-66 (lines=11) @@
53
     *
54
     * @throws \Exception
55
     */
56
    public function addToObjectNode($key, AbstractNode $node, $allowDefault = false)
57
    {
58
        if (!$this->node instanceof ObjectNode) {
59
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
60
        }
61
62
        $this->node->add($key, $node, $allowDefault);
63
        $this->reassignParent($node);
64
65
        return $this;
66
    }
67
68
    /**
69
     * @param AbstractNode $node