summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Components/AlterOperation.php2
-rw-r--r--src/Components/Condition.php7
-rw-r--r--src/Components/SetOperation.php1
-rw-r--r--src/Statements/CreateStatement.php10
-rw-r--r--src/Utils/Query.php4
-rw-r--r--tools/TestGenerator.php4
6 files changed, 13 insertions, 15 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
*/
diff --git a/tools/TestGenerator.php b/tools/TestGenerator.php
index 07c8612..c2c44c2 100644
--- a/tools/TestGenerator.php
+++ b/tools/TestGenerator.php
@@ -178,7 +178,7 @@ class TestGenerator
// Building the test.
if (!file_exists($outputFile)) {
- print("Building test for {$inputFile}...\n");
+ sprintf("Building test for %s...\n", $inputFile);
static::build(
strpos($inputFile, 'lex') !== false ? 'lexer' : 'parser',
$inputFile,
@@ -186,7 +186,7 @@ class TestGenerator
$debugFile
);
} else {
- print("Test for {$inputFile} already built!\n");
+ sprintf("Test for %s already built!\n", $inputFile);
}
}
}