summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-06-13 15:19:31 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-06-13 15:19:31 +0300
commit7ad9549468007c37c0eddda0cd969c648aa779a1 (patch)
tree3e434aab902b0b4df7f023f49e7dac1840b88350 /src
parent175c41608e2cc586c5cf603ed2cb0d307ad632ad (diff)
downloadsql-parser-7ad9549468007c37c0eddda0cd969c648aa779a1.zip
sql-parser-7ad9549468007c37c0eddda0cd969c648aa779a1.tar.gz
sql-parser-7ad9549468007c37c0eddda0cd969c648aa779a1.tar.bz2
Follow the PSR2 standard.
Diffstat (limited to 'src')
-rw-r--r--src/Fragments/ParamDefFragment.php2
-rw-r--r--src/Lexer.php6
-rw-r--r--src/Utils/Misc.php3
-rw-r--r--src/Utils/Routine.php1
4 files changed, 5 insertions, 7 deletions
diff --git a/src/Fragments/ParamDefFragment.php b/src/Fragments/ParamDefFragment.php
index 05bad6e..b7d414d 100644
--- a/src/Fragments/ParamDefFragment.php
+++ b/src/Fragments/ParamDefFragment.php
@@ -91,7 +91,7 @@ class ParamDefFragment extends Fragment
if (($token->value === 'IN') || ($token->value === 'OUT') || ($token->value === 'INOUT')) {
$expr->inOut = $token->value;
++$list->idx;
- } else if ($token->value === ')') {
+ } elseif ($token->value === ')') {
++$list->idx;
break;
} else {
diff --git a/src/Lexer.php b/src/Lexer.php
index 238d63b..2b980ab 100644
--- a/src/Lexer.php
+++ b/src/Lexer.php
@@ -135,7 +135,7 @@ class Lexer
// Another example is `parseComment`.
$tokens = new TokensList();
- $lastToken = NULL;
+ $lastToken = null;
for ($this->last = 0, $lastIdx = 0; $this->last < $this->len; $lastIdx = ++$this->last) {
/** @var Token The new token. */
@@ -153,8 +153,8 @@ class Lexer
if ($this->delimiter !== $this->str[$this->last]) {
$this->error('Unexpected character.', $this->str[$this->last], $this->last);
}
- } else if (($token->type === Token::TYPE_SYMBOL) && ($token->flags & Token::FLAG_SYMBOL_VARIABLE) &&
- ($lastToken !== NULL)) {
+ } elseif (($token->type === Token::TYPE_SYMBOL) && ($token->flags & Token::FLAG_SYMBOL_VARIABLE) &&
+ ($lastToken !== null)) {
// Handles ```... FROM 'user'@'%' ...```.
if ((($lastToken->type === Token::TYPE_SYMBOL) && ($lastToken->flags & Token::FLAG_SYMBOL_BACKTICK)) ||
($lastToken->type === Token::TYPE_STRING)) {
diff --git a/src/Utils/Misc.php b/src/Utils/Misc.php
index aca16fe..dc8b438 100644
--- a/src/Utils/Misc.php
+++ b/src/Utils/Misc.php
@@ -68,7 +68,7 @@ class Misc
}
foreach ($tree->expr as $expr) {
- if ((empty($expr->column)) || (empty($expr->alias)) ){
+ if ((empty($expr->column)) || (empty($expr->alias))) {
continue;
}
@@ -87,5 +87,4 @@ class Misc
return $retval;
}
-
}
diff --git a/src/Utils/Routine.php b/src/Utils/Routine.php
index 1b694e2..0f42c51 100644
--- a/src/Utils/Routine.php
+++ b/src/Utils/Routine.php
@@ -42,5 +42,4 @@ class Routine
return $retval;
}
-
}