@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | class CLITest extends TestCase |
| 17 | 17 | { |
| 18 | 18 | /** @param array<string, bool|string>|false $getopt */ |
| 19 | - private function getCLI(array|false $getopt): CLI |
|
| 19 | + private function getCLI(array | false $getopt): CLI |
|
| 20 | 20 | { |
| 21 | 21 | $cli = $this->createPartialMock(CLI::class, ['getopt']); |
| 22 | 22 | $cli->method('getopt')->willReturn($getopt); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** @param array<string, bool|string>|false $getopt */ |
| 28 | - private function getCLIStdIn(string $input, array|false $getopt): CLI |
|
| 28 | + private function getCLIStdIn(string $input, array | false $getopt): CLI |
|
| 29 | 29 | { |
| 30 | 30 | $cli = $this->createPartialMock(CLI::class, ['getopt', 'readStdin']); |
| 31 | 31 | $cli->method('getopt')->willReturn($getopt); |
@@ -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); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * The name of the data type. |
| 20 | 20 | */ |
| 21 | - public string|null $name = null; |
|
| 21 | + public string | null $name = null; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * The parameters of this data type. |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * The options of this data type. |
| 40 | 40 | */ |
| 41 | - public OptionsArray|null $options = null; |
|
| 41 | + public OptionsArray | null $options = null; |
|
| 42 | 42 | |
| 43 | 43 | public bool $lowercase = false; |
| 44 | 44 | |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | * @param OptionsArray|null $options the options of this data type |
| 49 | 49 | */ |
| 50 | 50 | public function __construct( |
| 51 | - string|null $name = null, |
|
| 51 | + string | null $name = null, |
|
| 52 | 52 | array $parameters = [], |
| 53 | - OptionsArray|null $options = null, |
|
| 53 | + OptionsArray | null $options = null, |
|
| 54 | 54 | ) { |
| 55 | 55 | $this->name = $name; |
| 56 | 56 | $this->parameters = $parameters; |
@@ -16,12 +16,12 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * The table to be locked. |
| 18 | 18 | */ |
| 19 | - public Expression|null $table = null; |
|
| 19 | + public Expression | null $table = null; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * The type of lock to be applied. |
| 23 | 23 | */ |
| 24 | - public string|null $type = null; |
|
| 24 | + public string | null $type = null; |
|
| 25 | 25 | |
| 26 | 26 | public function build(): string |
| 27 | 27 | { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * The expression that is used for ordering. |
| 16 | 16 | */ |
| 17 | - public Expression|null $expr = null; |
|
| 17 | + public Expression | null $expr = null; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * The order type. |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @param Expression|null $expr the expression that we are sorting by |
| 26 | 26 | * @param string $type the sorting type |
| 27 | 27 | */ |
| 28 | - public function __construct(Expression|null $expr = null, string $type = 'ASC') |
|
| 28 | + public function __construct(Expression | null $expr = null, string $type = 'ASC') |
|
| 29 | 29 | { |
| 30 | 30 | $this->expr = $expr; |
| 31 | 31 | $this->type = $type; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public string $expr; |
| 29 | 29 | |
| 30 | 30 | /** @param string $expr the condition or the operator */ |
| 31 | - public function __construct(string|null $expr = null) |
|
| 31 | + public function __construct(string | null $expr = null) |
|
| 32 | 32 | { |
| 33 | 33 | $this->expr = trim((string) $expr); |
| 34 | 34 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** @var ArrayObj[] */ |
| 18 | 18 | public array $columns = []; |
| 19 | 19 | |
| 20 | - public Parser|null $statement = null; |
|
| 20 | + public Parser | null $statement = null; |
|
| 21 | 21 | |
| 22 | 22 | public function __construct(public string $name) |
| 23 | 23 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function build(): string |
| 27 | 27 | { |
| 28 | - if (! isset($this->statement)) { |
|
| 28 | + if (!isset($this->statement)) { |
|
| 29 | 29 | throw new RuntimeException('No statement inside WITH'); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -54,45 +54,45 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * Type of target (OUTFILE or SYMBOL). |
| 56 | 56 | */ |
| 57 | - public string|null $type = null; |
|
| 57 | + public string | null $type = null; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * The destination, which can be a table or a file. |
| 61 | 61 | */ |
| 62 | - public string|Expression|null $dest = null; |
|
| 62 | + public string | Expression | null $dest = null; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * The name of the columns. |
| 66 | 66 | * |
| 67 | 67 | * @var string[]|null |
| 68 | 68 | */ |
| 69 | - public array|null $columns = null; |
|
| 69 | + public array | null $columns = null; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * The values to be selected into (SELECT .. INTO @var1). |
| 73 | 73 | * |
| 74 | 74 | * @var Expression[]|null |
| 75 | 75 | */ |
| 76 | - public array|null $values = null; |
|
| 76 | + public array | null $values = null; |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Options for FIELDS/COLUMNS keyword. |
| 80 | 80 | * |
| 81 | 81 | * @see IntoKeyword::STATEMENT_FIELDS_OPTIONS |
| 82 | 82 | */ |
| 83 | - public OptionsArray|null $fieldsOptions = null; |
|
| 83 | + public OptionsArray | null $fieldsOptions = null; |
|
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * Whether to use `FIELDS` or `COLUMNS` while building. |
| 87 | 87 | */ |
| 88 | - public bool|null $fieldsKeyword = null; |
|
| 88 | + public bool | null $fieldsKeyword = null; |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Options for OPTIONS keyword. |
| 92 | 92 | * |
| 93 | 93 | * @see IntoKeyword::STATEMENT_LINES_OPTIONS |
| 94 | 94 | */ |
| 95 | - public OptionsArray|null $linesOptions = null; |
|
| 95 | + public OptionsArray | null $linesOptions = null; |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * @param string|null $type type of destination (may be OUTFILE) |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | * @param bool|null $fieldsKeyword options for OPTIONS keyword |
| 104 | 104 | */ |
| 105 | 105 | public function __construct( |
| 106 | - string|null $type = null, |
|
| 107 | - string|Expression|null $dest = null, |
|
| 108 | - array|null $columns = null, |
|
| 109 | - array|null $values = null, |
|
| 110 | - OptionsArray|null $fieldsOptions = null, |
|
| 111 | - bool|null $fieldsKeyword = null, |
|
| 106 | + string | null $type = null, |
|
| 107 | + string | Expression | null $dest = null, |
|
| 108 | + array | null $columns = null, |
|
| 109 | + array | null $values = null, |
|
| 110 | + OptionsArray | null $fieldsOptions = null, |
|
| 111 | + bool | null $fieldsKeyword = null, |
|
| 112 | 112 | ) { |
| 113 | 113 | $this->type = $type; |
| 114 | 114 | $this->dest = $dest; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | public function build(): string |
| 142 | 142 | { |
| 143 | 143 | if ($this->dest instanceof Expression) { |
| 144 | - $columns = ! empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 144 | + $columns = !empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 145 | 145 | |
| 146 | 146 | return $this->dest . $columns; |
| 147 | 147 | } |
@@ -17,24 +17,24 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * The name of the new column. |
| 19 | 19 | */ |
| 20 | - public string|null $name = null; |
|
| 20 | + public string | null $name = null; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Parameter's direction (IN, OUT or INOUT). |
| 24 | 24 | */ |
| 25 | - public string|null $inOut = null; |
|
| 25 | + public string | null $inOut = null; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * The data type of thew new column. |
| 29 | 29 | */ |
| 30 | - public DataType|null $type = null; |
|
| 30 | + public DataType | null $type = null; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @param string|null $name parameter's name |
| 34 | 34 | * @param string|null $inOut parameter's directional type (IN / OUT or None) |
| 35 | 35 | * @param DataType|null $type parameter's type |
| 36 | 36 | */ |
| 37 | - public function __construct(string|null $name = null, string|null $inOut = null, DataType|null $type = null) |
|
| 37 | + public function __construct(string | null $name = null, string | null $inOut = null, DataType | null $type = null) |
|
| 38 | 38 | { |
| 39 | 39 | $this->name = $name; |
| 40 | 40 | $this->inOut = $inOut; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | public function build(): string |
| 45 | 45 | { |
| 46 | 46 | $tmp = ''; |
| 47 | - if (! empty($this->inOut)) { |
|
| 47 | + if (!empty($this->inOut)) { |
|
| 48 | 48 | $tmp .= $this->inOut . ' '; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -40,24 +40,24 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @see JoinKeyword::JOINS |
| 42 | 42 | */ |
| 43 | - public string|null $type = null; |
|
| 43 | + public string | null $type = null; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Join expression. |
| 47 | 47 | */ |
| 48 | - public Expression|null $expr = null; |
|
| 48 | + public Expression | null $expr = null; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Join conditions. |
| 52 | 52 | * |
| 53 | 53 | * @var Condition[]|null |
| 54 | 54 | */ |
| 55 | - public array|null $on = null; |
|
| 55 | + public array | null $on = null; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Columns in Using clause. |
| 59 | 59 | */ |
| 60 | - public ArrayObj|null $using = null; |
|
| 60 | + public ArrayObj | null $using = null; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @see JoinKeyword::JOINS |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | * @param ArrayObj|null $using columns joined |
| 69 | 69 | */ |
| 70 | 70 | public function __construct( |
| 71 | - string|null $type = null, |
|
| 72 | - Expression|null $expr = null, |
|
| 73 | - array|null $on = null, |
|
| 74 | - ArrayObj|null $using = null, |
|
| 71 | + string | null $type = null, |
|
| 72 | + Expression | null $expr = null, |
|
| 73 | + array | null $on = null, |
|
| 74 | + ArrayObj | null $using = null, |
|
| 75 | 75 | ) { |
| 76 | 76 | $this->type = $type; |
| 77 | 77 | $this->expr = $expr; |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | public function build(): string |
| 83 | 83 | { |
| 84 | 84 | return array_search($this->type, self::JOINS) . ' ' . $this->expr |
| 85 | - . (! empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') |
|
| 86 | - . (! empty($this->using) ? ' USING ' . $this->using->build() : ''); |
|
| 85 | + . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') |
|
| 86 | + . (!empty($this->using) ? ' USING ' . $this->using->build() : ''); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function __toString(): string |