Passed
Pull Request — master (#505)
by
unknown
12:13 queued 09:20
created
src/Lexer.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $len = $str instanceof UtfString ? $str->length() : strlen($str);
175 175
 
176 176
         // For multi-byte strings, a new instance of `UtfString` is initialized.
177
-        if (! $str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) {
177
+        if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) {
178 178
             $str = new UtfString($str);
179 179
         }
180 180
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         $this->strict = $strict;
185 185
 
186 186
         // Setting the delimiter.
187
-        $this->setDelimiter(! empty($delimiter) ? $delimiter : static::$defaultDelimiter);
187
+        $this->setDelimiter(!empty($delimiter) ? $delimiter : static::$defaultDelimiter);
188 188
 
189 189
         $this->lex();
190 190
     }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                 $delimiterLen = 0;
309 309
                 while (
310 310
                     ++$this->last < $this->len
311
-                    && ! Context::isWhitespace($this->str[$this->last])
311
+                    && !Context::isWhitespace($this->str[$this->last])
312 312
                     && $delimiterLen < 15
313 313
                 ) {
314 314
                     $this->delimiter .= $this->str[$this->last];
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
             }
368 368
 
369 369
             if (
370
-                ($next->type !== Token::TYPE_KEYWORD || ! in_array($next->value, ['FROM', 'USING'], true))
371
-                && ($next->type !== Token::TYPE_OPERATOR || ! in_array($next->value, [',', ')'], true))
370
+                ($next->type !== Token::TYPE_KEYWORD || !in_array($next->value, ['FROM', 'USING'], true))
371
+                && ($next->type !== Token::TYPE_OPERATOR || !in_array($next->value, [',', ')'], true))
372 372
             ) {
373 373
                 continue;
374 374
             }
@@ -406,10 +406,10 @@  discard block
 block discarded – undo
406 406
             $next = $this->list->getNext();
407 407
             if (
408 408
                 ($next->type !== Token::TYPE_KEYWORD
409
-                    || ! in_array($next->value, self::KEYWORD_NAME_INDICATORS, true)
409
+                    || !in_array($next->value, self::KEYWORD_NAME_INDICATORS, true)
410 410
                 )
411 411
                 && ($next->type !== Token::TYPE_OPERATOR
412
-                    || ! in_array($next->value, self::OPERATOR_NAME_INDICATORS, true)
412
+                    || !in_array($next->value, self::OPERATOR_NAME_INDICATORS, true)
413 413
                 )
414 414
                 && ($next->value !== null)
415 415
             ) {
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     /**
449 449
      * Parses a keyword.
450 450
      */
451
-    public function parseKeyword(): Token|null
451
+    public function parseKeyword(): Token | null
452 452
     {
453 453
         $token = '';
454 454
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             $token .= $this->str[$this->last];
489 489
             $flags = Context::isKeyword($token);
490 490
 
491
-            if (($this->last + 1 !== $this->len && ! Context::isSeparator($this->str[$this->last + 1])) || ! $flags) {
491
+            if (($this->last + 1 !== $this->len && !Context::isSeparator($this->str[$this->last + 1])) || !$flags) {
492 492
                 continue;
493 493
             }
494 494
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
     /**
509 509
      * Parses a label.
510 510
      */
511
-    public function parseLabel(): Token|null
511
+    public function parseLabel(): Token | null
512 512
     {
513 513
         $token = '';
514 514
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
     /**
553 553
      * Parses an operator.
554 554
      */
555
-    public function parseOperator(): Token|null
555
+    public function parseOperator(): Token | null
556 556
     {
557 557
         $token = '';
558 558
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             $token .= $this->str[$this->last];
573 573
             $flags = Context::isOperator($token);
574 574
 
575
-            if (! $flags) {
575
+            if (!$flags) {
576 576
                 continue;
577 577
             }
578 578
 
@@ -588,11 +588,11 @@  discard block
 block discarded – undo
588 588
     /**
589 589
      * Parses a whitespace.
590 590
      */
591
-    public function parseWhitespace(): Token|null
591
+    public function parseWhitespace(): Token | null
592 592
     {
593 593
         $token = $this->str[$this->last];
594 594
 
595
-        if (! Context::isWhitespace($token)) {
595
+        if (!Context::isWhitespace($token)) {
596 596
             return null;
597 597
         }
598 598
 
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
     /**
609 609
      * Parses a comment.
610 610
      */
611
-    public function parseComment(): Token|null
611
+    public function parseComment(): Token | null
612 612
     {
613 613
         $iBak = $this->last;
614 614
         $token = $this->str[$this->last];
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
     /**
726 726
      * Parses a boolean.
727 727
      */
728
-    public function parseBool(): Token|null
728
+    public function parseBool(): Token | null
729 729
     {
730 730
         if ($this->last + 3 >= $this->len) {
731 731
             // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
     /**
757 757
      * Parses a number.
758 758
      */
759
-    public function parseNumber(): Token|null
759
+    public function parseNumber(): Token | null
760 760
     {
761 761
         // A rudimentary state machine is being used to parse numbers due to
762 762
         // the various forms of their notation.
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
             } elseif ($state === 2) {
827 827
                 $flags |= Token::FLAG_NUMBER_HEX;
828 828
                 if (
829
-                    ! (
829
+                    !(
830 830
                         ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9')
831 831
                         || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F')
832 832
                         || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f')
@@ -922,12 +922,12 @@  discard block
 block discarded – undo
922 922
      *
923 923
      * @throws LexerException
924 924
      */
925
-    public function parseString($quote = ''): Token|null
925
+    public function parseString($quote = ''): Token | null
926 926
     {
927 927
         $token = $this->str[$this->last];
928 928
         $flags = Context::isString($token);
929 929
 
930
-        if (! $flags && $token !== $quote) {
930
+        if (!$flags && $token !== $quote) {
931 931
             return null;
932 932
         }
933 933
 
@@ -972,12 +972,12 @@  discard block
 block discarded – undo
972 972
      *
973 973
      * @throws LexerException
974 974
      */
975
-    public function parseSymbol(): Token|null
975
+    public function parseSymbol(): Token | null
976 976
     {
977 977
         $token = $this->str[$this->last];
978 978
         $flags = Context::isSymbol($token);
979 979
 
980
-        if (! $flags) {
980
+        if (!$flags) {
981 981
             return null;
982 982
         }
983 983
 
@@ -1019,14 +1019,14 @@  discard block
 block discarded – undo
1019 1019
     /**
1020 1020
      * Parses unknown parts of the query.
1021 1021
      */
1022
-    public function parseUnknown(): Token|null
1022
+    public function parseUnknown(): Token | null
1023 1023
     {
1024 1024
         $token = $this->str[$this->last];
1025 1025
         if (Context::isSeparator($token)) {
1026 1026
             return null;
1027 1027
         }
1028 1028
 
1029
-        while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) {
1029
+        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
1030 1030
             $token .= $this->str[$this->last];
1031 1031
 
1032 1032
             // Test if end of token equals the current delimiter. If so, remove it from the token.
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
     /**
1046 1046
      * Parses the delimiter of the query.
1047 1047
      */
1048
-    public function parseDelimiter(): Token|null
1048
+    public function parseDelimiter(): Token | null
1049 1049
     {
1050 1050
         $idx = 0;
1051 1051
 
Please login to merge, or discard this patch.