@@ -149,14 +149,14 @@ |
||
| 149 | 149 | * |
| 150 | 150 | * @var Expression[]|null |
| 151 | 151 | */ |
| 152 | - public array|null $columnNamesOrUserVariables = null; |
|
| 152 | + public array | null $columnNamesOrUserVariables = null; |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * SET clause's updated values(optional). |
| 156 | 156 | * |
| 157 | 157 | * @var SetOperation[]|null |
| 158 | 158 | */ |
| 159 | - public array|null $set = null; |
|
| 159 | + public array | null $set = null; |
|
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | 162 | * Ignore 'number' LINES/ROWS. |
@@ -106,28 +106,28 @@ discard block |
||
| 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. |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | * |
| 142 | 142 | * @var Condition[]|null |
| 143 | 143 | */ |
| 144 | - public array|null $where = null; |
|
| 144 | + public array | null $where = null; |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Specifies the order of the rows in the result set. |
| 148 | 148 | * |
| 149 | 149 | * @var OrderKeyword[]|null |
| 150 | 150 | */ |
| 151 | - public array|null $order = null; |
|
| 151 | + public array | null $order = null; |
|
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * Conditions used for limiting the size of the result set. |
@@ -391,28 +391,28 @@ discard block |
||
| 391 | 391 | $expressions = $this->from; |
| 392 | 392 | |
| 393 | 393 | // Adding expressions from JOIN. |
| 394 | - if (! empty($this->join)) { |
|
| 394 | + if (!empty($this->join)) { |
|
| 395 | 395 | foreach ($this->join as $join) { |
| 396 | 396 | $expressions[] = $join->expr; |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | foreach ($expressions as $expr) { |
| 401 | - if (! isset($expr->table) || ($expr->table === '')) { |
|
| 401 | + if (!isset($expr->table) || ($expr->table === '')) { |
|
| 402 | 402 | continue; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | $thisDb = isset($expr->database) && ($expr->database !== '') ? |
| 406 | 406 | $expr->database : $database; |
| 407 | 407 | |
| 408 | - if (! isset($retval[$thisDb])) { |
|
| 408 | + if (!isset($retval[$thisDb])) { |
|
| 409 | 409 | $retval[$thisDb] = [ |
| 410 | 410 | 'alias' => null, |
| 411 | 411 | 'tables' => [], |
| 412 | 412 | ]; |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | - if (! isset($retval[$thisDb]['tables'][$expr->table])) { |
|
| 415 | + if (!isset($retval[$thisDb]['tables'][$expr->table])) { |
|
| 416 | 416 | $retval[$thisDb]['tables'][$expr->table] = [ |
| 417 | 417 | 'alias' => isset($expr->alias) && ($expr->alias !== '') ? |
| 418 | 418 | $expr->alias : null, |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | ]; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | - if (! isset($tables[$thisDb])) { |
|
| 423 | + if (!isset($tables[$thisDb])) { |
|
| 424 | 424 | $tables[$thisDb] = []; |
| 425 | 425 | } |
| 426 | 426 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | foreach ($this->expr as $expr) { |
| 431 | - if (! isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '')) { |
|
| 431 | + if (!isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '')) { |
|
| 432 | 432 | continue; |
| 433 | 433 | } |
| 434 | 434 | |
@@ -20,17 +20,17 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * The type of hint (USE/FORCE/IGNORE) |
| 22 | 22 | */ |
| 23 | - public string|null $type; |
|
| 23 | + public string | null $type; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * What the hint is for (INDEX/KEY) |
| 27 | 27 | */ |
| 28 | - public string|null $indexOrKey; |
|
| 28 | + public string | null $indexOrKey; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * The clause for which this hint is (JOIN/ORDER BY/GROUP BY) |
| 32 | 32 | */ |
| 33 | - public string|null $for; |
|
| 33 | + public string | null $for; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * List of indexes in this hint |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | * @param Expression[] $indexes List of indexes in this hint |
| 47 | 47 | */ |
| 48 | 48 | public function __construct( |
| 49 | - string|null $type = null, |
|
| 50 | - string|null $indexOrKey = null, |
|
| 51 | - string|null $for = null, |
|
| 49 | + string | null $type = null, |
|
| 50 | + string | null $indexOrKey = null, |
|
| 51 | + string | null $for = null, |
|
| 52 | 52 | array $indexes = [] |
| 53 | 53 | ) { |
| 54 | 54 | $this->type = $type; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @var ArrayObj[]|null |
| 65 | 65 | */ |
| 66 | - public array|null $values = null; |
|
| 66 | + public array | null $values = null; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * If SET clause is present |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @var SetOperation[]|null |
| 73 | 73 | */ |
| 74 | - public array|null $set = null; |
|
| 74 | + public array | null $set = null; |
|
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * If SELECT clause is present |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * Test for loading closest SQL context |
| 31 | 31 | */ |
| 32 | 32 | #[DataProvider('contextLoadingProvider')] |
| 33 | - public function testLoadClosest(string $context, string|null $expected): void |
|
| 33 | + public function testLoadClosest(string $context, string | null $expected): void |
|
| 34 | 34 | { |
| 35 | 35 | $this->assertEquals($expected, Context::loadClosest($context)); |
| 36 | 36 | if ($expected !== null) { |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | * Test access to string. |
| 87 | 87 | */ |
| 88 | 88 | #[DataProvider('utf8StringsProvider')] |
| 89 | - public function testAccess(string $text, string|null $pos10, string|null $pos20): void |
|
| 89 | + public function testAccess(string $text, string | null $pos10, string | null $pos20): void |
|
| 90 | 90 | { |
| 91 | 91 | $str = new UtfString($text); |
| 92 | 92 | $this->assertEquals($pos10, $str->offsetGet(10)); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @var ArrayObj[]|null |
| 79 | 79 | */ |
| 80 | - public array|null $values = null; |
|
| 80 | + public array | null $values = null; |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * If SET clause is present |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @var SetOperation[]|null |
| 87 | 87 | */ |
| 88 | - public array|null $set = null; |
|
| 88 | + public array | null $set = null; |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * If SELECT clause is present |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @var SetOperation[]|null |
| 111 | 111 | */ |
| 112 | - public array|null $onDuplicateSet = null; |
|
| 112 | + public array | null $onDuplicateSet = null; |
|
| 113 | 113 | |
| 114 | 114 | public function build(): string |
| 115 | 115 | { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // The code below extracts only the relevant information. |
| 84 | 84 | |
| 85 | 85 | // Extracting lexer's errors. |
| 86 | - if (! empty($lexer->errors)) { |
|
| 86 | + if (!empty($lexer->errors)) { |
|
| 87 | 87 | /** @var LexerException $err */ |
| 88 | 88 | foreach ($lexer->errors as $err) { |
| 89 | 89 | $lexerErrors[] = [ |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Extracting parser's errors. |
| 101 | - if (! empty($parser->errors)) { |
|
| 101 | + if (!empty($parser->errors)) { |
|
| 102 | 102 | /** @var ParserException $err */ |
| 103 | 103 | foreach ($parser->errors as $err) { |
| 104 | 104 | $parserErrors[] = [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public static function build($type, $input, $output, $debug = null, $ansi = false): void |
| 137 | 137 | { |
| 138 | 138 | // Support query types: `lexer` / `parser`. |
| 139 | - if (! in_array($type, ['lexer', 'parser'])) { |
|
| 139 | + if (!in_array($type, ['lexer', 'parser'])) { |
|
| 140 | 140 | throw new Exception('Unknown test type (expected `lexer` or `parser`).'); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | 183 | // Remove the project path from .out file, it changes for each dev |
| 184 | - $projectFolder = dirname(__DIR__, 2);// Jump to root |
|
| 184 | + $projectFolder = dirname(__DIR__, 2); // Jump to root |
|
| 185 | 185 | $encoded = str_replace($projectFolder, '<project-root>', $encoded); |
| 186 | 186 | |
| 187 | 187 | file_put_contents($output, $encoded); |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | if (is_dir($inputFile)) { |
| 220 | 220 | // Creating required directories to maintain the structure. |
| 221 | 221 | // Ignoring errors if the folder structure exists already. |
| 222 | - if (! is_dir($outputFile)) { |
|
| 222 | + if (!is_dir($outputFile)) { |
|
| 223 | 223 | mkdir($outputFile); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if (($debug !== null) && (! is_dir($debugFile))) { |
|
| 226 | + if (($debug !== null) && (!is_dir($debugFile))) { |
|
| 227 | 227 | mkdir($debugFile); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // Building the test. |
| 241 | - if (! file_exists($outputFile)) { |
|
| 241 | + if (!file_exists($outputFile)) { |
|
| 242 | 242 | echo sprintf("Building test for %s...\n", $inputFile); |
| 243 | 243 | static::build( |
| 244 | 244 | str_contains($inputFile, 'lex') ? 'lexer' : 'parser', |