Passed
Pull Request — master (#532)
by
unknown
03:00
created
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/PartitionDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
         return trim(
232 232
             'PARTITION ' . $this->name
233 233
             . (empty($this->type) ? '' : ' VALUES ' . $this->type . ' ' . $this->expr . ' ')
234
-            . (! empty($this->options) && ! empty($this->type) ? '' : ' ')
234
+            . (!empty($this->options) && !empty($this->type) ? '' : ' ')
235 235
             . $this->options . $subpartitions,
236 236
         );
237 237
     }
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.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public $expr;
29 29
 
30 30
     /** @param Expression $expr the expression that we are sorting by */
31
-    public function __construct(Expression|null $expr = null)
31
+    public function __construct(Expression | null $expr = null)
32 32
     {
33 33
         $this->expr = $expr;
34 34
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 ) {
87 87
                     $expr->type = $token->keyword;
88 88
                 } elseif (($token->type === TokenType::Operator) && ($token->value === ',')) {
89
-                    if (! empty($expr->expr)) {
89
+                    if (!empty($expr->expr)) {
90 90
                         $ret[] = $expr;
91 91
                     }
92 92
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         }
100 100
 
101 101
         // Last iteration was not processed.
102
-        if (! empty($expr->expr)) {
102
+        if (!empty($expr->expr)) {
103 103
             $ret[] = $expr;
104 104
         }
105 105
 
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.
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/Statement.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,23 +67,23 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @see Statement::$statementOptions
69 69
      */
70
-    public OptionsArray|null $options = null;
70
+    public OptionsArray | null $options = null;
71 71
 
72 72
     /**
73 73
      * The index of the first token used in this statement.
74 74
      */
75
-    public int|null $first = null;
75
+    public int | null $first = null;
76 76
 
77 77
     /**
78 78
      * The index of the last token used in this statement.
79 79
      */
80
-    public int|null $last = null;
80
+    public int | null $last = null;
81 81
 
82 82
     /**
83 83
      * @param Parser|null     $parser the instance that requests parsing
84 84
      * @param TokensList|null $list   the list of tokens to be parsed
85 85
      */
86
-    public function __construct(Parser|null $parser = null, TokensList|null $list = null)
86
+    public function __construct(Parser | null $parser = null, TokensList | null $list = null)
87 87
     {
88 88
         if (($parser === null) || ($list === null)) {
89 89
             return;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
             // Checking if this field was already built.
162 162
             if ($type & 1) {
163
-                if (! empty($built[$field])) {
163
+                if (!empty($built[$field])) {
164 164
                     continue;
165 165
                 }
166 166
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             }
174 174
 
175 175
             // Checking if the result of the builder should be added.
176
-            if (! ($type & 1)) {
176
+            if (!($type & 1)) {
177 177
                 continue;
178 178
             }
179 179
 
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
             $options = [];
300 300
 
301 301
             // Looking for duplicated clauses.
302
-            if (! empty(Parser::KEYWORD_PARSERS[$token->value]) || ! empty(Parser::STATEMENT_PARSERS[$token->value])) {
303
-                if (! empty($parsedClauses[$token->value])) {
302
+            if (!empty(Parser::KEYWORD_PARSERS[$token->value]) || !empty(Parser::STATEMENT_PARSERS[$token->value])) {
303
+                if (!empty($parsedClauses[$token->value])) {
304 304
                     $parser->error('This type of clause was previously parsed.', $token);
305 305
                     break;
306 306
                 }
@@ -313,18 +313,18 @@  discard block
 block discarded – undo
313 313
             // but it might be the beginning of a statement of truncate,
314 314
             // so let the value use the keyword field for truncate type.
315 315
             $tokenValue = in_array($token->keyword, ['TRUNCATE']) ? $token->keyword : $token->value;
316
-            if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) {
316
+            if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) {
317 317
                 $class = Parser::KEYWORD_PARSERS[$tokenValue]['class'];
318 318
                 $field = Parser::KEYWORD_PARSERS[$tokenValue]['field'];
319
-                if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) {
319
+                if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) {
320 320
                     $options = Parser::KEYWORD_PARSERS[$tokenValue]['options'];
321 321
                 }
322 322
             }
323 323
 
324 324
             // Checking if this is the beginning of the statement.
325
-            if (! empty(Parser::STATEMENT_PARSERS[$token->keyword])) {
325
+            if (!empty(Parser::STATEMENT_PARSERS[$token->keyword])) {
326 326
                 if (
327
-                    ! empty(static::$clauses) // Undefined for some statements.
327
+                    !empty(static::$clauses) // Undefined for some statements.
328 328
                     && empty(static::$clauses[$token->value])
329 329
                 ) {
330 330
                     // Some keywords (e.g. `SET`) may be the beginning of a
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                     break;
340 340
                 }
341 341
 
342
-                if (! $parsedOptions) {
342
+                if (!$parsedOptions) {
343 343
                     if (empty(static::$statementOptions[$token->value])) {
344 344
                         // Skipping keyword because if it is not a option.
345 345
                         ++$list->idx;
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
                 if ($minJoin === 0 && stripos($clauseType, 'JOIN')) {
513 513
                     // First JOIN clause is detected
514 514
                     $minJoin = $maxJoin = $clauseStartIdx;
515
-                } elseif ($minJoin !== 0 && ! stripos($clauseType, 'JOIN')) {
515
+                } elseif ($minJoin !== 0 && !stripos($clauseType, 'JOIN')) {
516 516
                     // After a previous JOIN clause, a non-JOIN clause has been detected
517 517
                     $maxJoin = $lastIdx;
518 518
                 } elseif ($maxJoin < $clauseStartIdx && stripos($clauseType, 'JOIN')) {
Please login to merge, or discard this patch.
src/Statements/UpdateStatement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,38 +99,38 @@
 block discarded – undo
99 99
      *
100 100
      * @var Expression[]|null
101 101
      */
102
-    public array|null $tables = null;
102
+    public array | null $tables = null;
103 103
 
104 104
     /**
105 105
      * The updated values.
106 106
      *
107 107
      * @var SetOperation[]|null
108 108
      */
109
-    public array|null $set = null;
109
+    public array | null $set = null;
110 110
 
111 111
     /**
112 112
      * Conditions used for filtering each row of the result set.
113 113
      *
114 114
      * @var Condition[]|null
115 115
      */
116
-    public array|null $where = null;
116
+    public array | null $where = null;
117 117
 
118 118
     /**
119 119
      * Specifies the order of the rows in the result set.
120 120
      *
121 121
      * @var OrderKeyword[]|null
122 122
      */
123
-    public array|null $order = null;
123
+    public array | null $order = null;
124 124
 
125 125
     /**
126 126
      * Conditions used for limiting the size of the result set.
127 127
      */
128
-    public Limit|null $limit = null;
128
+    public Limit | null $limit = null;
129 129
 
130 130
     /**
131 131
      * Joins.
132 132
      *
133 133
      * @var JoinKeyword[]|null
134 134
      */
135
-    public array|null $join = null;
135
+    public array | null $join = null;
136 136
 }
Please login to merge, or discard this patch.
src/Statements/AnalyzeStatement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,5 +33,5 @@
 block discarded – undo
33 33
      *
34 34
      * @var Expression[]|null
35 35
      */
36
-    public array|null $tables = null;
36
+    public array | null $tables = null;
37 37
 }
Please login to merge, or discard this patch.
src/Statements/WithStatement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     /**
63 63
      * holds the CTE parser.
64 64
      */
65
-    public Parser|null $cteStatementParser = null;
65
+    public Parser | null $cteStatementParser = null;
66 66
 
67 67
     /**
68 68
      * @param Parser     $parser the instance that requests parsing
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             }
111 111
 
112 112
             if ($state === 0) {
113
-                if ($token->type !== TokenType::None || ! preg_match('/^[a-zA-Z0-9_$]+$/', $token->token)) {
113
+                if ($token->type !== TokenType::None || !preg_match('/^[a-zA-Z0-9_$]+$/', $token->token)) {
114 114
                     $parser->error('The name of the CTE was expected.', $token);
115 115
                     break;
116 116
                 }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                     break;
135 135
                 }
136 136
             } elseif ($state === 2) {
137
-                if (! ($token->type === TokenType::Keyword && $token->keyword === 'AS')) {
137
+                if (!($token->type === TokenType::Keyword && $token->keyword === 'AS')) {
138 138
                     $parser->error('AS keyword was expected.', $token);
139 139
                     break;
140 140
                 }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 $list->idx++; // Ignore the current token
147 147
                 $nextKeyword = $list->getNext();
148 148
 
149
-                if (! ($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) {
149
+                if (!($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) {
150 150
                     $parser->error('Subquery of the CTE was expected.', $token);
151 151
                     $list->idx = $idxBeforeGetNext;
152 152
                     break;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     /**
294 294
      * Get tokens within the WITH expression to use them in another parser
295 295
      */
296
-    private function getSubTokenList(TokensList $list): ParserException|TokensList
296
+    private function getSubTokenList(TokensList $list): ParserException | TokensList
297 297
     {
298 298
         $idx = $list->idx;
299 299
         $token = $list->tokens[$list->idx];
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             }
310 310
 
311 311
             ++$list->idx;
312
-            if (! isset($list->tokens[$list->idx])) {
312
+            if (!isset($list->tokens[$list->idx])) {
313 313
                 break;
314 314
             }
315 315
 
Please login to merge, or discard this patch.