Code Duplication    Length = 6-8 lines in 2 locations

src/SQLQueryBuilder.php 2 locations

@@ 172-179 (lines=8) @@
169
    protected function buildQueryForAnd($queryBuilder, $key, $value)
170
    {
171
        $sqlOptions = self::buildFilter([$key => $value]);
172
        if (in_array($sqlOptions['method'], ['in', 'notIn'], true)) {
173
            $queryBuilder->andWhere(
174
                $queryBuilder->expr()->{$sqlOptions['method']}(
175
                    $this->collection . '.' . $sqlOptions['key'], $sqlOptions['value']
176
                )
177
            );
178
            return $queryBuilder;
179
        }
180
        $queryBuilder->andWhere(
181
            '`' . $this->collection . '`.`' . $sqlOptions['key'].'`'
182
            . ' ' . $sqlOptions['operand']
@@ 194-199 (lines=6) @@
191
            $subKey = array_keys($orValue)[0];
192
            $subValue = $orValue[$subKey];
193
            $sqlOptions = self::buildFilter([$subKey => $subValue]);
194
            if (in_array($sqlOptions['method'], ['in', 'notIn'], true)) {
195
                $orQuery[] =  $queryBuilder->expr()->{$sqlOptions['method']}(
196
                    $this->collection . '.' . $sqlOptions['key'], $sqlOptions['value']
197
                );
198
                continue;
199
            }
200
            $orQuery[] =
201
                '`' . $this->collection . '`.`' . $sqlOptions['key'].'`'
202
                . ' ' . $sqlOptions['operand']