Completed
Pull Request — master (#196)
by
unknown
02:45
created
src/Parser/Tokenizer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
         $value = substr($this->source, $start, $this->pos - $start);
254 254
 
255 255
         if (strpos($value, '.') === false) {
256
-            $value = (int) $value;
256
+            $value = (int)$value;
257 257
         } else {
258
-            $value = (float) $value;
258
+            $value = (float)$value;
259 259
         }
260 260
 
261 261
         return new Token(Token::TYPE_NUMBER, $this->getLine(), $this->getColumn(), $value);
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
                 return $token;
312 312
             }
313 313
             
314
-            if($ch === '\\' && ($this->pos < ($len - 1))) {
314
+            if ($ch === '\\' && ($this->pos < ($len - 1))) {
315 315
                 $this->pos++;
316 316
                 $ch = $this->source[$this->pos];
317
-                switch($ch) {
317
+                switch ($ch) {
318 318
                     case '"':
319 319
                     case '\\':
320 320
                     case '/':
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                         break;
334 334
                     case 'u':
335 335
                         $codepoint = substr($this->source, $this->pos + 1, 4);
336
-                        if( !preg_match('/[0-9A-Fa-f]{4}/', $codepoint)) {
336
+                        if (!preg_match('/[0-9A-Fa-f]{4}/', $codepoint)) {
337 337
                             throw $this->createException(sprintf('Invalid string unicode escape sequece "%s"', $codepoint));
338 338
                         }
339 339
                         $ch = html_entity_decode("&#x{$codepoint};", ENT_QUOTES, 'UTF-8');
Please login to merge, or discard this patch.
Tests/Parser/ParserTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 
105 105
     private function tokenizeStringContents($graphQLString) {
106 106
         $parser = new TokenizerTestingParser();
107
-        $parser->initTokenizerForTesting('"' . $graphQLString . '"');
107
+        $parser->initTokenizerForTesting('"'.$graphQLString.'"');
108 108
 
109 109
         return $parser->getTokenForTesting();
110 110
     }
Please login to merge, or discard this patch.