Code Duplication    Length = 11-11 lines in 2 locations

src/QueryBuilder.php 2 locations

@@ 55-65 (lines=11) @@
52
     *
53
     * @throws \Exception
54
     */
55
    public function addToArrayNode(AbstractNode $node): QueryBuilderInterface
56
    {
57
        if (!$this->node instanceof ArrayNode) {
58
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
59
        }
60
61
        $this->node->add($node);
62
        $this->reassignParent($node);
63
64
        return $this;
65
    }
66
67
    /**
68
     * @param string       $key
@@ 75-85 (lines=11) @@
72
     *
73
     * @throws \Exception
74
     */
75
    public function addToObjectNode(string $key, AbstractNode $node): QueryBuilderInterface
76
    {
77
        if (!$this->node instanceof ObjectNode) {
78
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
79
        }
80
81
        $this->node->add($key, $node);
82
        $this->reassignParent($node);
83
84
        return $this;
85
    }
86
87
    /**
88
     * @param AbstractNode $node