diff options
author | Bruno Perel <brunoperel@gmail.com> | 2018-11-26 19:56:17 +0100 |
---|---|---|
committer | Bruno Perel <brunoperel@gmail.com> | 2018-11-26 20:08:52 +0100 |
commit | 513ed8175bdc0fc17a192ea29757cf8fee178c2a (patch) | |
tree | c87f72dcdc4d5f6f86e5da4d212e7be92cf9506c /src/Components/Condition.php | |
parent | 8e37bb398b9bf7449c6855f3e0639156cef35e7e (diff) | |
download | sql-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/Components/Condition.php')
-rw-r--r-- | src/Components/Condition.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Components/Condition.php b/src/Components/Condition.php index 99ab34c..4e12b3f 100644 --- a/src/Components/Condition.php +++ b/src/Components/Condition.php @@ -142,7 +142,7 @@ class Condition extends Component // Conditions are delimited by logical operators. if (in_array($token->value, static::$DELIMITERS, true)) { - if (($betweenBefore) && ($token->value === 'AND')) { + if ($betweenBefore && ($token->value === 'AND')) { // The syntax of keyword `BETWEEN` is hard-coded. $betweenBefore = false; } else { @@ -170,7 +170,7 @@ class Condition extends Component if ($token->value === 'BETWEEN') { $betweenBefore = true; } - if (($brackets === 0) && (empty(static::$ALLOWED_KEYWORDS[$token->value]))) { + if (($brackets === 0) && empty(static::$ALLOWED_KEYWORDS[$token->value])) { break; } } |