Completed
Pull Request — master (#211)
by
unknown
04:12
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.
src/Type/InputObject/AbstractInputObjectType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         }
66 66
 
67 67
         $typeConfig     = $this->getConfig();
68
-        $requiredFields = array_filter($typeConfig->getFields(), function (InputFieldInterface $field) {
68
+        $requiredFields = array_filter($typeConfig->getFields(), function(InputFieldInterface $field) {
69 69
             return $field->getType()->getKind() == TypeMap::KIND_NON_NULL;
70 70
         });
71 71
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function parseValue($value)
107 107
     {
108 108
         if (is_null($value)) return null;
109
-        if($value instanceof InputObject) {
109
+        if ($value instanceof InputObject) {
110 110
             $value = $value->getValue();
111 111
         }
112 112
 
Please login to merge, or discard this patch.
examples/01_sandbox/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 use Youshido\GraphQL\Type\Object\ObjectType;
8 8
 use Youshido\GraphQL\Type\Scalar\StringType;
9 9
 
10
-if(file_exists(__DIR__ . '/../../../../../vendor/autoload.php')) {
11
-    require_once __DIR__ . '/../../../../../vendor/autoload.php';
10
+if (file_exists(__DIR__.'/../../../../../vendor/autoload.php')) {
11
+    require_once __DIR__.'/../../../../../vendor/autoload.php';
12 12
 } else {
13
-    require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
13
+    require_once realpath(__DIR__.'/../..').'/vendor/autoload.php';
14 14
 }
15 15
 
16 16
 $processor = new Processor(new Schema([
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         'fields' => [
20 20
             'currentTime' => [
21 21
                 'type'    => new StringType(),
22
-                'resolve' => function () {
22
+                'resolve' => function() {
23 23
                     return date('Y-m-d H:ia');
24 24
                 }
25 25
             ]
@@ -28,4 +28,4 @@  discard block
 block discarded – undo
28 28
 ]));
29 29
 
30 30
 $processor->processPayload('{ currentTime }');
31
-echo json_encode($processor->getResponseData()) . "\n";
31
+echo json_encode($processor->getResponseData())."\n";
Please login to merge, or discard this patch.
examples/02_blog/Schema/PostType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
                 'args'              => [
29 29
                     'truncated' => new BooleanType()
30 30
                 ],
31
-                'resolve'           => function ($value, $args) {
32
-                    return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
31
+                'resolve'           => function($value, $args) {
32
+                    return (!empty($args['truncated'])) ? explode(' ', $value)[0].'...' : $value;
33 33
                 }
34 34
             ])
35 35
             ->addField(
Please login to merge, or discard this patch.
examples/02_blog/schema-bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,18 +2,18 @@
 block discarded – undo
2 2
 
3 3
 namespace BlogTest;
4 4
 
5
-if(file_exists(__DIR__ . '/../../../../../vendor/autoload.php')) {
6
-    require_once __DIR__ . '/../../../../../vendor/autoload.php';
5
+if (file_exists(__DIR__.'/../../../../../vendor/autoload.php')) {
6
+    require_once __DIR__.'/../../../../../vendor/autoload.php';
7 7
 } else {
8
-    require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
8
+    require_once realpath(__DIR__.'/../..').'/vendor/autoload.php';
9 9
 }
10 10
 
11
-require_once __DIR__ . '/Schema/DataProvider.php';
12
-require_once __DIR__ . '/Schema/PostType.php';
13
-require_once __DIR__ . '/Schema/PostStatus.php';
14
-require_once __DIR__ . '/Schema/ContentBlockInterface.php';
15
-require_once __DIR__ . '/Schema/LikePostField.php';
16
-require_once __DIR__ . '/Schema/BannerType.php';
17
-require_once __DIR__ . '/Schema/ContentBlockUnion.php';
18
-require_once __DIR__ . '/Schema/PostInputType.php';
19
-require_once __DIR__ . '/Schema/BlogSchema.php';
11
+require_once __DIR__.'/Schema/DataProvider.php';
12
+require_once __DIR__.'/Schema/PostType.php';
13
+require_once __DIR__.'/Schema/PostStatus.php';
14
+require_once __DIR__.'/Schema/ContentBlockInterface.php';
15
+require_once __DIR__.'/Schema/LikePostField.php';
16
+require_once __DIR__.'/Schema/BannerType.php';
17
+require_once __DIR__.'/Schema/ContentBlockUnion.php';
18
+require_once __DIR__.'/Schema/PostInputType.php';
19
+require_once __DIR__.'/Schema/BlogSchema.php';
Please login to merge, or discard this patch.
examples/02_blog_inline/inline-schema.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
                 'fields' => [
18 18
                     // here you have a complex field with a lot of options
19 19
                     'title'     => [
20
-                        'type'              => new StringType(),                    // string type
21
-                        'description'       => 'This field contains a post title',  // description
22
-                        'isDeprecated'      => true,                                // marked as deprecated
23
-                        'deprecationReason' => 'field title is now deprecated',     // explain the reason
20
+                        'type'              => new StringType(), // string type
21
+                        'description'       => 'This field contains a post title', // description
22
+                        'isDeprecated'      => true, // marked as deprecated
23
+                        'deprecationReason' => 'field title is now deprecated', // explain the reason
24 24
                         'args'              => [
25 25
                             'truncated' => new BooleanType()                        // add an optional argument
26 26
                         ],
27
-                        'resolve'           => function ($value, $args) {
27
+                        'resolve'           => function($value, $args) {
28 28
                             // used argument to modify a field value
29
-                            return (!empty($args['truncated'])) ? explode(' ', $value['title'])[0] . '...' : $value['title'];
29
+                            return (!empty($args['truncated'])) ? explode(' ', $value['title'])[0].'...' : $value['title'];
30 30
                         }
31 31
                     ],
32 32
                     // if field just has a type, you can use a short declaration syntax like this
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                 'id' => new IntType()
40 40
             ],
41 41
             // resolve function for the query
42
-            'resolve' => function () {
42
+            'resolve' => function() {
43 43
                 return [
44 44
                     'title'   => 'Title for the latest Post',
45 45
                     'summary' => 'Post summary',
Please login to merge, or discard this patch.
examples/02_blog_inline/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
 use Youshido\GraphQL\Schema\Schema;
7 7
 use Youshido\GraphQL\Type\Object\ObjectType;
8 8
 
9
-if(file_exists(__DIR__ . '/../../../../../vendor/autoload.php')) {
10
-    require_once __DIR__ . '/../../../../../vendor/autoload.php';
9
+if (file_exists(__DIR__.'/../../../../../vendor/autoload.php')) {
10
+    require_once __DIR__.'/../../../../../vendor/autoload.php';
11 11
 } else {
12
-    require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
12
+    require_once realpath(__DIR__.'/../..').'/vendor/autoload.php';
13 13
 }
14 14
 
15
-require_once __DIR__ . '/inline-schema.php';
15
+require_once __DIR__.'/inline-schema.php';
16 16
 /** @var ObjectType $rootQueryType */
17 17
 
18 18
 $processor = new Processor(new Schema([
@@ -21,4 +21,4 @@  discard block
 block discarded – undo
21 21
 $payload = '{ latestPost { title(truncated: true), summary } }';
22 22
 
23 23
 $processor->processPayload($payload);
24
-echo json_encode($processor->getResponseData()) . "\n";
24
+echo json_encode($processor->getResponseData())."\n";
Please login to merge, or discard this patch.