diff options
author | Deven Bansod <devenbansod@users.noreply.github.com> | 2018-12-09 15:51:22 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-09 15:51:22 +0530 |
commit | 5e8dbcf3ff0d1123efd731863083a9af539e5992 (patch) | |
tree | b60470ba4a628ee748310403dd71caad46101968 /src/Statements/LoadStatement.php | |
parent | ad6a0ce1efcde74726e28e9b3da9ffad3fc4c474 (diff) | |
parent | 4b3684f16ecb3539057cbba3141473c059141a45 (diff) | |
download | sql-parser-5e8dbcf3ff0d1123efd731863083a9af539e5992.zip sql-parser-5e8dbcf3ff0d1123efd731863083a9af539e5992.tar.gz sql-parser-5e8dbcf3ff0d1123efd731863083a9af539e5992.tar.bz2 |
Merge pull request #206 from bperel/cleanup
Cleanup the code
* Avoid duplicate if conditions
* Use switch/case instead of ifs when possible
* Use triple (in)equalities when type compatibility is ensured
Diffstat (limited to 'src/Statements/LoadStatement.php')
-rw-r--r-- | src/Statements/LoadStatement.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Statements/LoadStatement.php b/src/Statements/LoadStatement.php index 13b68e7..45ad05f 100644 --- a/src/Statements/LoadStatement.php +++ b/src/Statements/LoadStatement.php @@ -270,15 +270,13 @@ class LoadStatement extends Statement ); $state = 1; } elseif ($state === 1) { - if (($token->type === Token::TYPE_KEYWORD) - && ($token->keyword === 'REPLACE' - || $token->keyword === 'IGNORE') - ) { - $this->replace_ignore = trim($token->keyword); - } elseif ($token->type === Token::TYPE_KEYWORD - && $token->keyword === 'INTO' - ) { - $state = 2; + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'REPLACE' + || $token->keyword === 'IGNORE') { + $this->replace_ignore = trim($token->keyword); + } elseif ($token->keyword === 'INTO') { + $state = 2; + } } } elseif ($state === 2) { if ($token->type === Token::TYPE_KEYWORD |