@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @var int |
| 31 | 31 | */ |
| 32 | - const TYPE_NONE = 0; |
|
| 32 | + const TYPE_NONE = 0; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * SQL specific keywords: SELECT, UPDATE, INSERT, etc. |
| 36 | 36 | * |
| 37 | 37 | * @var int |
| 38 | 38 | */ |
| 39 | - const TYPE_KEYWORD = 1; |
|
| 39 | + const TYPE_KEYWORD = 1; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Any type of legal operator. |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @var int |
| 52 | 52 | */ |
| 53 | - const TYPE_OPERATOR = 2; |
|
| 53 | + const TYPE_OPERATOR = 2; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * Spaces, tabs, new lines, etc. |
| 57 | 57 | * |
| 58 | 58 | * @var int |
| 59 | 59 | */ |
| 60 | - const TYPE_WHITESPACE = 3; |
|
| 60 | + const TYPE_WHITESPACE = 3; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Any type of legal comment. |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @var int |
| 81 | 81 | */ |
| 82 | - const TYPE_COMMENT = 4; |
|
| 82 | + const TYPE_COMMENT = 4; |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Boolean values: true or false. |
| 86 | 86 | * |
| 87 | 87 | * @var int |
| 88 | 88 | */ |
| 89 | - const TYPE_BOOL = 5; |
|
| 89 | + const TYPE_BOOL = 5; |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * Numbers: 4, 0x8, 15.16, 23e42, etc. |
| 93 | 93 | * |
| 94 | 94 | * @var int |
| 95 | 95 | */ |
| 96 | - const TYPE_NUMBER = 6; |
|
| 96 | + const TYPE_NUMBER = 6; |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Literal strings: 'string', "test". |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * |
| 102 | 102 | * @var int |
| 103 | 103 | */ |
| 104 | - const TYPE_STRING = 7; |
|
| 104 | + const TYPE_STRING = 7; |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Database, table names, variables, etc. |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @var int |
| 111 | 111 | */ |
| 112 | - const TYPE_SYMBOL = 8; |
|
| 112 | + const TYPE_SYMBOL = 8; |
|
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Delimits an unknown string. |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * |
| 118 | 118 | * @var int |
| 119 | 119 | */ |
| 120 | - const TYPE_DELIMITER = 9; |
|
| 120 | + const TYPE_DELIMITER = 9; |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Labels in LOOP statement, ITERATE statement etc. |
@@ -129,46 +129,46 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @var int |
| 131 | 131 | */ |
| 132 | - const TYPE_LABEL = 10; |
|
| 132 | + const TYPE_LABEL = 10; |
|
| 133 | 133 | |
| 134 | 134 | // Flags that describe the tokens in more detail. |
| 135 | 135 | // All keywords must have flag 1 so `Context::isKeyword` method doesn't |
| 136 | 136 | // require strict comparison. |
| 137 | - const FLAG_KEYWORD_RESERVED = 2; |
|
| 138 | - const FLAG_KEYWORD_COMPOSED = 4; |
|
| 139 | - const FLAG_KEYWORD_DATA_TYPE = 8; |
|
| 137 | + const FLAG_KEYWORD_RESERVED = 2; |
|
| 138 | + const FLAG_KEYWORD_COMPOSED = 4; |
|
| 139 | + const FLAG_KEYWORD_DATA_TYPE = 8; |
|
| 140 | 140 | const FLAG_KEYWORD_KEY = 16; |
| 141 | 141 | const FLAG_KEYWORD_FUNCTION = 32; |
| 142 | 142 | |
| 143 | 143 | // Numbers related flags. |
| 144 | - const FLAG_NUMBER_HEX = 1; |
|
| 145 | - const FLAG_NUMBER_FLOAT = 2; |
|
| 146 | - const FLAG_NUMBER_APPROXIMATE = 4; |
|
| 147 | - const FLAG_NUMBER_NEGATIVE = 8; |
|
| 144 | + const FLAG_NUMBER_HEX = 1; |
|
| 145 | + const FLAG_NUMBER_FLOAT = 2; |
|
| 146 | + const FLAG_NUMBER_APPROXIMATE = 4; |
|
| 147 | + const FLAG_NUMBER_NEGATIVE = 8; |
|
| 148 | 148 | const FLAG_NUMBER_BINARY = 16; |
| 149 | 149 | |
| 150 | 150 | // Strings related flags. |
| 151 | - const FLAG_STRING_SINGLE_QUOTES = 1; |
|
| 152 | - const FLAG_STRING_DOUBLE_QUOTES = 2; |
|
| 151 | + const FLAG_STRING_SINGLE_QUOTES = 1; |
|
| 152 | + const FLAG_STRING_DOUBLE_QUOTES = 2; |
|
| 153 | 153 | |
| 154 | 154 | // Comments related flags. |
| 155 | - const FLAG_COMMENT_BASH = 1; |
|
| 156 | - const FLAG_COMMENT_C = 2; |
|
| 157 | - const FLAG_COMMENT_SQL = 4; |
|
| 158 | - const FLAG_COMMENT_MYSQL_CMD = 8; |
|
| 155 | + const FLAG_COMMENT_BASH = 1; |
|
| 156 | + const FLAG_COMMENT_C = 2; |
|
| 157 | + const FLAG_COMMENT_SQL = 4; |
|
| 158 | + const FLAG_COMMENT_MYSQL_CMD = 8; |
|
| 159 | 159 | |
| 160 | 160 | // Operators related flags. |
| 161 | - const FLAG_OPERATOR_ARITHMETIC = 1; |
|
| 162 | - const FLAG_OPERATOR_LOGICAL = 2; |
|
| 163 | - const FLAG_OPERATOR_BITWISE = 4; |
|
| 164 | - const FLAG_OPERATOR_ASSIGNMENT = 8; |
|
| 161 | + const FLAG_OPERATOR_ARITHMETIC = 1; |
|
| 162 | + const FLAG_OPERATOR_LOGICAL = 2; |
|
| 163 | + const FLAG_OPERATOR_BITWISE = 4; |
|
| 164 | + const FLAG_OPERATOR_ASSIGNMENT = 8; |
|
| 165 | 165 | const FLAG_OPERATOR_SQL = 16; |
| 166 | 166 | |
| 167 | 167 | // Symbols related flags. |
| 168 | - const FLAG_SYMBOL_VARIABLE = 1; |
|
| 169 | - const FLAG_SYMBOL_BACKTICK = 2; |
|
| 170 | - const FLAG_SYMBOL_USER = 4; |
|
| 171 | - const FLAG_SYMBOL_SYSTEM = 8; |
|
| 168 | + const FLAG_SYMBOL_VARIABLE = 1; |
|
| 169 | + const FLAG_SYMBOL_BACKTICK = 2; |
|
| 170 | + const FLAG_SYMBOL_USER = 4; |
|
| 171 | + const FLAG_SYMBOL_SYSTEM = 8; |
|
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | 174 | * The token it its raw string representation. |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $ret->subquery = $token->value; |
| 228 | 228 | } elseif (($token->flags & Token::FLAG_KEYWORD_FUNCTION) |
| 229 | 229 | && (empty($options['parseField']) |
| 230 | - && ! $alias) |
|
| 230 | + && !$alias) |
|
| 231 | 231 | ) { |
| 232 | 232 | $isExpr = true; |
| 233 | 233 | } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | continue; |
| 262 | 262 | } |
| 263 | 263 | $isExpr = true; |
| 264 | - } elseif ($brackets === 0 && strlen($ret->expr) > 0 && ! $alias) { |
|
| 264 | + } elseif ($brackets === 0 && strlen($ret->expr) > 0 && !$alias) { |
|
| 265 | 265 | /* End of expression */ |
| 266 | 266 | break; |
| 267 | 267 | } |
@@ -223,7 +223,7 @@ |
||
| 223 | 223 | // We have reached the end of ALTER operation and suddenly found |
| 224 | 224 | // a start to new statement, but have not find a delimiter between them |
| 225 | 225 | |
| 226 | - if (! ($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) { |
|
| 226 | + if (!($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) { |
|
| 227 | 227 | $parser->error( |
| 228 | 228 | 'A new statement was found, but no delimiter between it and the previous one.', |
| 229 | 229 | $token |
@@ -71,15 +71,15 @@ |
||
| 71 | 71 | * @var array |
| 72 | 72 | */ |
| 73 | 73 | public static $CLAUSES = array( |
| 74 | - 'DELETE' => array('DELETE', 2), |
|
| 74 | + 'DELETE' => array('DELETE', 2), |
|
| 75 | 75 | // Used for options. |
| 76 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 77 | - 'FROM' => array('FROM', 3), |
|
| 78 | - 'PARTITION' => array('PARTITION', 3), |
|
| 79 | - 'USING' => array('USING', 3), |
|
| 80 | - 'WHERE' => array('WHERE', 3), |
|
| 81 | - 'ORDER BY' => array('ORDER BY', 3), |
|
| 82 | - 'LIMIT' => array('LIMIT', 3), |
|
| 76 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 77 | + 'FROM' => array('FROM', 3), |
|
| 78 | + 'PARTITION' => array('PARTITION', 3), |
|
| 79 | + 'USING' => array('USING', 3), |
|
| 80 | + 'WHERE' => array('WHERE', 3), |
|
| 81 | + 'ORDER BY' => array('ORDER BY', 3), |
|
| 82 | + 'LIMIT' => array('LIMIT', 3), |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -481,7 +481,7 @@ |
||
| 481 | 481 | if ($clauseStartIdx != -1) { |
| 482 | 482 | if ($joinStart == 0 && stripos($clauseType, 'JOIN')) { |
| 483 | 483 | $joinStart = 1; |
| 484 | - } elseif ($joinStart == 1 && ! stripos($clauseType, 'JOIN')) { |
|
| 484 | + } elseif ($joinStart == 1 && !stripos($clauseType, 'JOIN')) { |
|
| 485 | 485 | $joinStart = 2; |
| 486 | 486 | } elseif ($joinStart == 2 && stripos($clauseType, 'JOIN')) { |
| 487 | 487 | $error = 1; |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | // pieces only if the clause is not inlined or this fragment |
| 350 | 350 | // is between brackets that are on new line. |
| 351 | 351 | if (((empty(self::$INLINE_CLAUSES[$lastClause])) |
| 352 | - && ! $shortGroup |
|
| 352 | + && !$shortGroup |
|
| 353 | 353 | && ($this->options['parts_newline'])) |
| 354 | 354 | || (end($blocksLineEndings) === true) |
| 355 | 355 | ) { |
@@ -435,9 +435,9 @@ discard block |
||
| 435 | 435 | array( |
| 436 | 436 | "\x00", "\x01", "\x02", "\x03", "\x04", |
| 437 | 437 | "\x05", "\x06", "\x07", "\x08", "\x09", "\x0A", |
| 438 | - "\x0B","\x0C","\x0D", "\x0E", "\x0F", "\x10", "\x11", |
|
| 439 | - "\x12","\x13","\x14","\x15", "\x16", "\x17", "\x18", |
|
| 440 | - "\x19","\x1A","\x1B","\x1C","\x1D", "\x1E", "\x1F" |
|
| 438 | + "\x0B", "\x0C", "\x0D", "\x0E", "\x0F", "\x10", "\x11", |
|
| 439 | + "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", |
|
| 440 | + "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F" |
|
| 441 | 441 | ), |
| 442 | 442 | array( |
| 443 | 443 | '\x00', '\x01', '\x02', '\x03', '\x04', |
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | return $ret; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - public function parseFileOptions(Parser $parser, TokensList $list, $keyword='FIELDS') { |
|
| 205 | + public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS') { |
|
| 206 | 206 | ++$list->idx; |
| 207 | 207 | |
| 208 | 208 | if ($keyword === 'FIELDS' || $keyword === 'COLUMNS') { |