Passed
Pull Request — master (#385)
by
unknown
03:51
created
src/Components/Expression.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         ];
201 201
 
202 202
         // When a field is parsed, no parentheses are expected.
203
-        if (! empty($options['parseField'])) {
203
+        if (!empty($options['parseField'])) {
204 204
             $options['breakOnParentheses'] = true;
205 205
             $options['field'] = $options['parseField'];
206 206
         }
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
             }
227 227
 
228 228
             if ($token->type === Token::TYPE_KEYWORD && ($token->value !== 'x' && $token->value !== 'y')) {
229
-                if (($brackets > 0) && empty($ret->subquery) && ! empty(Parser::$STATEMENT_PARSERS[$token->keyword])) {
229
+                if (($brackets > 0) && empty($ret->subquery) && !empty(Parser::$STATEMENT_PARSERS[$token->keyword])) {
230 230
                     // A `(` was previously found and this keyword is the
231 231
                     // beginning of a statement, so this is a subquery.
232 232
                     $ret->subquery = $token->keyword;
233 233
                 } elseif (
234 234
                     ($token->flags & Token::FLAG_KEYWORD_FUNCTION)
235 235
                     && (empty($options['parseField'])
236
-                    && ! $alias)
236
+                    && !$alias)
237 237
                 ) {
238 238
                     $isExpr = true;
239 239
                 } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) && ($brackets === 0)) {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                     }
246 246
 
247 247
                     if ($token->keyword === 'AS') {
248
-                        if (! empty($options['breakOnAlias'])) {
248
+                        if (!empty($options['breakOnAlias'])) {
249 249
                             break;
250 250
                         }
251 251
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                     }
269 269
 
270 270
                     $isExpr = true;
271
-                } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias) {
271
+                } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && !$alias) {
272 272
                     /* End of expression */
273 273
                     break;
274 274
                 }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 || (($token->type === Token::TYPE_OPERATOR)
285 285
                 && ($token->value !== '.'))
286 286
             ) {
287
-                if (! empty($options['parseField'])) {
287
+                if (!empty($options['parseField'])) {
288 288
                     break;
289 289
                 }
290 290
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             }
295 295
 
296 296
             if ($token->type === Token::TYPE_OPERATOR) {
297
-                if (! empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) {
297
+                if (!empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) {
298 298
                     // No brackets were expected.
299 299
                     break;
300 300
                 }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
                     --$brackets;
320 320
                     if ($brackets === 0) {
321
-                        if (! empty($options['parenthesesDelimited'])) {
321
+                        if (!empty($options['parenthesesDelimited'])) {
322 322
                             // The current token is the last bracket, the next
323 323
                             // one will be outside the expression.
324 324
                             $ret->expr .= $token->token;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
             if ($alias) {
346 346
                 // An alias is expected (the keyword `AS` was previously found).
347
-                if (! empty($ret->alias)) {
347
+                if (!empty($ret->alias)) {
348 348
                     $parser->error('An alias was previously found.', $token);
349 349
                     break;
350 350
                 }
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
                     && ($prev[0] === null
359 359
                         || (($prev[0]->type !== Token::TYPE_OPERATOR || $prev[0]->token === ')')
360 360
                             && ($prev[0]->type !== Token::TYPE_KEYWORD
361
-                                || ! ($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))
361
+                                || !($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))
362 362
                     && (($prev[1]->type === Token::TYPE_STRING)
363 363
                         || ($prev[1]->type === Token::TYPE_SYMBOL
364
-                            && ! ($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE))
364
+                            && !($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE))
365 365
                         || ($prev[1]->type === Token::TYPE_NONE))
366 366
                 ) {
367
-                    if (! empty($ret->alias)) {
367
+                    if (!empty($ret->alias)) {
368 368
                         $parser->error('An alias was previously found.', $token);
369 369
                         break;
370 370
                     }
@@ -373,12 +373,12 @@  discard block
 block discarded – undo
373 373
                 } else {
374 374
                     $ret->expr .= $token->token;
375 375
                 }
376
-            } elseif (! $isExpr) {
376
+            } elseif (!$isExpr) {
377 377
                 if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '.')) {
378 378
                     // Found a `.` which means we expect a column name and
379 379
                     // the column name we parsed is actually the table name
380 380
                     // and the table name is actually a database name.
381
-                    if (! empty($ret->database) || $dot) {
381
+                    if (!empty($ret->database) || $dot) {
382 382
                         $parser->error('Unexpected dot.', $token);
383 383
                     }
384 384
 
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
                         $dot = false;
396 396
                     } else {
397 397
                         // No alias is expected.
398
-                        if (! empty($options['breakOnAlias'])) {
398
+                        if (!empty($options['breakOnAlias'])) {
399 399
                             break;
400 400
                         }
401 401
 
402
-                        if (! empty($ret->alias)) {
402
+                        if (!empty($ret->alias)) {
403 403
                             $parser->error('An alias was previously found.', $token);
404 404
                             break;
405 405
                         }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             $ret = implode('.', Context::escape($fields));
458 458
         }
459 459
 
460
-        if (! empty($component->alias)) {
460
+        if (!empty($component->alias)) {
461 461
             $ret .= ' AS ' . Context::escape($component->alias);
462 462
         }
463 463
 
Please login to merge, or discard this patch.