Code Duplication    Length = 11-11 lines in 2 locations

src/QueryBuilder.php 2 locations

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