Code Duplication    Length = 7-8 lines in 2 locations

src/Search.php 2 locations

@@ 179-185 (lines=7) @@
176
     *
177
     * @return $this
178
     */
179
    public function addQuery(BuilderInterface $query, $boolType = BoolQuery::MUST, $key = null)
180
    {
181
        $endpoint = $this->getEndpoint(QueryEndpoint::NAME);
182
        $endpoint->addToBool($query, $boolType, $key);
183
184
        return $this;
185
    }
186
187
    /**
188
     * Returns queries inside BoolQuery instance.
@@ 225-232 (lines=8) @@
222
     *
223
     * @return $this
224
     */
225
    public function addFilter(BuilderInterface $filter, $boolType = BoolQuery::MUST, $key = null)
226
    {
227
        // Trigger creation of QueryEndpoint as filters depends on it
228
        $this->getEndpoint(QueryEndpoint::NAME);
229
230
        $endpoint = $this->getEndpoint(FilterEndpoint::NAME);
231
        $endpoint->addToBool($filter, $boolType, $key);
232
233
        return $this;
234
    }
235