Code Duplication    Length = 11-11 lines in 2 locations

src/QueryBuilder.php 2 locations

@@ 62-72 (lines=11) @@
59
     *
60
     * @throws \Exception
61
     */
62
    public function addToArrayNode(AbstractNode $node): QueryBuilderInterface
63
    {
64
        if (!$this->node instanceof ArrayNode) {
65
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
66
        }
67
68
        $this->node->add($node);
69
        $this->reassignParent($node);
70
71
        return $this;
72
    }
73
74
    /**
75
     * @param string       $key
@@ 82-92 (lines=11) @@
79
     *
80
     * @throws \Exception
81
     */
82
    public function addToObjectNode(string $key, AbstractNode $node): QueryBuilderInterface
83
    {
84
        if (!$this->node instanceof ObjectNode) {
85
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
86
        }
87
88
        $this->node->add($key, $node);
89
        $this->reassignParent($node);
90
91
        return $this;
92
    }
93
94
    /**
95
     * @param AbstractNode $node