Completed
Push — master ( 25a071...fe490d )
by Maurício
24s queued 20s
created
src/Components/Condition.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     /**
81 81
      * @param string $expr the condition or the operator
82 82
      */
83
-    public function __construct(string|null $expr = null)
83
+    public function __construct(string | null $expr = null)
84 84
     {
85 85
         $this->expr = trim((string) $expr);
86 86
     }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                 } else {
148 148
                     // The expression ended.
149 149
                     $expr->expr = trim($expr->expr);
150
-                    if (! empty($expr->expr)) {
150
+                    if (!empty($expr->expr)) {
151 151
                         $ret[] = $expr;
152 152
                     }
153 153
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             if (
166 166
                 ($token->type === TokenType::Keyword)
167 167
                 && ($token->flags & Token::FLAG_KEYWORD_RESERVED)
168
-                && ! ($token->flags & Token::FLAG_KEYWORD_FUNCTION)
168
+                && !($token->flags & Token::FLAG_KEYWORD_FUNCTION)
169 169
             ) {
170 170
                 if ($token->value === 'BETWEEN') {
171 171
                     $betweenBefore = true;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         // Last iteration was not processed.
210 210
         $expr->expr = trim($expr->expr);
211
-        if (! empty($expr->expr)) {
211
+        if (!empty($expr->expr)) {
212 212
             $ret[] = $expr;
213 213
         }
214 214
 
Please login to merge, or discard this patch.
src/Components/GroupKeyword.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
 final class GroupKeyword implements Component
19 19
 {
20 20
     /** @var 'ASC'|'DESC'|null */
21
-    public string|null $type = null;
21
+    public string | null $type = null;
22 22
 
23 23
     /**
24 24
      * The expression that is used for grouping.
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * @param Expression $expr the expression that we are sorting by
32 32
      */
33
-    public function __construct(Expression|null $expr = null)
33
+    public function __construct(Expression | null $expr = null)
34 34
     {
35 35
         $this->expr = $expr;
36 36
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 ) {
89 89
                     $expr->type = $token->keyword;
90 90
                 } elseif (($token->type === TokenType::Operator) && ($token->value === ',')) {
91
-                    if (! empty($expr->expr)) {
91
+                    if (!empty($expr->expr)) {
92 92
                         $ret[] = $expr;
93 93
                     }
94 94
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         }
102 102
 
103 103
         // Last iteration was not processed.
104
-        if (! empty($expr->expr)) {
104
+        if (!empty($expr->expr)) {
105 105
             $ret[] = $expr;
106 106
         }
107 107
 
Please login to merge, or discard this patch.
src/Components/AlterOperation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
      * @param Token[]                    $unknown    unparsed tokens found at the end of operation
265 265
      */
266 266
     public function __construct(
267
-        OptionsArray|null $options = null,
268
-        Expression|string|null $field = null,
269
-        array|null $partitions = null,
267
+        OptionsArray | null $options = null,
268
+        Expression | string | null $field = null,
269
+        array | null $partitions = null,
270 270
         public array $unknown = []
271 271
     ) {
272 272
         $this->partitions = $partitions;
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                     } elseif (($token->value === ',') && ($brackets === 0)) {
402 402
                         break;
403 403
                     }
404
-                } elseif (! self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) {
404
+                } elseif (!self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) {
405 405
                     if (isset(Parser::STATEMENT_PARSERS[$arrayKey]) && Parser::STATEMENT_PARSERS[$arrayKey] !== '') {
406 406
                         $list->idx++; // Ignore the current token
407 407
                         $nextToken = $list->getNext();
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                     } elseif (
425 425
                         (array_key_exists($arrayKey, self::DATABASE_OPTIONS)
426 426
                         || array_key_exists($arrayKey, self::TABLE_OPTIONS))
427
-                        && ! self::checkIfColumnDefinitionKeyword($arrayKey)
427
+                        && !self::checkIfColumnDefinitionKeyword($arrayKey)
428 428
                     ) {
429 429
                         // This alter operation has finished, which means a comma
430 430
                         // was missing before start of new alter operation
Please login to merge, or discard this patch.
src/Components/Expression.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
      * @param string|null $alias    the name of the alias
112 112
      */
113 113
     public function __construct(
114
-        string|null $database = null,
115
-        string|null $table = null,
116
-        string|null $column = null,
117
-        string|null $alias = null
114
+        string | null $database = null,
115
+        string | null $table = null,
116
+        string | null $column = null,
117
+        string | null $alias = null
118 118
     ) {
119 119
         if (($column === null) && ($alias === null)) {
120 120
             $this->expr = $database; // case 1
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * @throws ParserException
161 161
      */
162
-    public static function parse(Parser $parser, TokensList $list, array $options = []): Expression|null
162
+    public static function parse(Parser $parser, TokensList $list, array $options = []): Expression | null
163 163
     {
164 164
         $ret = new static();
165 165
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         ];
203 203
 
204 204
         // When a field is parsed, no parentheses are expected.
205
-        if (! empty($options['parseField'])) {
205
+        if (!empty($options['parseField'])) {
206 206
             $options['breakOnParentheses'] = true;
207 207
             $options['field'] = $options['parseField'];
208 208
         }
@@ -229,14 +229,14 @@  discard block
 block discarded – undo
229 229
             }
230 230
 
231 231
             if ($token->type === TokenType::Keyword) {
232
-                if (($brackets > 0) && empty($ret->subquery) && ! empty(Parser::STATEMENT_PARSERS[$token->keyword])) {
232
+                if (($brackets > 0) && empty($ret->subquery) && !empty(Parser::STATEMENT_PARSERS[$token->keyword])) {
233 233
                     // A `(` was previously found and this keyword is the
234 234
                     // beginning of a statement, so this is a subquery.
235 235
                     $ret->subquery = $token->keyword;
236 236
                 } elseif (
237 237
                     ($token->flags & Token::FLAG_KEYWORD_FUNCTION)
238 238
                     && (empty($options['parseField'])
239
-                    && ! $alias)
239
+                    && !$alias)
240 240
                 ) {
241 241
                     $isExpr = true;
242 242
                 } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) && ($brackets === 0)) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     }
249 249
 
250 250
                     if ($token->keyword === 'AS') {
251
-                        if (! empty($options['breakOnAlias'])) {
251
+                        if (!empty($options['breakOnAlias'])) {
252 252
                             break;
253 253
                         }
254 254
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                     }
272 272
 
273 273
                     $isExpr = true;
274
-                } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias) {
274
+                } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && !$alias) {
275 275
                     /* End of expression */
276 276
                     break;
277 277
                 }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 || (($token->type === TokenType::Operator)
288 288
                 && ($token->value !== '.'))
289 289
             ) {
290
-                if (! empty($options['parseField'])) {
290
+                if (!empty($options['parseField'])) {
291 291
                     break;
292 292
                 }
293 293
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             }
298 298
 
299 299
             if ($token->type === TokenType::Operator) {
300
-                if (! empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) {
300
+                if (!empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) {
301 301
                     // No brackets were expected.
302 302
                     break;
303 303
                 }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
                     --$brackets;
323 323
                     if ($brackets === 0) {
324
-                        if (! empty($options['parenthesesDelimited'])) {
324
+                        if (!empty($options['parenthesesDelimited'])) {
325 325
                             // The current token is the last bracket, the next
326 326
                             // one will be outside the expression.
327 327
                             $ret->expr .= $token->token;
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
             if ($alias) {
349 349
                 // An alias is expected (the keyword `AS` was previously found).
350
-                if (! empty($ret->alias)) {
350
+                if (!empty($ret->alias)) {
351 351
                     $parser->error('An alias was previously found.', $token);
352 352
                     break;
353 353
                 }
@@ -361,15 +361,15 @@  discard block
 block discarded – undo
361 361
                     && ($prev[0] === null
362 362
                         || (($prev[0]->type !== TokenType::Operator || $prev[0]->token === ')')
363 363
                             && ($prev[0]->type !== TokenType::Keyword
364
-                                || ! ($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))
364
+                                || !($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))
365 365
                     && (($prev[1]->type === TokenType::String)
366 366
                         || ($prev[1]->type === TokenType::Symbol
367
-                            && ! ($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)
368
-                            && ! ($prev[1]->flags & Token::FLAG_SYMBOL_PARAMETER))
367
+                            && !($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)
368
+                            && !($prev[1]->flags & Token::FLAG_SYMBOL_PARAMETER))
369 369
                         || ($prev[1]->type === TokenType::None
370 370
                             && $prev[1]->token !== 'OVER'))
371 371
                 ) {
372
-                    if (! empty($ret->alias)) {
372
+                    if (!empty($ret->alias)) {
373 373
                         $parser->error('An alias was previously found.', $token);
374 374
                         break;
375 375
                     }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     // Found a `.` which means we expect a column name and
401 401
                     // the column name we parsed is actually the table name
402 402
                     // and the table name is actually a database name.
403
-                    if (! empty($ret->database) || $dot) {
403
+                    if (!empty($ret->database) || $dot) {
404 404
                         $parser->error('Unexpected dot.', $token);
405 405
                     }
406 406
 
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
                         $dot = false;
418 418
                     } else {
419 419
                         // No alias is expected.
420
-                        if (! empty($options['breakOnAlias'])) {
420
+                        if (!empty($options['breakOnAlias'])) {
421 421
                             break;
422 422
                         }
423 423
 
424
-                        if (! empty($ret->alias)) {
424
+                        if (!empty($ret->alias)) {
425 425
                             $parser->error('An alias was previously found.', $token);
426 426
                             break;
427 427
                         }
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
             $ret = implode('.', Context::escapeAll($fields));
470 470
         }
471 471
 
472
-        if (! empty($this->alias)) {
472
+        if (!empty($this->alias)) {
473 473
             $ret .= ' AS ' . Context::escape($this->alias);
474 474
         }
475 475
 
Please login to merge, or discard this patch.
src/Components/ParameterDefinition.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param string   $inOut parameter's directional type (IN / OUT or None)
45 45
      * @param DataType $type  parameter's type
46 46
      */
47
-    public function __construct(string|null $name = null, string|null $inOut = null, DataType|null $type = null)
47
+    public function __construct(string | null $name = null, string | null $inOut = null, DataType | null $type = null)
48 48
     {
49 49
         $this->name = $name;
50 50
         $this->inOut = $inOut;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function build(): string
143 143
     {
144 144
         $tmp = '';
145
-        if (! empty($this->inOut)) {
145
+        if (!empty($this->inOut)) {
146 146
             $tmp .= $this->inOut . ' ';
147 147
         }
148 148
 
Please login to merge, or discard this patch.
src/Components/Reference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
      * @param string[]     $columns the columns referenced
63 63
      * @param OptionsArray $options the options
64 64
      */
65
-    public function __construct(Expression|null $table = null, array $columns = [], OptionsArray|null $options = null)
65
+    public function __construct(Expression | null $table = null, array $columns = [], OptionsArray | null $options = null)
66 66
     {
67 67
         $this->table = $table;
68 68
         $this->columns = $columns;
Please login to merge, or discard this patch.
src/Components/Key.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
      * @phpstan-param array{name?: string, length?: int, order?: string}[] $columns
106 106
      */
107 107
     public function __construct(
108
-        string|null $name = null,
108
+        string | null $name = null,
109 109
         array $columns = [],
110
-        string|null $type = null,
111
-        OptionsArray|null $options = null
110
+        string | null $type = null,
111
+        OptionsArray | null $options = null
112 112
     ) {
113 113
         $this->name = $name;
114 114
         $this->columns = $columns;
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
             } elseif ($state === 1) {
175 175
                 if (($token->type === TokenType::Operator) && ($token->value === '(')) {
176 176
                     $positionBeforeSearch = $list->idx;
177
-                    $list->idx++;// Ignore the current token "(" or the search condition will always be true
177
+                    $list->idx++; // Ignore the current token "(" or the search condition will always be true
178 178
                     $nextToken = $list->getNext();
179
-                    $list->idx = $positionBeforeSearch;// Restore the position
179
+                    $list->idx = $positionBeforeSearch; // Restore the position
180 180
 
181 181
                     if ($nextToken !== null && $nextToken->value === '(') {
182 182
                         // Switch to expression mode
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                 if ($token->type === TokenType::Operator) {
226 226
                     // This got back to here and we reached the end of the expression
227 227
                     if ($token->value === ')') {
228
-                        $state = 4;// go back to state 4 to fetch options
228
+                        $state = 4; // go back to state 4 to fetch options
229 229
                         continue;
230 230
                     }
231 231
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     public function build(): string
262 262
     {
263 263
         $ret = $this->type . ' ';
264
-        if (! empty($this->name)) {
264
+        if (!empty($this->name)) {
265 265
             $ret .= Context::escape($this->name) . ' ';
266 266
         }
267 267
 
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
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
      * @param OptionsArray   $options    the options of this data type
79 79
      */
80 80
     public function __construct(
81
-        string|null $name = null,
81
+        string | null $name = null,
82 82
         array $parameters = [],
83
-        OptionsArray|null $options = null
83
+        OptionsArray | null $options = null
84 84
     ) {
85 85
         $this->name = $name;
86 86
         $this->parameters = $parameters;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @param TokensList           $list    the list of tokens that are being parsed
93 93
      * @param array<string, mixed> $options parameters for parsing
94 94
      */
95
-    public static function parse(Parser $parser, TokensList $list, array $options = []): DataType|null
95
+    public static function parse(Parser $parser, TokensList $list, array $options = []): DataType | null
96 96
     {
97 97
         $ret = new static();
98 98
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
             if ($state === 0) {
124 124
                 $ret->name = strtoupper((string) $token->value);
125
-                if (($token->type !== TokenType::Keyword) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) {
125
+                if (($token->type !== TokenType::Keyword) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) {
126 126
                     $parser->error('Unrecognized data type.', $token);
127 127
                 }
128 128
 
Please login to merge, or discard this patch.
src/Components/CreateDefinition.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
      * @param Reference|null    $references   references
151 151
      */
152 152
     public function __construct(
153
-        string|null $name = null,
154
-        OptionsArray|null $options = null,
155
-        DataType|Key|null $type = null,
153
+        string | null $name = null,
154
+        OptionsArray | null $options = null,
155
+        DataType | Key | null $type = null,
156 156
         bool $isConstraint = false,
157
-        Reference|null $references = null
157
+        Reference | null $references = null
158 158
     ) {
159 159
         $this->name = $name;
160 160
         $this->options = $options;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                     $state = 4;
237 237
                 } elseif ($token->type === TokenType::Symbol || $token->type === TokenType::None) {
238 238
                     $expr->name = $token->value;
239
-                    if (! $expr->isConstraint) {
239
+                    if (!$expr->isConstraint) {
240 240
                         $state = 2;
241 241
                     }
242 242
                 } elseif ($token->type === TokenType::Keyword) {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
                 $state = 5;
279 279
             } elseif ($state === 5) {
280
-                if (! empty($expr->type) || ! empty($expr->key)) {
280
+                if (!empty($expr->type) || !empty($expr->key)) {
281 281
                     $ret[] = $expr;
282 282
                 }
283 283
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         }
298 298
 
299 299
         // Last iteration was not saved.
300
-        if (! empty($expr->type) || ! empty($expr->key)) {
300
+        if (!empty($expr->type) || !empty($expr->key)) {
301 301
             $ret[] = $expr;
302 302
         }
303 303
 
@@ -322,16 +322,16 @@  discard block
 block discarded – undo
322 322
             $tmp .= Context::escape($this->name) . ' ';
323 323
         }
324 324
 
325
-        if (! empty($this->type)) {
325
+        if (!empty($this->type)) {
326 326
             $this->type->lowercase = true;
327 327
             $tmp .= $this->type->build() . ' ';
328 328
         }
329 329
 
330
-        if (! empty($this->key)) {
330
+        if (!empty($this->key)) {
331 331
             $tmp .= $this->key . ' ';
332 332
         }
333 333
 
334
-        if (! empty($this->references)) {
334
+        if (!empty($this->references)) {
335 335
             $tmp .= 'REFERENCES ' . $this->references . ' ';
336 336
         }
337 337
 
Please login to merge, or discard this patch.