Completed
Push — master ( 885755...1f0c92 )
by Maurício
19s queued 16s
created
src/Statements/CreateStatement.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
tests/Parser/ParserLongExportsTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
76 76
                 continue;
77 77
             }
78 78
 
79
-            if (! $statement instanceof SetStatement) {
79
+            if (!$statement instanceof SetStatement) {
80 80
                 continue;
81 81
             }
82 82
 
Please login to merge, or discard this patch.
src/Token.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * The value this token contains (i.e. token after some evaluation).
72 72
      */
73
-    public bool|float|int|string $value;
73
+    public bool | float | int | string $value;
74 74
 
75 75
     /**
76 76
      * The keyword value this token contains, always uppercase.
77 77
      */
78
-    public string|null $keyword = null;
78
+    public string | null $keyword = null;
79 79
 
80 80
     /**
81 81
      * The type of this token.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      * The position is counted in chars, not bytes, so you should
94 94
      * use mb_* functions to properly handle utf-8 multibyte chars.
95 95
      */
96
-    public int|null $position = null;
96
+    public int | null $position = null;
97 97
 
98 98
     /**
99 99
      * @param string    $token the value of the token
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
      *
114 114
      * If no processing can be done it will return the initial string.
115 115
      */
116
-    public function extract(): bool|float|int|string
116
+    public function extract(): bool | float | int | string
117 117
     {
118 118
         switch ($this->type) {
119 119
             case TokenType::Keyword:
120 120
                 $this->keyword = strtoupper($this->token);
121
-                if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) {
121
+                if (!($this->flags & self::FLAG_KEYWORD_RESERVED)) {
122 122
                     // Unreserved keywords should stay the way they are because they
123 123
                     // might represent field names.
124 124
                     return $this->token;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     }
144 144
                 } elseif (($this->flags & self::FLAG_NUMBER_APPROXIMATE) || ($this->flags & self::FLAG_NUMBER_FLOAT)) {
145 145
                     $ret = (float) $ret;
146
-                } elseif (! ($this->flags & self::FLAG_NUMBER_BINARY)) {
146
+                } elseif (!($this->flags & self::FLAG_NUMBER_BINARY)) {
147 147
                     $ret = (int) $ret;
148 148
                 }
149 149
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                     // in PHP 5.3- the `null` parameter isn't handled correctly.
179 179
                     $str = mb_substr(
180 180
                         $str,
181
-                        ! empty($str[1]) && ($str[1] === '@') ? 2 : 1,
181
+                        !empty($str[1]) && ($str[1] === '@') ? 2 : 1,
182 182
                         mb_strlen($str),
183 183
                         'UTF-8',
184 184
                     );
Please login to merge, or discard this patch.
src/Statements/PurgeStatement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * The type of logs
28 28
      */
29
-    public string|null $logType = null;
29
+    public string | null $logType = null;
30 30
 
31 31
     /**
32 32
      * The end option of this query.
33 33
      */
34
-    public string|null $endOption = null;
34
+    public string | null $endOption = null;
35 35
 
36 36
     /**
37 37
      * The end expr of this query.
38 38
      */
39
-    public Expression|null $endExpr = null;
39
+    public Expression | null $endExpr = null;
40 40
 
41 41
     public function build(): string
42 42
     {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @param Token    $token            token to be parsed
118 118
      * @param string[] $expectedKeywords array of possibly expected keywords at this point
119 119
      */
120
-    private static function parseExpectedKeyword(Parser $parser, Token $token, array $expectedKeywords): string|null
120
+    private static function parseExpectedKeyword(Parser $parser, Token $token, array $expectedKeywords): string | null
121 121
     {
122 122
         if ($token->type === TokenType::Keyword) {
123 123
             if (in_array($token->keyword, $expectedKeywords)) {
Please login to merge, or discard this patch.
tests/Utils/CLITest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Components/DataType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Components/LockExpression.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Components/OrderKeyword.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Components/Condition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.