Code Duplication    Length = 11-11 lines in 2 locations

src/QueryBuilder.php 2 locations

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