Passed
Pull Request — master (#311)
by William
12:43
created
tests/Lexer/ContextTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     public function testLoadClosest($context, $expected)
30 30
     {
31 31
         $this->assertEquals($expected, Context::loadClosest($context));
32
-        if (! is_null($expected)) {
32
+        if (!is_null($expected)) {
33 33
             $this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\Context' . $expected, Context::$loadedContext);
34 34
             $this->assertTrue(class_exists(Context::$loadedContext));
35 35
         }
Please login to merge, or discard this patch.
src/Lexer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 use PhpMyAdmin\SqlParser\Exceptions\LexerException;
14 14
 
15
-if (! defined('USE_UTF_STRINGS')) {
15
+if (!defined('USE_UTF_STRINGS')) {
16 16
     // NOTE: In previous versions of PHP (5.5 and older) the default
17 17
     // internal encoding is "ISO-8859-1".
18 18
     // All `mb_` functions must specify the correct encoding, which is
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         // For multi-byte strings, a new instance of `UtfString` is
175 175
         // initialized (only if `UtfString` usage is forced.
176
-        if (! $str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) {
176
+        if (!$str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) {
177 177
             $str = new UtfString($str);
178 178
         }
179 179
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         // Setting the delimiter.
186 186
         $this->setDelimiter(
187
-            ! empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER
187
+            !empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER
188 188
         );
189 189
 
190 190
         $this->lex();
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                 // Parsing the delimiter.
313 313
                 $this->delimiter = null;
314 314
                 $delimiterLen = 0;
315
-                while (++$this->last < $this->len && ! Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) {
315
+                while (++$this->last < $this->len && !Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) {
316 316
                     $this->delimiter .= $this->str[$this->last];
317 317
                     ++$delimiterLen;
318 318
                 }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
     {
551 551
         $token = $this->str[$this->last];
552 552
 
553
-        if (! Context::isWhitespace($token)) {
553
+        if (!Context::isWhitespace($token)) {
554 554
             return null;
555 555
         }
556 556
 
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
                 // This can occurs in the following statements:
597 597
                 // - "SELECT */* comment */ FROM ..."
598 598
                 // - "SELECT 2*/* comment */3 AS `six`;"
599
-                $next = $this->last+1;
599
+                $next = $this->last + 1;
600 600
                 if (($next < $this->len) && $this->str[$next] === '*') {
601 601
                     // Conflict in "*/*": first "*" was not for ending a comment.
602 602
                     // Stop here and let other parsing method define the true behavior of that first star.
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
                 }
787 787
             } elseif ($state === 2) {
788 788
                 $flags |= Token::FLAG_NUMBER_HEX;
789
-                if (! (
789
+                if (!(
790 790
                         ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9')
791 791
                         || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F')
792 792
                         || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f')
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
     public function parseString($quote = '')
882 882
     {
883 883
         $token = $this->str[$this->last];
884
-        if (! ($flags = Context::isString($token)) && $token !== $quote) {
884
+        if (!($flags = Context::isString($token)) && $token !== $quote) {
885 885
             return null;
886 886
         }
887 887
         $quote = $token;
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
     public function parseSymbol()
928 928
     {
929 929
         $token = $this->str[$this->last];
930
-        if (! ($flags = Context::isSymbol($token))) {
930
+        if (!($flags = Context::isSymbol($token))) {
931 931
             return null;
932 932
         }
933 933
 
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
             return null;
979 979
         }
980 980
 
981
-        while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) {
981
+        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
982 982
             $token .= $this->str[$this->last];
983 983
 
984 984
             // Test if end of token equals the current delimiter. If so, remove it from the token.
Please login to merge, or discard this patch.