Code Duplication    Length = 6-6 lines in 5 locations

src/SQLParser/Query/Select.php 5 locations

@@ 338-343 (lines=6) @@
335
            $sql .= NodeFactory::toSql($this->columns, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
336
        }
337
338
        if (!empty($this->from)) {
339
            $from = NodeFactory::toSql($this->from, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
340
            if ($from) {
341
                $sql .= "\nFROM ".$from;
342
            }
343
        }
344
345
        if (!empty($this->where)) {
346
            $where = NodeFactory::toSql($this->where, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
@@ 345-350 (lines=6) @@
342
            }
343
        }
344
345
        if (!empty($this->where)) {
346
            $where = NodeFactory::toSql($this->where, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
347
            if ($where) {
348
                $sql .= "\nWHERE ".$where;
349
            }
350
        }
351
352
        if (!empty($this->group)) {
353
            $groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
@@ 352-357 (lines=6) @@
349
            }
350
        }
351
352
        if (!empty($this->group)) {
353
            $groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
354
            if ($groupBy) {
355
                $sql .= "\nGROUP BY ".$groupBy;
356
            }
357
        }
358
359
        if (!empty($this->having)) {
360
            $having = NodeFactory::toSql($this->having, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
@@ 359-364 (lines=6) @@
356
            }
357
        }
358
359
        if (!empty($this->having)) {
360
            $having = NodeFactory::toSql($this->having, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
361
            if ($having) {
362
                $sql .= "\nHAVING ".$having;
363
            }
364
        }
365
366
        if (!empty($this->order)) {
367
            $order = NodeFactory::toSql($this->order, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
@@ 366-371 (lines=6) @@
363
            }
364
        }
365
366
        if (!empty($this->order)) {
367
            $order = NodeFactory::toSql($this->order, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
368
            if ($order) {
369
                $sql .= "\nORDER BY ".$order;
370
            }
371
        }
372
373
        if (!empty($this->offset) && empty($this->limit)) {
374
            throw new \Exception('There is no offset if no limit is provided. An error may have occurred during SQLParsing.');