Completed
Pull Request — master (#188)
by Sebastian
02:55
created
examples/03_relay_star_wars/schema-bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-if (is_file(__DIR__ . '/../../../../../vendor/autoload.php')) {
3
-    require_once __DIR__ . '/../../../../../vendor/autoload.php';
2
+if (is_file(__DIR__.'/../../../../../vendor/autoload.php')) {
3
+    require_once __DIR__.'/../../../../../vendor/autoload.php';
4 4
 }
5 5
 
6
-require_once __DIR__ . '/../../vendor/autoload.php';
7
-require_once __DIR__ . '/Schema/FactionType.php';
8
-require_once __DIR__ . '/Schema/ShipType.php';
9
-require_once __DIR__ . '/Schema/TestDataProvider.php';
10
-require_once __DIR__ . '/Schema/StarWarsRelaySchema.php';
6
+require_once __DIR__.'/../../vendor/autoload.php';
7
+require_once __DIR__.'/Schema/FactionType.php';
8
+require_once __DIR__.'/Schema/ShipType.php';
9
+require_once __DIR__.'/Schema/TestDataProvider.php';
10
+require_once __DIR__.'/Schema/StarWarsRelaySchema.php';
Please login to merge, or discard this patch.
examples/03_relay_star_wars/router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 }
10 10
 if ($_SERVER['REQUEST_URI'] == '/graphiql.css') {
11 11
     header('Content-Type: text/css');
12
-    readfile(__DIR__ . '/../GraphiQL/graphiql.css');
12
+    readfile(__DIR__.'/../GraphiQL/graphiql.css');
13 13
     die();
14 14
 }
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use Youshido\GraphQL\Execution\Processor;
18 18
 use Youshido\GraphQL\Schema\Schema;
19 19
 
20
-require_once __DIR__ . '/schema-bootstrap.php';
20
+require_once __DIR__.'/schema-bootstrap.php';
21 21
 /** @var Schema $schema */
22 22
 $schema = new StarWarsRelaySchema();
23 23
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $variables = isset($requestData['variables']) ? $requestData['variables'] : null;
35 35
 
36 36
 if (empty($payload)) {
37
-    $GraphiQLData = file_get_contents(__DIR__ . '/../GraphiQL/index.html');
37
+    $GraphiQLData = file_get_contents(__DIR__.'/../GraphiQL/index.html');
38 38
     echo $GraphiQLData;
39 39
     die();
40 40
 }
Please login to merge, or discard this patch.
Tests/Issues/Issue171/Issue171Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         $processor->processPayload($this->getIntrospectionQuery(), []);
14 14
         $resp = $processor->getResponseData();
15 15
 
16
-        $enumTypes = array_filter($resp['data']['__schema']['types'], function($type){
16
+        $enumTypes = array_filter($resp['data']['__schema']['types'], function($type) {
17 17
             return ($type['kind'] === 'ENUM');
18 18
         });
19 19
 
Please login to merge, or discard this patch.
Tests/Issues/Issue151/Issue151Test.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         $unionType = new UnionType([
33 33
             'name'        => 'Union',
34 34
             'types'       => [$type1, $type2],
35
-            'resolveType' => function ($value) use ($type1, $type2) {
35
+            'resolveType' => function($value) use ($type1, $type2) {
36 36
                 if (isset($value['name'])) {
37 37
                     return $type1;
38 38
                 }
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
             },
42 42
         ]);
43 43
 
44
-        $schema    = new Schema([
44
+        $schema = new Schema([
45 45
             'query' => new ObjectType([
46 46
                 'name'   => 'RootQuery',
47 47
                 'fields' => [
48 48
                     'list' => [
49 49
                         'type'    => new ListType($unionType),
50
-                        'resolve' => function () {
50
+                        'resolve' => function() {
51 51
                             return [
52 52
                                 [
53 53
                                     'id'   => 1,
Please login to merge, or discard this patch.
Tests/Issues/Issue149/Issue149Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function testInternalVariableArgument()
17 17
     {
18
-        $schema    = new Schema([
18
+        $schema = new Schema([
19 19
             'query' => new ObjectType([
20 20
                 'name'   => 'RootQuery',
21 21
                 'fields' => [
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                                 ])),
37 37
                             ],
38 38
                         ]),
39
-                        'resolve' => function () {
39
+                        'resolve' => function() {
40 40
                             return [
41 41
                                 'id'      => 1,
42 42
                                 'name'    => 'John',
Please login to merge, or discard this patch.
Tests/Schema/IntrospectionTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             'description'       => 'latest description',
137 137
             'deprecationReason' => 'for test',
138 138
             'isDeprecated'      => true,
139
-            'resolve'           => function () {
139
+            'resolve'           => function() {
140 140
                 return [
141 141
                     'id'   => 1,
142 142
                     'name' => 'Alex'
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
                                 ['name' => 'String', 'fields' => null],
203 203
                                 ['name' => '__Schema', 'fields' => [['name' => 'queryType', 'args' => []], ['name' => 'mutationType', 'args' => []], ['name' => 'subscriptionType', 'args' => []], ['name' => 'types', 'args' => []], ['name' => 'directives', 'args' => []]]],
204 204
                                 ['name' => '__Type', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'kind', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'ofType', 'args' => []], ['name' => 'inputFields', 'args' => []], ['name' => 'enumValues', 'args' => [['defaultValue' => 'false']]], ['name' => 'fields', 'args' => [['defaultValue' => 'false']]], ['name' => 'interfaces', 'args' => []], ['name' => 'possibleTypes', 'args' => []]]],
205
-                                ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []],]],
205
+                                ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []], ]],
206 206
                                 ['name' => 'Boolean', 'fields' => null],
207
-                                ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []],]],
207
+                                ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ]],
208 208
                                 ['name' => '__Field', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'args', 'args' => []]]],
209 209
                                 ['name' => '__Directive', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'args', 'args' => []], ['name' => 'locations', 'args' => []]]],
210 210
                                 ['name' => '__DirectiveLocation', 'fields' => null],
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                 'id'   => ['type' => new IntType()],
293 293
                 'name' => ['type' => new IntType()],
294 294
             ],
295
-            'resolveType' => function ($type) {
295
+            'resolveType' => function($type) {
296 296
 
297 297
             }
298 298
         ]);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         $unionType = new UnionType([
321 321
             'name'        => 'UnionType',
322 322
             'types'       => [$object1, $object2],
323
-            'resolveType' => function () {
323
+            'resolveType' => function() {
324 324
 
325 325
             }
326 326
         ]);
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             'args'    => [
332 332
                 'id' => ['type' => TypeMap::TYPE_INT]
333 333
             ],
334
-            'resolve' => function () {
334
+            'resolve' => function() {
335 335
                 return [
336 336
                     'id'   => 1,
337 337
                     'name' => 'Alex'
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                     ]
358 358
                 ])
359 359
             ],
360
-            'resolve' => function () {
360
+            'resolve' => function() {
361 361
                 return null;
362 362
             }
363 363
         ]));
Please login to merge, or discard this patch.
src/Execution/Processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         /** @var AstQuery $ast */
425 425
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
426 426
 
427
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
427
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
428 428
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
429 429
 
430 430
             if (null === $resolvedValue) {
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
             $result = [];
450 450
             foreach ($resolvedValue as $resolvedValueItem) {
451 451
                 try {
452
-                    $fakeField->getConfig()->set('resolve', function () use ($resolvedValueItem) {
452
+                    $fakeField->getConfig()->set('resolve', function() use ($resolvedValueItem) {
453 453
                         return $resolvedValueItem;
454 454
                     });
455 455
 
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
             $resolvedValue = $this->doResolve($field, $ast, $parentValue);
496 496
         }
497 497
 
498
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
498
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
499 499
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
500 500
 
501 501
             if (null === $resolvedValue) {
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
     {
517 517
         /** @var AstQuery $ast */
518 518
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
519
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
519
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
520 520
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
521 521
 
522 522
             if (null === $resolvedValue) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
             }
525 525
 
526 526
             /** @var AbstractUnionType $type */
527
-            $type         = $field->getType()->getNullableType();
527
+            $type = $field->getType()->getNullableType();
528 528
             $resolveInfo = new ResolveInfo(
529 529
                 $field,
530 530
                 $ast instanceof AstQuery ? $ast->getFields() : [],
Please login to merge, or discard this patch.