Completed
Pull Request — master (#167)
by Sebastian
03:01
created
examples/04_bookstore/schema-bootstrap.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (is_file(__DIR__ . '/../../../../../vendor/autoload.php')) {
4
-    require_once __DIR__ . '/../../../../../vendor/autoload.php';
3
+if (is_file(__DIR__.'/../../../../../vendor/autoload.php')) {
4
+    require_once __DIR__.'/../../../../../vendor/autoload.php';
5 5
 }
6
-require_once __DIR__ . '/../../vendor/autoload.php';
7
-require_once __DIR__ . '/Schema/Type/BookType.php';
8
-require_once __DIR__ . '/Schema/Type/AuthorType.php';
9
-require_once __DIR__ . '/Schema/Type/CategoryType.php';
10
-require_once __DIR__ . '/Schema/Field/Book/RecentBooksField.php';
11
-require_once __DIR__ . '/Schema/Field/CategoriesField.php';
12
-require_once __DIR__ . '/DataProvider.php';
13
-require_once __DIR__ . '/Schema/BookStoreSchema.php';
6
+require_once __DIR__.'/../../vendor/autoload.php';
7
+require_once __DIR__.'/Schema/Type/BookType.php';
8
+require_once __DIR__.'/Schema/Type/AuthorType.php';
9
+require_once __DIR__.'/Schema/Type/CategoryType.php';
10
+require_once __DIR__.'/Schema/Field/Book/RecentBooksField.php';
11
+require_once __DIR__.'/Schema/Field/CategoriesField.php';
12
+require_once __DIR__.'/DataProvider.php';
13
+require_once __DIR__.'/Schema/BookStoreSchema.php';
Please login to merge, or discard this patch.
examples/04_bookstore/Schema/Field/CategoriesField.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
 
25 25
     public function resolve($value, array $args, ResolveInfo $info)
26 26
     {
27
-        return new DeferredResolver(function () use ($value) {
28
-            $id = empty($value['id']) ? "1" : $value['id'] . ".1";
27
+        return new DeferredResolver(function() use ($value) {
28
+            $id = empty($value['id']) ? "1" : $value['id'].".1";
29 29
 
30 30
             return [
31 31
                 'id'       => $id,
32
-                'title'    => 'Category ' . $id,
32
+                'title'    => 'Category '.$id,
33 33
                 'authors'  => [
34 34
                     [
35 35
                         'id'        => 'author1',
Please login to merge, or discard this patch.
examples/04_bookstore/Schema/BookStoreSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $config->getQuery()->addFields([
25 25
             'authors' => [
26 26
                 'type'    => new ListType(new AuthorType()),
27
-                'resolve' => function () {
27
+                'resolve' => function() {
28 28
                     return DataProvider::getAuthors();
29 29
                 }
30 30
             ],
Please login to merge, or discard this patch.
Tests/Schema/DeferredTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $key = md5(serialize($ids));
59 59
         $this->buffer[$key] = $ids;
60 60
 
61
-        return function () use ($key) {
61
+        return function() use ($key) {
62 62
             return $this->fetch($key);
63 63
         };
64 64
     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             [
106 106
               'name' => 'name',
107 107
               'type' => new StringType(),
108
-              'resolve' => function ($value) {
108
+              'resolve' => function($value) {
109 109
                   return $value['name'];
110 110
               },
111 111
             ]
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             [
118 118
               'name' => 'friends',
119 119
               'type' => new ListType(new DeferredUserType($this->database)),
120
-              'resolve' => function ($value) {
120
+              'resolve' => function($value) {
121 121
                   return new DeferredResolver(
122 122
                     $this->database->add($value['friends'])
123 123
                   );
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             [
132 132
               'name' => 'foes',
133 133
               'type' => new ListType(new DeferredUserType($this->database)),
134
-              'resolve' => function ($value) {
134
+              'resolve' => function($value) {
135 135
                   return new DeferredResolver(
136 136
                     $this->database->add($value['foes'])
137 137
                   );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
           [
152 152
             'name' => 'users',
153 153
             'type' => new ListType(new DeferredUserType($buffer)),
154
-            'resolve' => function ($value, $args) use ($buffer) {
154
+            'resolve' => function($value, $args) use ($buffer) {
155 155
                 return new DeferredResolver($buffer->add($args['ids']));
156 156
             },
157 157
           ]
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
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
         /** @var AstQuery $ast */
408 408
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
409 409
 
410
-        return $this->deferredResolve($resolvedValue, function ($resolvedValue) use ($field, $ast, $parentValue) {
410
+        return $this->deferredResolve($resolvedValue, function($resolvedValue) use ($field, $ast, $parentValue) {
411 411
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
412 412
 
413 413
             if (null === $resolvedValue) {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
             $result = [];
433 433
             foreach ($resolvedValue as $resolvedValueItem) {
434 434
                 try {
435
-                    $fakeField->getConfig()->set('resolve', function () use ($resolvedValueItem) {
435
+                    $fakeField->getConfig()->set('resolve', function() use ($resolvedValueItem) {
436 436
                         return $resolvedValueItem;
437 437
                     });
438 438
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             $resolvedValue = $this->doResolve($field, $ast, $parentValue);
479 479
         }
480 480
 
481
-        return $this->deferredResolve($resolvedValue, function ($resolvedValue) use ($field, $ast, $parentValue) {
481
+        return $this->deferredResolve($resolvedValue, function($resolvedValue) use ($field, $ast, $parentValue) {
482 482
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
483 483
 
484 484
             if (null === $resolvedValue) {
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
     {
500 500
         /** @var AstQuery $ast */
501 501
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
502
-        return $this->deferredResolve($resolvedValue, function ($resolvedValue) use ($field, $ast, $parentValue) {
502
+        return $this->deferredResolve($resolvedValue, function($resolvedValue) use ($field, $ast, $parentValue) {
503 503
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
504 504
 
505 505
             if (null === $resolvedValue) {
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
             }
508 508
 
509 509
             /** @var AbstractUnionType $type */
510
-            $type         = $field->getType()->getNullableType();
510
+            $type = $field->getType()->getNullableType();
511 511
             $resolveInfo = new ResolveInfo(
512 512
               $field,
513 513
               $ast instanceof AstQuery ? $ast->getFields() : [],
Please login to merge, or discard this patch.