Skip to content

Commit f1b0644

Browse files
committed
Fixed some Scrutinizer issues.
1 parent 6e33561 commit f1b0644

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public function parse()
436436
// `LIMIT` keywords actually belong to the first statement.
437437
$lastStatement->order = $statement->order;
438438
$lastStatement->limit = $statement->limit;
439-
$statement->order = null;
439+
$statement->order = array();
440440
$statement->limit = null;
441441

442442
// The statement actually ends where the last statement in

src/Utils/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ public static function getClause($statement, $list, $clause, $type = 0, $skipFir
536536
// This is a cheap fix for `SELECT` statements that contain `UNION`.
537537
// Replacing the `ORDER BY` or `LIMIT` clauses should replace the last
538538
// clause.
539-
if (!empty($statement->union)) {
539+
if (($statement instanceof SelectStatement) && (!empty($statement->union))) {
540540
$clauses['ORDER BY'] = count($clauses) + 1;
541541
$clauses['LIMIT'] = count($clauses) + 2;
542542
}

0 commit comments

Comments
 (0)