summaryrefslogtreecommitdiffstats
path: root/src/Statements/SelectStatement.php
diff options
context:
space:
mode:
authorBruno Perel <brunoperel@gmail.com>2018-11-26 19:56:17 +0100
committerBruno Perel <brunoperel@gmail.com>2018-11-26 20:08:52 +0100
commit513ed8175bdc0fc17a192ea29757cf8fee178c2a (patch)
treec87f72dcdc4d5f6f86e5da4d212e7be92cf9506c /src/Statements/SelectStatement.php
parent8e37bb398b9bf7449c6855f3e0639156cef35e7e (diff)
downloadsql-parser-513ed8175bdc0fc17a192ea29757cf8fee178c2a.zip
sql-parser-513ed8175bdc0fc17a192ea29757cf8fee178c2a.tar.gz
sql-parser-513ed8175bdc0fc17a192ea29757cf8fee178c2a.tar.bz2
Cleanup and improve readability:
Avoid duplicate if conditions Use switch/case instead of ifs when possible
Diffstat (limited to 'src/Statements/SelectStatement.php')
-rw-r--r--src/Statements/SelectStatement.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Statements/SelectStatement.php b/src/Statements/SelectStatement.php
index cd1d628..f2f94a8 100644
--- a/src/Statements/SelectStatement.php
+++ b/src/Statements/SelectStatement.php
@@ -226,8 +226,7 @@ class SelectStatement extends Statement
// statement.
if (!empty($this->union)) {
$clauses = static::$CLAUSES;
- unset($clauses['ORDER BY']);
- unset($clauses['LIMIT']);
+ unset($clauses['ORDER BY'], $clauses['LIMIT']);
$clauses['ORDER BY'] = array('ORDER BY', 3);
$clauses['LIMIT'] = array('LIMIT', 3);