diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2016-02-21 15:47:32 +0200 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2016-02-21 15:47:32 +0200 |
commit | bc47af8d0702a004a743a6abb473c27cd3b6010d (patch) | |
tree | 72a04a8a2fc09f4f868bc3f61e2e538023b143ac /src | |
parent | 33f62b8de25ad847b6e3948a87d17163fd090492 (diff) | |
download | sql-parser-bc47af8d0702a004a743a6abb473c27cd3b6010d.zip sql-parser-bc47af8d0702a004a743a6abb473c27cd3b6010d.tar.gz sql-parser-bc47af8d0702a004a743a6abb473c27cd3b6010d.tar.bz2 |
Misc: Fixed some issues reported by Scrutinizer.
Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Components/AlterOperation.php | 2 | ||||
-rw-r--r-- | src/Components/Condition.php | 7 | ||||
-rw-r--r-- | src/Components/SetOperation.php | 1 | ||||
-rw-r--r-- | src/Statements/CreateStatement.php | 10 | ||||
-rw-r--r-- | src/Utils/Query.php | 4 |
5 files changed, 11 insertions, 13 deletions
diff --git a/src/Components/AlterOperation.php b/src/Components/AlterOperation.php index d4ce77a..70746da 100644 --- a/src/Components/AlterOperation.php +++ b/src/Components/AlterOperation.php @@ -27,7 +27,7 @@ class AlterOperation extends Component /** * All database options - * + * * @var array */ public static $DB_OPTIONS = array( diff --git a/src/Components/Condition.php b/src/Components/Condition.php index bb3c591..e84ad86 100644 --- a/src/Components/Condition.php +++ b/src/Components/Condition.php @@ -166,9 +166,10 @@ class Condition extends Component } } - if (($token->type === Token::TYPE_KEYWORD) && - ($token->flags & Token::FLAG_KEYWORD_RESERVED) && - !($token->flags & Token::FLAG_KEYWORD_FUNCTION)) { + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && !($token->flags & Token::FLAG_KEYWORD_FUNCTION) + ) { if ($token->value === 'BETWEEN') { $betweenBefore = true; } diff --git a/src/Components/SetOperation.php b/src/Components/SetOperation.php index 9306d43..ad43d1c 100644 --- a/src/Components/SetOperation.php +++ b/src/Components/SetOperation.php @@ -104,7 +104,6 @@ class SetOperation extends Component ) ); if ($tmp == null) { - $expr = null; break; } $expr->column = trim($expr->column); diff --git a/src/Statements/CreateStatement.php b/src/Statements/CreateStatement.php index 85a534f..83c856c 100644 --- a/src/Statements/CreateStatement.php +++ b/src/Statements/CreateStatement.php @@ -317,13 +317,11 @@ class CreateStatement extends Statement . Expression::build($this->name) . ' ' . ParameterDefinition::build($this->parameters) . ' ' . $tmp . ' ' . TokensList::build($this->body); - } else { - return 'CREATE ' - . OptionsArray::build($this->options) . ' ' - . Expression::build($this->name) . ' ' - . TokensList::build($this->body); } - return ''; + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . TokensList::build($this->body); } /** diff --git a/src/Utils/Query.php b/src/Utils/Query.php index 3698f1c..239cd6f 100644 --- a/src/Utils/Query.php +++ b/src/Utils/Query.php @@ -57,8 +57,8 @@ class Query /** * Gets an array with flags this statement has. * - * @param Statement $statement The statement to be processed. - * @param bool $all If `false`, false values will not be included. + * @param Statement|null $statement The statement to be processed. + * @param bool $all If `false`, false values will not be included. * * @return array */ |