@@ -29,7 +29,7 @@ |
||
29 | 29 | * @param int|string $rowCount the row count |
30 | 30 | * @param int|string $offset the offset |
31 | 31 | */ |
32 | - public function __construct(int|string $rowCount = 0, int|string $offset = 0) |
|
32 | + public function __construct(int | string $rowCount = 0, int | string $offset = 0) |
|
33 | 33 | { |
34 | 34 | $this->rowCount = $rowCount; |
35 | 35 | $this->offset = $offset; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @param string|null $name the name of the function to be called |
32 | 32 | * @param string[]|ArrayObj|null $parameters the parameters of this function |
33 | 33 | */ |
34 | - public function __construct(string|null $name = null, array|ArrayObj|null $parameters = null) |
|
34 | + public function __construct(string | null $name = null, array | ArrayObj | null $parameters = null) |
|
35 | 35 | { |
36 | 36 | $this->name = $name; |
37 | 37 | if (is_array($parameters)) { |
@@ -44,9 +44,9 @@ |
||
44 | 44 | * @param Token[] $unknown unparsed tokens found at the end of operation |
45 | 45 | */ |
46 | 46 | public function __construct( |
47 | - OptionsArray|null $options = null, |
|
48 | - Expression|string|null $field = null, |
|
49 | - array|null $partitions = null, |
|
47 | + OptionsArray | null $options = null, |
|
48 | + Expression | string | null $field = null, |
|
49 | + array | null $partitions = null, |
|
50 | 50 | public array $unknown = [], |
51 | 51 | ) { |
52 | 52 | $this->partitions = $partitions; |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @param string|null $alias the name of the alias |
83 | 83 | */ |
84 | 84 | public function __construct( |
85 | - string|null $database = null, |
|
86 | - string|null $table = null, |
|
87 | - string|null $column = null, |
|
88 | - string|null $alias = null, |
|
85 | + string | null $database = null, |
|
86 | + string | null $table = null, |
|
87 | + string | null $column = null, |
|
88 | + string | null $alias = null, |
|
89 | 89 | ) { |
90 | 90 | if (($column === null) && ($alias === null)) { |
91 | 91 | $this->expr = $database; // case 1 |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $ret = implode('.', Context::escapeAll($fields)); |
120 | 120 | } |
121 | 121 | |
122 | - if (! empty($this->alias)) { |
|
122 | + if (!empty($this->alias)) { |
|
123 | 123 | $ret .= ' AS ' . Context::escape($this->alias); |
124 | 124 | } |
125 | 125 |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | * @phpstan-param array{name?: string, length?: int, order?: string}[] $columns |
62 | 62 | */ |
63 | 63 | public function __construct( |
64 | - string|null $name = null, |
|
64 | + string | null $name = null, |
|
65 | 65 | array $columns = [], |
66 | - string|null $type = null, |
|
67 | - OptionsArray|null $options = null, |
|
66 | + string | null $type = null, |
|
67 | + OptionsArray | null $options = null, |
|
68 | 68 | ) { |
69 | 69 | $this->name = $name; |
70 | 70 | $this->columns = $columns; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function build(): string |
76 | 76 | { |
77 | 77 | $ret = $this->type . ' '; |
78 | - if (! empty($this->name)) { |
|
78 | + if (!empty($this->name)) { |
|
79 | 79 | $ret .= Context::escape($this->name) . ' '; |
80 | 80 | } |
81 | 81 |
@@ -52,9 +52,9 @@ |
||
52 | 52 | * @param OptionsArray $options the options of this data type |
53 | 53 | */ |
54 | 54 | public function __construct( |
55 | - string|null $name = null, |
|
55 | + string | null $name = null, |
|
56 | 56 | array $parameters = [], |
57 | - OptionsArray|null $options = null, |
|
57 | + OptionsArray | null $options = null, |
|
58 | 58 | ) { |
59 | 59 | $this->name = $name; |
60 | 60 | $this->parameters = $parameters; |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | |
34 | 34 | $options = []; |
35 | 35 | foreach ($this->options as $option) { |
36 | - if (! is_array($option)) { |
|
36 | + if (!is_array($option)) { |
|
37 | 37 | $options[] = $option; |
38 | 38 | } else { |
39 | 39 | $options[] = $option['name'] |
40 | - . (! empty($option['equals']) ? '=' : ' ') |
|
41 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
40 | + . (!empty($option['equals']) ? '=' : ' ') |
|
41 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | { |
57 | 57 | foreach ($this->options as $option) { |
58 | 58 | if (is_array($option)) { |
59 | - if (! strcasecmp($key, $option['name'])) { |
|
59 | + if (!strcasecmp($key, $option['name'])) { |
|
60 | 60 | return $getExpr ? $option['expr'] : $option['value']; |
61 | 61 | } |
62 | - } elseif (! strcasecmp($key, $option)) { |
|
62 | + } elseif (!strcasecmp($key, $option)) { |
|
63 | 63 | return true; |
64 | 64 | } |
65 | 65 | } |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | { |
79 | 79 | foreach ($this->options as $idx => $option) { |
80 | 80 | if (is_array($option)) { |
81 | - if (! strcasecmp($key, $option['name'])) { |
|
81 | + if (!strcasecmp($key, $option['name'])) { |
|
82 | 82 | unset($this->options[$idx]); |
83 | 83 | |
84 | 84 | return true; |
85 | 85 | } |
86 | - } elseif (! strcasecmp($key, $option)) { |
|
86 | + } elseif (!strcasecmp($key, $option)) { |
|
87 | 87 | unset($this->options[$idx]); |
88 | 88 | |
89 | 89 | return true; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * |
277 | 277 | * Used by all `CREATE` statements. |
278 | 278 | */ |
279 | - public Expression|null $name = null; |
|
279 | + public Expression | null $name = null; |
|
280 | 280 | |
281 | 281 | /** |
282 | 282 | * The options of the entity (table, procedure, function, etc.). |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @see CreateStatement::FUNCTION_OPTIONS |
288 | 288 | * @see CreateStatement::TRIGGER_OPTIONS |
289 | 289 | */ |
290 | - public OptionsArray|null $entityOptions = null; |
|
290 | + public OptionsArray | null $entityOptions = null; |
|
291 | 291 | |
292 | 292 | /** |
293 | 293 | * If `CREATE TABLE`, a list of columns and keys. |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * |
298 | 298 | * @var CreateDefinition[]|ArrayObj|null |
299 | 299 | */ |
300 | - public array|ArrayObj|null $fields = null; |
|
300 | + public array | ArrayObj | null $fields = null; |
|
301 | 301 | |
302 | 302 | /** |
303 | 303 | * If `CREATE TABLE WITH`. |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * |
307 | 307 | * Used by `CREATE TABLE`, `CREATE VIEW` |
308 | 308 | */ |
309 | - public WithStatement|null $with = null; |
|
309 | + public WithStatement | null $with = null; |
|
310 | 310 | |
311 | 311 | /** |
312 | 312 | * If `CREATE TABLE ... SELECT`. |
@@ -314,55 +314,55 @@ discard block |
||
314 | 314 | * |
315 | 315 | * Used by `CREATE TABLE`, `CREATE VIEW` |
316 | 316 | */ |
317 | - public SelectStatement|null $select = null; |
|
317 | + public SelectStatement | null $select = null; |
|
318 | 318 | |
319 | 319 | /** |
320 | 320 | * If `CREATE TABLE ... LIKE`. |
321 | 321 | * |
322 | 322 | * Used by `CREATE TABLE` |
323 | 323 | */ |
324 | - public Expression|null $like = null; |
|
324 | + public Expression | null $like = null; |
|
325 | 325 | |
326 | 326 | /** |
327 | 327 | * Expression used for partitioning. |
328 | 328 | */ |
329 | - public string|null $partitionBy = null; |
|
329 | + public string | null $partitionBy = null; |
|
330 | 330 | |
331 | 331 | /** |
332 | 332 | * The number of partitions. |
333 | 333 | */ |
334 | - public int|null $partitionsNum = null; |
|
334 | + public int | null $partitionsNum = null; |
|
335 | 335 | |
336 | 336 | /** |
337 | 337 | * Expression used for subpartitioning. |
338 | 338 | */ |
339 | - public string|null $subpartitionBy = null; |
|
339 | + public string | null $subpartitionBy = null; |
|
340 | 340 | |
341 | 341 | /** |
342 | 342 | * The number of subpartitions. |
343 | 343 | */ |
344 | - public int|null $subpartitionsNum = null; |
|
344 | + public int | null $subpartitionsNum = null; |
|
345 | 345 | |
346 | 346 | /** |
347 | 347 | * The partition of the new table. |
348 | 348 | * |
349 | 349 | * @var PartitionDefinition[]|null |
350 | 350 | */ |
351 | - public array|null $partitions = null; |
|
351 | + public array | null $partitions = null; |
|
352 | 352 | |
353 | 353 | /** |
354 | 354 | * If `CREATE TRIGGER` the name of the table. |
355 | 355 | * |
356 | 356 | * Used by `CREATE TRIGGER`. |
357 | 357 | */ |
358 | - public Expression|null $table = null; |
|
358 | + public Expression | null $table = null; |
|
359 | 359 | |
360 | 360 | /** |
361 | 361 | * The return data type of this routine. |
362 | 362 | * |
363 | 363 | * Used by `CREATE FUNCTION`. |
364 | 364 | */ |
365 | - public DataType|null $return = null; |
|
365 | + public DataType | null $return = null; |
|
366 | 366 | |
367 | 367 | /** |
368 | 368 | * The parameters of this routine. |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | * |
372 | 372 | * @var ParameterDefinition[]|null |
373 | 373 | */ |
374 | - public array|null $parameters = null; |
|
374 | + public array | null $parameters = null; |
|
375 | 375 | |
376 | 376 | /** |
377 | 377 | * The body of this function or procedure. |
@@ -424,23 +424,23 @@ discard block |
||
424 | 424 | |
425 | 425 | $partition = ''; |
426 | 426 | |
427 | - if (! empty($this->partitionBy)) { |
|
427 | + if (!empty($this->partitionBy)) { |
|
428 | 428 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
429 | 429 | } |
430 | 430 | |
431 | - if (! empty($this->partitionsNum)) { |
|
431 | + if (!empty($this->partitionsNum)) { |
|
432 | 432 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
433 | 433 | } |
434 | 434 | |
435 | - if (! empty($this->subpartitionBy)) { |
|
435 | + if (!empty($this->subpartitionBy)) { |
|
436 | 436 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
437 | 437 | } |
438 | 438 | |
439 | - if (! empty($this->subpartitionsNum)) { |
|
439 | + if (!empty($this->subpartitionsNum)) { |
|
440 | 440 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
441 | 441 | } |
442 | 442 | |
443 | - if (! empty($this->partitions)) { |
|
443 | + if (!empty($this->partitions)) { |
|
444 | 444 | $partition .= "\n" . PartitionDefinitions::buildAll($this->partitions); |
445 | 445 | } |
446 | 446 | |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $token = $list->getNextOfType(TokenType::Number); |
631 | 631 | --$list->idx; // `getNextOfType` also advances one position. |
632 | 632 | $this->subpartitionsNum = $token->value; |
633 | - } elseif (! empty($field)) { |
|
633 | + } elseif (!empty($field)) { |
|
634 | 634 | /* |
635 | 635 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
636 | 636 | */ |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $field = null; |
660 | 660 | } |
661 | 661 | } elseif (($token->type === TokenType::Operator) && ($token->value === '(')) { |
662 | - if (! empty($this->partitionBy)) { |
|
662 | + if (!empty($this->partitionBy)) { |
|
663 | 663 | $this->partitions = ArrayObjs::parse( |
664 | 664 | $parser, |
665 | 665 | $list, |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | if ($statement instanceof TransactionStatement) { |
67 | 67 | $this->assertNotNull($statement->statements); |
68 | 68 | foreach ($statement->statements as $transactionStatement) { |
69 | - if (! $transactionStatement instanceof SetStatement) { |
|
69 | + if (!$transactionStatement instanceof SetStatement) { |
|
70 | 70 | continue; |
71 | 71 | } |
72 | 72 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | continue; |
77 | 77 | } |
78 | 78 | |
79 | - if (! $statement instanceof SetStatement) { |
|
79 | + if (!$statement instanceof SetStatement) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | 82 |