@@ -106,52 +106,52 @@ |
||
106 | 106 | * |
107 | 107 | * @var Expression[]|null |
108 | 108 | */ |
109 | - public array|null $from = null; |
|
109 | + public array | null $from = null; |
|
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Joins. |
113 | 113 | * |
114 | 114 | * @var JoinKeyword[]|null |
115 | 115 | */ |
116 | - public array|null $join = null; |
|
116 | + public array | null $join = null; |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Tables used as sources for this statement. |
120 | 120 | * |
121 | 121 | * @var Expression[]|null |
122 | 122 | */ |
123 | - public array|null $using = null; |
|
123 | + public array | null $using = null; |
|
124 | 124 | |
125 | 125 | /** |
126 | 126 | * Columns used in this statement. |
127 | 127 | * |
128 | 128 | * @var Expression[]|null |
129 | 129 | */ |
130 | - public array|null $columns = null; |
|
130 | + public array | null $columns = null; |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Partitions used as source for this statement. |
134 | 134 | */ |
135 | - public ArrayObj|null $partition = null; |
|
135 | + public ArrayObj | null $partition = null; |
|
136 | 136 | |
137 | 137 | /** |
138 | 138 | * Conditions used for filtering each row of the result set. |
139 | 139 | * |
140 | 140 | * @var Condition[]|null |
141 | 141 | */ |
142 | - public array|null $where = null; |
|
142 | + public array | null $where = null; |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Specifies the order of the rows in the result set. |
146 | 146 | * |
147 | 147 | * @var OrderKeyword[]|null |
148 | 148 | */ |
149 | - public array|null $order = null; |
|
149 | + public array | null $order = null; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Conditions used for limiting the size of the result set. |
153 | 153 | */ |
154 | - public Limit|null $limit = null; |
|
154 | + public Limit | null $limit = null; |
|
155 | 155 | |
156 | 156 | public function build(): string |
157 | 157 | { |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * |
270 | 270 | * Used by all `CREATE` statements. |
271 | 271 | */ |
272 | - public Expression|null $name = null; |
|
272 | + public Expression | null $name = null; |
|
273 | 273 | |
274 | 274 | /** |
275 | 275 | * The options of the entity (table, procedure, function, etc.). |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @see CreateStatement::FUNCTION_OPTIONS |
281 | 281 | * @see CreateStatement::TRIGGER_OPTIONS |
282 | 282 | */ |
283 | - public OptionsArray|null $entityOptions = null; |
|
283 | + public OptionsArray | null $entityOptions = null; |
|
284 | 284 | |
285 | 285 | /** |
286 | 286 | * If `CREATE TABLE`, a list of columns and keys. |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * |
291 | 291 | * @var CreateDefinition[]|ArrayObj|null |
292 | 292 | */ |
293 | - public array|ArrayObj|null $fields = null; |
|
293 | + public array | ArrayObj | null $fields = null; |
|
294 | 294 | |
295 | 295 | /** |
296 | 296 | * If `CREATE TABLE WITH`. |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * |
300 | 300 | * Used by `CREATE TABLE`, `CREATE VIEW` |
301 | 301 | */ |
302 | - public WithStatement|null $with = null; |
|
302 | + public WithStatement | null $with = null; |
|
303 | 303 | |
304 | 304 | /** |
305 | 305 | * If `CREATE TABLE ... SELECT`. |
@@ -307,55 +307,55 @@ discard block |
||
307 | 307 | * |
308 | 308 | * Used by `CREATE TABLE`, `CREATE VIEW` |
309 | 309 | */ |
310 | - public SelectStatement|null $select = null; |
|
310 | + public SelectStatement | null $select = null; |
|
311 | 311 | |
312 | 312 | /** |
313 | 313 | * If `CREATE TABLE ... LIKE`. |
314 | 314 | * |
315 | 315 | * Used by `CREATE TABLE` |
316 | 316 | */ |
317 | - public Expression|null $like = null; |
|
317 | + public Expression | null $like = null; |
|
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Expression used for partitioning. |
321 | 321 | */ |
322 | - public string|null $partitionBy = null; |
|
322 | + public string | null $partitionBy = null; |
|
323 | 323 | |
324 | 324 | /** |
325 | 325 | * The number of partitions. |
326 | 326 | */ |
327 | - public int|null $partitionsNum = null; |
|
327 | + public int | null $partitionsNum = null; |
|
328 | 328 | |
329 | 329 | /** |
330 | 330 | * Expression used for subpartitioning. |
331 | 331 | */ |
332 | - public string|null $subpartitionBy = null; |
|
332 | + public string | null $subpartitionBy = null; |
|
333 | 333 | |
334 | 334 | /** |
335 | 335 | * The number of subpartitions. |
336 | 336 | */ |
337 | - public int|null $subpartitionsNum = null; |
|
337 | + public int | null $subpartitionsNum = null; |
|
338 | 338 | |
339 | 339 | /** |
340 | 340 | * The partition of the new table. |
341 | 341 | * |
342 | 342 | * @var PartitionDefinition[]|null |
343 | 343 | */ |
344 | - public array|null $partitions = null; |
|
344 | + public array | null $partitions = null; |
|
345 | 345 | |
346 | 346 | /** |
347 | 347 | * If `CREATE TRIGGER` the name of the table. |
348 | 348 | * |
349 | 349 | * Used by `CREATE TRIGGER`. |
350 | 350 | */ |
351 | - public Expression|null $table = null; |
|
351 | + public Expression | null $table = null; |
|
352 | 352 | |
353 | 353 | /** |
354 | 354 | * The return data type of this routine. |
355 | 355 | * |
356 | 356 | * Used by `CREATE FUNCTION`. |
357 | 357 | */ |
358 | - public DataType|null $return = null; |
|
358 | + public DataType | null $return = null; |
|
359 | 359 | |
360 | 360 | /** |
361 | 361 | * The parameters of this routine. |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * |
365 | 365 | * @var ParameterDefinition[]|null |
366 | 366 | */ |
367 | - public array|null $parameters = null; |
|
367 | + public array | null $parameters = null; |
|
368 | 368 | |
369 | 369 | /** |
370 | 370 | * The body of this function or procedure. |
@@ -417,23 +417,23 @@ discard block |
||
417 | 417 | |
418 | 418 | $partition = ''; |
419 | 419 | |
420 | - if (! empty($this->partitionBy)) { |
|
420 | + if (!empty($this->partitionBy)) { |
|
421 | 421 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
422 | 422 | } |
423 | 423 | |
424 | - if (! empty($this->partitionsNum)) { |
|
424 | + if (!empty($this->partitionsNum)) { |
|
425 | 425 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
426 | 426 | } |
427 | 427 | |
428 | - if (! empty($this->subpartitionBy)) { |
|
428 | + if (!empty($this->subpartitionBy)) { |
|
429 | 429 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
430 | 430 | } |
431 | 431 | |
432 | - if (! empty($this->subpartitionsNum)) { |
|
432 | + if (!empty($this->subpartitionsNum)) { |
|
433 | 433 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
434 | 434 | } |
435 | 435 | |
436 | - if (! empty($this->partitions)) { |
|
436 | + if (!empty($this->partitions)) { |
|
437 | 437 | $partition .= "\n" . PartitionDefinition::buildAll($this->partitions); |
438 | 438 | } |
439 | 439 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $token = $list->getNextOfType(TokenType::Number); |
628 | 628 | --$list->idx; // `getNextOfType` also advances one position. |
629 | 629 | $this->subpartitionsNum = $token->value; |
630 | - } elseif (! empty($field)) { |
|
630 | + } elseif (!empty($field)) { |
|
631 | 631 | /* |
632 | 632 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
633 | 633 | */ |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | $field = null; |
657 | 657 | } |
658 | 658 | } elseif (($token->type === TokenType::Operator) && ($token->value === '(')) { |
659 | - if (! empty($this->partitionBy)) { |
|
659 | + if (!empty($this->partitionBy)) { |
|
660 | 660 | $this->partitions = ArrayObj::parse( |
661 | 661 | $parser, |
662 | 662 | $list, |
@@ -88,70 +88,70 @@ |
||
88 | 88 | /** |
89 | 89 | * File name being used to load data. |
90 | 90 | */ |
91 | - public Expression|null $fileName = null; |
|
91 | + public Expression | null $fileName = null; |
|
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Table used as destination for this statement. |
95 | 95 | */ |
96 | - public Expression|null $table = null; |
|
96 | + public Expression | null $table = null; |
|
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Partitions used as source for this statement. |
100 | 100 | */ |
101 | - public ArrayObj|null $partition = null; |
|
101 | + public ArrayObj | null $partition = null; |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * Character set used in this statement. |
105 | 105 | */ |
106 | - public Expression|null $charsetName = null; |
|
106 | + public Expression | null $charsetName = null; |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Options for FIELDS/COLUMNS keyword. |
110 | 110 | * |
111 | 111 | * @see LoadStatement::STATEMENT_FIELDS_OPTIONS |
112 | 112 | */ |
113 | - public OptionsArray|null $fieldsOptions = null; |
|
113 | + public OptionsArray | null $fieldsOptions = null; |
|
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Whether to use `FIELDS` or `COLUMNS` while building. |
117 | 117 | */ |
118 | - public string|null $fieldsKeyword = null; |
|
118 | + public string | null $fieldsKeyword = null; |
|
119 | 119 | |
120 | 120 | /** |
121 | 121 | * Options for OPTIONS keyword. |
122 | 122 | * |
123 | 123 | * @see LoadStatement::STATEMENT_LINES_OPTIONS |
124 | 124 | */ |
125 | - public OptionsArray|null $linesOptions = null; |
|
125 | + public OptionsArray | null $linesOptions = null; |
|
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Column names or user variables. |
129 | 129 | * |
130 | 130 | * @var Expression[]|null |
131 | 131 | */ |
132 | - public array|null $columnNamesOrUserVariables = null; |
|
132 | + public array | null $columnNamesOrUserVariables = null; |
|
133 | 133 | |
134 | 134 | /** |
135 | 135 | * SET clause's updated values(optional). |
136 | 136 | * |
137 | 137 | * @var SetOperation[]|null |
138 | 138 | */ |
139 | - public array|null $set = null; |
|
139 | + public array | null $set = null; |
|
140 | 140 | |
141 | 141 | /** |
142 | 142 | * Ignore 'number' LINES/ROWS. |
143 | 143 | */ |
144 | - public Expression|null $ignoreNumber = null; |
|
144 | + public Expression | null $ignoreNumber = null; |
|
145 | 145 | |
146 | 146 | /** |
147 | 147 | * REPLACE/IGNORE Keyword. |
148 | 148 | */ |
149 | - public string|null $replaceIgnore = null; |
|
149 | + public string | null $replaceIgnore = null; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * LINES/ROWS Keyword. |
153 | 153 | */ |
154 | - public string|null $linesRows = null; |
|
154 | + public string | null $linesRows = null; |
|
155 | 155 | |
156 | 156 | public function build(): string |
157 | 157 | { |
@@ -23,14 +23,14 @@ |
||
23 | 23 | /** |
24 | 24 | * Table affected. |
25 | 25 | */ |
26 | - public Expression|null $table = null; |
|
26 | + public Expression | null $table = null; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Column affected by this statement. |
30 | 30 | * |
31 | 31 | * @var AlterOperation[]|null |
32 | 32 | */ |
33 | - public array|null $altered = []; |
|
33 | + public array | null $altered = []; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Options of this statement. |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * Tables used as target for this statement. |
70 | 70 | */ |
71 | - public IntoKeyword|null $into = null; |
|
71 | + public IntoKeyword | null $into = null; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Values to be inserted. |
75 | 75 | * |
76 | 76 | * @var ArrayObj[]|null |
77 | 77 | */ |
78 | - public array|null $values = null; |
|
78 | + public array | null $values = null; |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * If SET clause is present |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @var SetOperation[]|null |
85 | 85 | */ |
86 | - public array|null $set = null; |
|
86 | + public array | null $set = null; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * If SELECT clause is present |
90 | 90 | * holds the SelectStatement. |
91 | 91 | */ |
92 | - public SelectStatement|null $select = null; |
|
92 | + public SelectStatement | null $select = null; |
|
93 | 93 | |
94 | 94 | /** |
95 | 95 | * If WITH CTE is present |
96 | 96 | * holds the WithStatement. |
97 | 97 | */ |
98 | - public WithStatement|null $with = null; |
|
98 | + public WithStatement | null $with = null; |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * If ON DUPLICATE KEY UPDATE clause is present |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @var SetOperation[]|null |
105 | 105 | */ |
106 | - public array|null $onDuplicateSet = null; |
|
106 | + public array | null $onDuplicateSet = null; |
|
107 | 107 | |
108 | 108 | public function build(): string |
109 | 109 | { |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * Tables used as target for this statement. |
56 | 56 | */ |
57 | - public IntoKeyword|null $into = null; |
|
57 | + public IntoKeyword | null $into = null; |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Values to be replaced. |
61 | 61 | * |
62 | 62 | * @var ArrayObj[]|null |
63 | 63 | */ |
64 | - public array|null $values = null; |
|
64 | + public array | null $values = null; |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * If SET clause is present |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @var SetOperation[]|null |
71 | 71 | */ |
72 | - public array|null $set = null; |
|
72 | + public array | null $set = null; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * If SELECT clause is present |
76 | 76 | * holds the SelectStatement. |
77 | 77 | */ |
78 | - public SelectStatement|null $select = null; |
|
78 | + public SelectStatement | null $select = null; |
|
79 | 79 | |
80 | 80 | public function build(): string |
81 | 81 | { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | /** @param array<string, bool|string>|false $getopt */ |
52 | 52 | #[DataProvider('highlightParamsProvider')] |
53 | - public function testRunHighlight(array|false $getopt, string $output, int $result): void |
|
53 | + public function testRunHighlight(array | false $getopt, string $output, int $result): void |
|
54 | 54 | { |
55 | 55 | $cli = $this->getCLI($getopt); |
56 | 56 | $this->expectOutputString($output); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | /** @param array<string, bool|string>|false $getopt */ |
124 | 124 | #[DataProvider('highlightParamsStdInProvider')] |
125 | - public function testRunHighlightStdIn(string $input, array|false $getopt, string $output, int $result): void |
|
125 | + public function testRunHighlightStdIn(string $input, array | false $getopt, string $output, int $result): void |
|
126 | 126 | { |
127 | 127 | $cli = $this->getCLIStdIn($input, $getopt); |
128 | 128 | $this->expectOutputString($output); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | /** @param array<string, bool|string>|false $getopt */ |
189 | 189 | #[DataProvider('lintParamsStdInProvider')] |
190 | - public function testRunLintFromStdIn(string $input, array|false $getopt, string $output, int $result): void |
|
190 | + public function testRunLintFromStdIn(string $input, array | false $getopt, string $output, int $result): void |
|
191 | 191 | { |
192 | 192 | $cli = $this->getCLIStdIn($input, $getopt); |
193 | 193 | $this->expectOutputString($output); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | /** @param array<string, bool|string>|false $getopt */ |
251 | 251 | #[DataProvider('lintParamsProvider')] |
252 | - public function testRunLint(array|false $getopt, string $output, int $result): void |
|
252 | + public function testRunLint(array | false $getopt, string $output, int $result): void |
|
253 | 253 | { |
254 | 254 | $cli = $this->getCLI($getopt); |
255 | 255 | $this->expectOutputString($output); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | |
314 | 314 | /** @param array<string, bool|string>|false $getopt */ |
315 | 315 | #[DataProvider('tokenizeParamsProvider')] |
316 | - public function testRunTokenize(array|false $getopt, string $output, int $result): void |
|
316 | + public function testRunTokenize(array | false $getopt, string $output, int $result): void |
|
317 | 317 | { |
318 | 318 | $cli = $this->getCLI($getopt); |
319 | 319 | $this->expectOutputString($output); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | /** @param array<string, bool|string>|false $getopt */ |
367 | 367 | #[DataProvider('tokenizeParamsStdInProvider')] |
368 | - public function testRunTokenizeStdIn(string $input, array|false $getopt, string $output, int $result): void |
|
368 | + public function testRunTokenizeStdIn(string $input, array | false $getopt, string $output, int $result): void |
|
369 | 369 | { |
370 | 370 | $cli = $this->getCLIStdIn($input, $getopt); |
371 | 371 | $this->expectOutputString($output); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Test for loading closest SQL context |
36 | 36 | */ |
37 | 37 | #[DataProvider('contextLoadingProvider')] |
38 | - public function testLoadClosest(string $context, string|null $expected): void |
|
38 | + public function testLoadClosest(string $context, string | null $expected): void |
|
39 | 39 | { |
40 | 40 | $this->assertEquals($expected, Context::loadClosest($context)); |
41 | 41 | if ($expected !== null) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | #[DataProvider('providerForTestMode')] |
121 | - public function testMode(int|string $mode, int $expected): void |
|
121 | + public function testMode(int | string $mode, int $expected): void |
|
122 | 122 | { |
123 | 123 | Context::setMode($mode); |
124 | 124 | $this->assertSame($expected, Context::getMode()); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * The string to be parsed. |
69 | 69 | */ |
70 | - public string|UtfString $str = ''; |
|
70 | + public string | UtfString $str = ''; |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * The length of `$str`. |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * enabled or not |
114 | 114 | * @param string $delimiter the delimiter to be used |
115 | 115 | */ |
116 | - public function __construct(string|UtfString $str, bool $strict = false, string|null $delimiter = null) |
|
116 | + public function __construct(string | UtfString $str, bool $strict = false, string | null $delimiter = null) |
|
117 | 117 | { |
118 | 118 | if (Context::$keywords === []) { |
119 | 119 | Context::load(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $len = $str instanceof UtfString ? $str->length() : strlen($str); |
125 | 125 | |
126 | 126 | // For multi-byte strings, a new instance of `UtfString` is initialized. |
127 | - if (! $str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
127 | + if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
128 | 128 | $str = new UtfString($str); |
129 | 129 | } |
130 | 130 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $this->strict = $strict; |
135 | 135 | |
136 | 136 | // Setting the delimiter. |
137 | - $this->setDelimiter(! empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
137 | + $this->setDelimiter(!empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
138 | 138 | |
139 | 139 | $this->lex(); |
140 | 140 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $delimiterLen = 0; |
244 | 244 | while ( |
245 | 245 | ++$this->last < $this->len |
246 | - && ! Context::isWhitespace($this->str[$this->last]) |
|
246 | + && !Context::isWhitespace($this->str[$this->last]) |
|
247 | 247 | && $delimiterLen < 15 |
248 | 248 | ) { |
249 | 249 | $this->delimiter .= $this->str[$this->last]; |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | if ( |
305 | - ($next->type !== TokenType::Keyword || ! in_array($next->value, ['FROM', 'USING'], true)) |
|
306 | - && ($next->type !== TokenType::Operator || ! in_array($next->value, [',', ')'], true)) |
|
305 | + ($next->type !== TokenType::Keyword || !in_array($next->value, ['FROM', 'USING'], true)) |
|
306 | + && ($next->type !== TokenType::Operator || !in_array($next->value, [',', ')'], true)) |
|
307 | 307 | ) { |
308 | 308 | continue; |
309 | 309 | } |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | $next = $this->list->getNext(); |
342 | 342 | if ( |
343 | 343 | ($next->type !== TokenType::Keyword |
344 | - || ! in_array($next->value, self::KEYWORD_NAME_INDICATORS, true) |
|
344 | + || !in_array($next->value, self::KEYWORD_NAME_INDICATORS, true) |
|
345 | 345 | ) |
346 | 346 | && ($next->type !== TokenType::Operator |
347 | - || ! in_array($next->value, self::OPERATOR_NAME_INDICATORS, true) |
|
347 | + || !in_array($next->value, self::OPERATOR_NAME_INDICATORS, true) |
|
348 | 348 | ) |
349 | 349 | && ($next->value !== '') |
350 | 350 | ) { |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | /** |
389 | 389 | * Parses a keyword. |
390 | 390 | */ |
391 | - public function parseKeyword(): Token|null |
|
391 | + public function parseKeyword(): Token | null |
|
392 | 392 | { |
393 | 393 | $token = ''; |
394 | 394 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $token .= $this->str[$this->last]; |
429 | 429 | $flags = Context::isKeyword($token); |
430 | 430 | |
431 | - if (($this->last + 1 !== $this->len && ! Context::isSeparator($this->str[$this->last + 1])) || ! $flags) { |
|
431 | + if (($this->last + 1 !== $this->len && !Context::isSeparator($this->str[$this->last + 1])) || !$flags) { |
|
432 | 432 | continue; |
433 | 433 | } |
434 | 434 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | /** |
449 | 449 | * Parses a label. |
450 | 450 | */ |
451 | - public function parseLabel(): Token|null |
|
451 | + public function parseLabel(): Token | null |
|
452 | 452 | { |
453 | 453 | $token = ''; |
454 | 454 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | /** |
493 | 493 | * Parses an operator. |
494 | 494 | */ |
495 | - public function parseOperator(): Token|null |
|
495 | + public function parseOperator(): Token | null |
|
496 | 496 | { |
497 | 497 | $token = ''; |
498 | 498 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | $token .= $this->str[$this->last]; |
513 | 513 | $flags = Context::isOperator($token); |
514 | 514 | |
515 | - if (! $flags) { |
|
515 | + if (!$flags) { |
|
516 | 516 | continue; |
517 | 517 | } |
518 | 518 | |
@@ -528,11 +528,11 @@ discard block |
||
528 | 528 | /** |
529 | 529 | * Parses a whitespace. |
530 | 530 | */ |
531 | - public function parseWhitespace(): Token|null |
|
531 | + public function parseWhitespace(): Token | null |
|
532 | 532 | { |
533 | 533 | $token = $this->str[$this->last]; |
534 | 534 | |
535 | - if (! Context::isWhitespace($token)) { |
|
535 | + if (!Context::isWhitespace($token)) { |
|
536 | 536 | return null; |
537 | 537 | } |
538 | 538 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | /** |
549 | 549 | * Parses a comment. |
550 | 550 | */ |
551 | - public function parseComment(): Token|null |
|
551 | + public function parseComment(): Token | null |
|
552 | 552 | { |
553 | 553 | $iBak = $this->last; |
554 | 554 | $token = $this->str[$this->last]; |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | /** |
666 | 666 | * Parses a boolean. |
667 | 667 | */ |
668 | - public function parseBool(): Token|null |
|
668 | + public function parseBool(): Token | null |
|
669 | 669 | { |
670 | 670 | if ($this->last + 3 >= $this->len) { |
671 | 671 | // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | /** |
697 | 697 | * Parses a number. |
698 | 698 | */ |
699 | - public function parseNumber(): Token|null |
|
699 | + public function parseNumber(): Token | null |
|
700 | 700 | { |
701 | 701 | // A rudimentary state machine is being used to parse numbers due to |
702 | 702 | // the various forms of their notation. |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } elseif ($state === 2) { |
764 | 764 | $flags |= Token::FLAG_NUMBER_HEX; |
765 | 765 | if ( |
766 | - ! ( |
|
766 | + !( |
|
767 | 767 | ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') |
768 | 768 | || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') |
769 | 769 | || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') |
@@ -859,12 +859,12 @@ discard block |
||
859 | 859 | * |
860 | 860 | * @throws LexerException |
861 | 861 | */ |
862 | - public function parseString(string $quote = ''): Token|null |
|
862 | + public function parseString(string $quote = ''): Token | null |
|
863 | 863 | { |
864 | 864 | $token = $this->str[$this->last]; |
865 | 865 | $flags = Context::isString($token); |
866 | 866 | |
867 | - if (! $flags && $token !== $quote) { |
|
867 | + if (!$flags && $token !== $quote) { |
|
868 | 868 | return null; |
869 | 869 | } |
870 | 870 | |
@@ -909,12 +909,12 @@ discard block |
||
909 | 909 | * |
910 | 910 | * @throws LexerException |
911 | 911 | */ |
912 | - public function parseSymbol(): Token|null |
|
912 | + public function parseSymbol(): Token | null |
|
913 | 913 | { |
914 | 914 | $token = $this->str[$this->last]; |
915 | 915 | $flags = Context::isSymbol($token); |
916 | 916 | |
917 | - if (! $flags) { |
|
917 | + if (!$flags) { |
|
918 | 918 | return null; |
919 | 919 | } |
920 | 920 | |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | if ($str === null) { |
941 | 941 | $str = $this->parseUnknown(); |
942 | 942 | |
943 | - if ($str === null && ! ($flags & Token::FLAG_SYMBOL_PARAMETER)) { |
|
943 | + if ($str === null && !($flags & Token::FLAG_SYMBOL_PARAMETER)) { |
|
944 | 944 | $this->error('Variable name was expected.', $this->str[$this->last], $this->last); |
945 | 945 | } |
946 | 946 | } |
@@ -956,14 +956,14 @@ discard block |
||
956 | 956 | /** |
957 | 957 | * Parses unknown parts of the query. |
958 | 958 | */ |
959 | - public function parseUnknown(): Token|null |
|
959 | + public function parseUnknown(): Token | null |
|
960 | 960 | { |
961 | 961 | $token = $this->str[$this->last]; |
962 | 962 | if (Context::isSeparator($token)) { |
963 | 963 | return null; |
964 | 964 | } |
965 | 965 | |
966 | - while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { |
|
966 | + while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) { |
|
967 | 967 | $token .= $this->str[$this->last]; |
968 | 968 | |
969 | 969 | // Test if end of token equals the current delimiter. If so, remove it from the token. |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | /** |
983 | 983 | * Parses the delimiter of the query. |
984 | 984 | */ |
985 | - public function parseDelimiter(): Token|null |
|
985 | + public function parseDelimiter(): Token | null |
|
986 | 986 | { |
987 | 987 | $idx = 0; |
988 | 988 | |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | return new Token($this->delimiter, TokenType::Delimiter); |
1000 | 1000 | } |
1001 | 1001 | |
1002 | - private function parse(): Token|null |
|
1002 | + private function parse(): Token | null |
|
1003 | 1003 | { |
1004 | 1004 | // It is best to put the parsers in order of their complexity |
1005 | 1005 | // (ascending) and their occurrence rate (descending). |