Passed
Pull Request — master (#190)
by Sebastian
03:03
created
src/Execution/ResolveInfo.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,16 +77,16 @@
 block discarded – undo
77 77
      * @param array $variableValues
78 78
      */
79 79
     public function __construct(
80
-      string $fieldName,
80
+        string $fieldName,
81 81
       ?array $fieldNodes,
82
-      TypeInterface $returnType,
83
-      ObjectType $parentType,
82
+        TypeInterface $returnType,
83
+        ObjectType $parentType,
84 84
       ?array $path,
85
-      SchemaInterface $schema,
86
-      array $fragments,
87
-      $rootValue,
88
-      OperationDefinitionNode $operation,
89
-      array $variableValues
85
+        SchemaInterface $schema,
86
+        array $fragments,
87
+        $rootValue,
88
+        OperationDefinitionNode $operation,
89
+        array $variableValues
90 90
     ) {
91 91
         $this->fieldName = $fieldName;
92 92
         $this->fieldNodes = $fieldNodes;
Please login to merge, or discard this patch.
src/Execution/ExecutionStrategy.php 2 patches
Indentation   +244 added lines, -244 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
      * @var array
44 44
      */
45 45
     protected static $defaultFieldResolver = [
46
-      __CLASS__,
47
-      'defaultFieldResolver',
46
+        __CLASS__,
47
+        'defaultFieldResolver',
48 48
     ];
49 49
 
50 50
     /**
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
      * @param OperationDefinitionNode $operation
76 76
      */
77 77
     public function __construct(
78
-      ExecutionContext $context,
79
-      OperationDefinitionNode $operation,
80
-      $rootValue
78
+        ExecutionContext $context,
79
+        OperationDefinitionNode $operation,
80
+        $rootValue
81 81
     ) {
82 82
         $this->context = $context;
83 83
         $this->operation = $operation;
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
      * @return mixed|null
96 96
      */
97 97
     public static function defaultFieldResolver(
98
-      $rootValue,
99
-      $args,
100
-      $context,
101
-      ResolveInfo $info
98
+        $rootValue,
99
+        $args,
100
+        $context,
101
+        ResolveInfo $info
102 102
     ) {
103 103
         $fieldName = $info->getFieldName();
104 104
         $property = null;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 
120 120
         return $property instanceof \Closure ? $property($rootValue, $args,
121
-          $context, $info) : $property;
121
+            $context, $info) : $property;
122 122
     }
123 123
 
124 124
     /**
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
      * @throws \Throwable
143 143
      */
144 144
     public function executeFieldsSerially(
145
-      ObjectType $objectType,
146
-      $rootValue,
147
-      $path,
148
-      $fields
145
+        ObjectType $objectType,
146
+        $rootValue,
147
+        $path,
148
+        $fields
149 149
     ) {
150 150
 
151 151
         $finalResults = [];
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
         $promise = new \React\Promise\FulfilledPromise([]);
154 154
 
155 155
         $resolve = function (
156
-          $results,
157
-          $fieldName,
158
-          $path,
159
-          $objectType,
160
-          $rootValue,
161
-          $fieldNodes
156
+            $results,
157
+            $fieldName,
158
+            $path,
159
+            $objectType,
160
+            $rootValue,
161
+            $fieldNodes
162 162
         ) {
163 163
             $fieldPath = $path;
164 164
             $fieldPath[] = $fieldName;
165 165
             try {
166 166
                 $result = $this->resolveField($objectType, $rootValue,
167
-                  $fieldNodes, $fieldPath);
167
+                    $fieldNodes, $fieldPath);
168 168
             } catch (UndefinedException $ex) {
169 169
                 return null;
170 170
             }
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
             if ($this->isPromise($result)) {
173 173
                 /** @var ExtendedPromiseInterface $result */
174 174
                 return $result->then(function ($resolvedResult) use (
175
-                  $fieldName,
176
-                  $results
175
+                    $fieldName,
176
+                    $results
177 177
                 ) {
178 178
                     $results[$fieldName] = $resolvedResult;
179 179
                     return $results;
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 
188 188
         foreach ($fields as $fieldName => $fieldNodes) {
189 189
             $promise = $promise->then(function ($resolvedResults) use (
190
-              $resolve,
191
-              $fieldName,
192
-              $path,
193
-              $objectType,
194
-              $rootValue,
195
-              $fieldNodes
190
+                $resolve,
191
+                $fieldName,
192
+                $path,
193
+                $objectType,
194
+                $rootValue,
195
+                $fieldNodes
196 196
             ) {
197 197
                 return $resolve($resolvedResults, $fieldName, $path,
198
-                  $objectType, $rootValue, $fieldNodes);
198
+                    $objectType, $rootValue, $fieldNodes);
199 199
             });
200 200
         }
201 201
 
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
      * @throws \Throwable
223 223
      */
224 224
     protected function executeFields(
225
-      ObjectType $objectType,
226
-      $rootValue,
227
-      $path,
228
-      $fields
225
+        ObjectType $objectType,
226
+        $rootValue,
227
+        $path,
228
+        $fields
229 229
     ): array {
230 230
         $finalResults = [];
231 231
         $isContainsPromise = false;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
             try {
238 238
                 $result = $this->resolveField($objectType, $rootValue,
239
-                  $fieldNodes, $fieldPath);
239
+                    $fieldNodes, $fieldPath);
240 240
             } catch (UndefinedException $ex) {
241 241
                 continue;
242 242
             }
@@ -272,42 +272,42 @@  discard block
 block discarded – undo
272 272
      * @throws \Throwable
273 273
      */
274 274
     protected function resolveField(
275
-      ObjectType $parentType,
276
-      $rootValue,
277
-      $fieldNodes,
278
-      $path
275
+        ObjectType $parentType,
276
+        $rootValue,
277
+        $fieldNodes,
278
+        $path
279 279
     ) {
280 280
         /** @var FieldNode $fieldNode */
281 281
         $fieldNode = $fieldNodes[0];
282 282
 
283 283
         $field = $this->getFieldDefinition($this->context->getSchema(),
284
-          $parentType, $fieldNode->getNameValue());
284
+            $parentType, $fieldNode->getNameValue());
285 285
 
286 286
         if (null === $field) {
287 287
             throw new UndefinedException('Undefined field definition.');
288 288
         }
289 289
 
290 290
         $info = $this->buildResolveInfo($fieldNodes, $fieldNode, $field,
291
-          $parentType, $path, $this->context);
291
+            $parentType, $path, $this->context);
292 292
 
293 293
         $resolveFunction = $this->determineResolveFunction($field, $parentType,
294
-          $this->context);
294
+            $this->context);
295 295
 
296 296
         $result = $this->resolveFieldValueOrError(
297
-          $field,
298
-          $fieldNode,
299
-          $resolveFunction,
300
-          $rootValue,
301
-          $this->context,
302
-          $info
297
+            $field,
298
+            $fieldNode,
299
+            $resolveFunction,
300
+            $rootValue,
301
+            $this->context,
302
+            $info
303 303
         );
304 304
 
305 305
         $result = $this->completeValueCatchingError(
306
-          $field->getType(),
307
-          $fieldNodes,
308
-          $info,
309
-          $path,
310
-          $result// $result is passed as $source
306
+            $field->getType(),
307
+            $fieldNodes,
308
+            $info,
309
+            $path,
310
+            $result// $result is passed as $source
311 311
         );
312 312
 
313 313
         return $result;
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
      * @throws \Digia\GraphQL\Error\InvariantException
324 324
      */
325 325
     public function getFieldDefinition(
326
-      Schema $schema,
327
-      ObjectType $parentType,
328
-      string $fieldName
326
+        Schema $schema,
327
+        ObjectType $parentType,
328
+        string $fieldName
329 329
     ) {
330 330
         $schemaMetaFieldDefinition = SchemaMetaFieldDefinition();
331 331
         $typeMetaFieldDefinition = TypeMetaFieldDefinition();
@@ -359,24 +359,24 @@  discard block
 block discarded – undo
359 359
      * @return ResolveInfo
360 360
      */
361 361
     private function buildResolveInfo(
362
-      array $fieldNodes,
363
-      FieldNode $fieldNode,
364
-      Field $field,
365
-      ObjectType $parentType,
362
+        array $fieldNodes,
363
+        FieldNode $fieldNode,
364
+        Field $field,
365
+        ObjectType $parentType,
366 366
       ?array $path,
367
-      ExecutionContext $context
367
+        ExecutionContext $context
368 368
     ) {
369 369
         return new ResolveInfo(
370
-          $fieldNode->getNameValue(),
371
-          $fieldNodes,
372
-          $field->getType(),
373
-          $parentType,
374
-          $path,
375
-          $context->getSchema(),
376
-          $context->getFragments(),
377
-          $context->getRootValue(),
378
-          $context->getOperation(),
379
-          $context->getVariableValues()
370
+            $fieldNode->getNameValue(),
371
+            $fieldNodes,
372
+            $field->getType(),
373
+            $parentType,
374
+            $path,
375
+            $context->getSchema(),
376
+            $context->getFragments(),
377
+            $context->getRootValue(),
378
+            $context->getOperation(),
379
+            $context->getVariableValues()
380 380
         );
381 381
     }
382 382
 
@@ -388,9 +388,9 @@  discard block
 block discarded – undo
388 388
      * @return callable|mixed|null
389 389
      */
390 390
     private function determineResolveFunction(
391
-      Field $field,
392
-      ObjectType $objectType,
393
-      ExecutionContext $context
391
+        Field $field,
392
+        ObjectType $objectType,
393
+        ExecutionContext $context
394 394
     ) {
395 395
 
396 396
         if ($field->hasResolve()) {
@@ -415,19 +415,19 @@  discard block
 block discarded – undo
415 415
      * @return array|\Throwable
416 416
      */
417 417
     private function resolveFieldValueOrError(
418
-      Field $field,
419
-      FieldNode $fieldNode,
418
+        Field $field,
419
+        FieldNode $fieldNode,
420 420
       ?callable $resolveFunction,
421
-      $rootValue,
422
-      ExecutionContext $context,
423
-      ResolveInfo $info
421
+        $rootValue,
422
+        ExecutionContext $context,
423
+        ResolveInfo $info
424 424
     ) {
425 425
         try {
426 426
             $args = coerceArgumentValues($field, $fieldNode,
427
-              $context->getVariableValues());
427
+                $context->getVariableValues());
428 428
 
429 429
             return $resolveFunction($rootValue, $args,
430
-              $context->getContextValue(), $info);
430
+                $context->getContextValue(), $info);
431 431
         } catch (\Throwable $error) {
432 432
             return $error;
433 433
         }
@@ -444,51 +444,51 @@  discard block
 block discarded – undo
444 444
      * @throws \Throwable
445 445
      */
446 446
     public function completeValueCatchingError(
447
-      TypeInterface $fieldType,
448
-      $fieldNodes,
449
-      ResolveInfo $info,
450
-      $path,
451
-      &$result
447
+        TypeInterface $fieldType,
448
+        $fieldNodes,
449
+        ResolveInfo $info,
450
+        $path,
451
+        &$result
452 452
     ) {
453 453
         if ($fieldType instanceof NonNullType) {
454 454
             return $this->completeValueWithLocatedError(
455
-              $fieldType,
456
-              $fieldNodes,
457
-              $info,
458
-              $path,
459
-              $result
455
+                $fieldType,
456
+                $fieldNodes,
457
+                $info,
458
+                $path,
459
+                $result
460 460
             );
461 461
         }
462 462
 
463 463
         try {
464 464
             $completed = $this->completeValueWithLocatedError(
465
-              $fieldType,
466
-              $fieldNodes,
467
-              $info,
468
-              $path,
469
-              $result
465
+                $fieldType,
466
+                $fieldNodes,
467
+                $info,
468
+                $path,
469
+                $result
470 470
             );
471 471
 
472 472
             if ($this->isPromise($completed)) {
473 473
                 $context = $this->context;
474 474
                 /** @var ExtendedPromiseInterface $completed */
475 475
                 return $completed->then(null,
476
-                  function ($error) use ($context, $fieldNodes, $path) {
477
-                      //@TODO Handle $error better
478
-                      if ($error instanceof \Exception) {
479
-                          $context->addError($this->buildLocatedError($error,
476
+                    function ($error) use ($context, $fieldNodes, $path) {
477
+                        //@TODO Handle $error better
478
+                        if ($error instanceof \Exception) {
479
+                            $context->addError($this->buildLocatedError($error,
480 480
                             $fieldNodes, $path));
481
-                      } else {
482
-                          $context->addError(
481
+                        } else {
482
+                            $context->addError(
483 483
                             $this->buildLocatedError(
484
-                              new ExecutionException($error ?? 'An unknown error occurred.'),
485
-                              $fieldNodes,
486
-                              $path
484
+                                new ExecutionException($error ?? 'An unknown error occurred.'),
485
+                                $fieldNodes,
486
+                                $path
487 487
                             )
488
-                          );
489
-                      }
490
-                      return new \React\Promise\FulfilledPromise(null);
491
-                  });
488
+                            );
489
+                        }
490
+                        return new \React\Promise\FulfilledPromise(null);
491
+                    });
492 492
             }
493 493
 
494 494
             return $completed;
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             return null;
498 498
         } catch (\Exception $ex) {
499 499
             $this->context->addError($this->buildLocatedError($ex, $fieldNodes,
500
-              $path));
500
+                $path));
501 501
             return null;
502 502
         }
503 503
     }
@@ -512,19 +512,19 @@  discard block
 block discarded – undo
512 512
      * @throws \Throwable
513 513
      */
514 514
     public function completeValueWithLocatedError(
515
-      TypeInterface $fieldType,
516
-      $fieldNodes,
517
-      ResolveInfo $info,
518
-      $path,
519
-      $result
515
+        TypeInterface $fieldType,
516
+        $fieldNodes,
517
+        ResolveInfo $info,
518
+        $path,
519
+        $result
520 520
     ) {
521 521
         try {
522 522
             $completed = $this->completeValue(
523
-              $fieldType,
524
-              $fieldNodes,
525
-              $info,
526
-              $path,
527
-              $result
523
+                $fieldType,
524
+                $fieldNodes,
525
+                $info,
526
+                $path,
527
+                $result
528 528
             );
529 529
 
530 530
             return $completed;
@@ -545,22 +545,22 @@  discard block
 block discarded – undo
545 545
      * @throws \Throwable
546 546
      */
547 547
     private function completeValue(
548
-      TypeInterface $returnType,
549
-      $fieldNodes,
550
-      ResolveInfo $info,
551
-      $path,
552
-      &$result
548
+        TypeInterface $returnType,
549
+        $fieldNodes,
550
+        ResolveInfo $info,
551
+        $path,
552
+        &$result
553 553
     ) {
554 554
         if ($this->isPromise($result)) {
555 555
             /** @var ExtendedPromiseInterface $result */
556 556
             return $result->then(function (&$value) use (
557
-              $returnType,
558
-              $fieldNodes,
559
-              $info,
560
-              $path
557
+                $returnType,
558
+                $fieldNodes,
559
+                $info,
560
+                $path
561 561
             ) {
562 562
                 return $this->completeValue($returnType, $fieldNodes, $info,
563
-                  $path, $value);
563
+                    $path, $value);
564 564
             });
565 565
         }
566 566
 
@@ -575,19 +575,19 @@  discard block
 block discarded – undo
575 575
 
576 576
         if ($returnType instanceof NonNullType) {
577 577
             $completed = $this->completeValue(
578
-              $returnType->getOfType(),
579
-              $fieldNodes,
580
-              $info,
581
-              $path,
582
-              $result
578
+                $returnType->getOfType(),
579
+                $fieldNodes,
580
+                $info,
581
+                $path,
582
+                $result
583 583
             );
584 584
 
585 585
             if ($completed === null) {
586 586
                 throw new ExecutionException(
587
-                  sprintf(
587
+                    sprintf(
588 588
                     'Cannot return null for non-nullable field %s.%s.',
589 589
                     $info->getParentType(), $info->getFieldName()
590
-                  )
590
+                    )
591 591
                 );
592 592
             }
593 593
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         // If field type is List, complete each item in the list with the inner type
598 598
         if ($returnType instanceof ListType) {
599 599
             return $this->completeListValue($returnType, $fieldNodes, $info,
600
-              $path, $result);
600
+                $path, $result);
601 601
         }
602 602
 
603 603
 
@@ -610,13 +610,13 @@  discard block
 block discarded – undo
610 610
         //@TODO Make a function for checking abstract type?
611 611
         if ($returnType instanceof InterfaceType || $returnType instanceof UnionType) {
612 612
             return $this->completeAbstractValue($returnType, $fieldNodes, $info,
613
-              $path, $result);
613
+                $path, $result);
614 614
         }
615 615
 
616 616
         // Field type must be Object, Interface or Union and expect sub-selections.
617 617
         if ($returnType instanceof ObjectType) {
618 618
             return $this->completeObjectValue($returnType, $fieldNodes, $info,
619
-              $path, $result);
619
+                $path, $result);
620 620
         }
621 621
 
622 622
         throw new ExecutionException("Cannot complete value of unexpected type \"{$returnType}\".");
@@ -643,11 +643,11 @@  discard block
 block discarded – undo
643 643
      * @throws \Throwable
644 644
      */
645 645
     private function completeListValue(
646
-      ListType $returnType,
647
-      $fieldNodes,
648
-      ResolveInfo $info,
649
-      $path,
650
-      &$result
646
+        ListType $returnType,
647
+        $fieldNodes,
648
+        ResolveInfo $info,
649
+        $path,
650
+        &$result
651 651
     ) {
652 652
         $itemType = $returnType->getOfType();
653 653
 
@@ -656,11 +656,11 @@  discard block
 block discarded – undo
656 656
 
657 657
         if (!is_array($result) && !($result instanceof \Traversable)) {
658 658
             throw new \Exception(
659
-              sprintf(
659
+                sprintf(
660 660
                 'Expected Array or Traversable, but did not find one for field %s.%s.',
661 661
                 $info->getParentType()->getName(),
662 662
                 $info->getFieldName()
663
-              )
663
+                )
664 664
             );
665 665
         }
666 666
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
             $fieldPath = $path;
669 669
             $fieldPath[] = $key;
670 670
             $completedItem = $this->completeValueCatchingError($itemType,
671
-              $fieldNodes, $info, $fieldPath, $item);
671
+                $fieldNodes, $info, $fieldPath, $item);
672 672
             $completedItems[] = $completedItem;
673 673
             $containsPromise = $containsPromise || $this->isPromise($completedItem);
674 674
         }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         if ($serializedResult === null) {
691 691
             //@TODO Make a function for this type of exception
692 692
             throw new ExecutionException(
693
-              sprintf('Expected value of type "%s" but received: %s.',
693
+                sprintf('Expected value of type "%s" but received: %s.',
694 694
                 (string)$returnType, toString($result))
695 695
             );
696 696
         }
@@ -712,58 +712,58 @@  discard block
 block discarded – undo
712 712
      * @throws \Throwable
713 713
      */
714 714
     private function completeAbstractValue(
715
-      AbstractTypeInterface $returnType,
716
-      $fieldNodes,
717
-      ResolveInfo $info,
718
-      $path,
719
-      &$result
715
+        AbstractTypeInterface $returnType,
716
+        $fieldNodes,
717
+        ResolveInfo $info,
718
+        $path,
719
+        &$result
720 720
     ) {
721 721
         $runtimeType = $returnType->resolveType($result,
722
-          $this->context->getContextValue(), $info);
722
+            $this->context->getContextValue(), $info);
723 723
 
724 724
         if (null === $runtimeType) {
725 725
             //@TODO Show warning
726 726
             $runtimeType = $this->defaultTypeResolver($result,
727
-              $this->context->getContextValue(), $info, $returnType);
727
+                $this->context->getContextValue(), $info, $returnType);
728 728
         }
729 729
 
730 730
         if ($this->isPromise($runtimeType)) {
731 731
             /** @var ExtendedPromiseInterface $runtimeType */
732 732
             return $runtimeType->then(function ($resolvedRuntimeType) use (
733
-              $returnType,
734
-              $fieldNodes,
735
-              $info,
736
-              $path,
737
-              &$result
733
+                $returnType,
734
+                $fieldNodes,
735
+                $info,
736
+                $path,
737
+                &$result
738 738
             ) {
739 739
                 return $this->completeObjectValue(
740
-                  $this->ensureValidRuntimeType(
740
+                    $this->ensureValidRuntimeType(
741 741
                     $resolvedRuntimeType,
742 742
                     $returnType,
743 743
                     $fieldNodes,
744 744
                     $info,
745 745
                     $result
746
-                  ),
747
-                  $fieldNodes,
748
-                  $info,
749
-                  $path,
750
-                  $result
746
+                    ),
747
+                    $fieldNodes,
748
+                    $info,
749
+                    $path,
750
+                    $result
751 751
                 );
752 752
             });
753 753
         }
754 754
 
755 755
         return $this->completeObjectValue(
756
-          $this->ensureValidRuntimeType(
756
+            $this->ensureValidRuntimeType(
757 757
             $runtimeType,
758 758
             $returnType,
759 759
             $fieldNodes,
760 760
             $info,
761 761
             $result
762
-          ),
763
-          $fieldNodes,
764
-          $info,
765
-          $path,
766
-          $result
762
+            ),
763
+            $fieldNodes,
764
+            $info,
765
+            $path,
766
+            $result
767 767
         );
768 768
     }
769 769
 
@@ -777,10 +777,10 @@  discard block
 block discarded – undo
777 777
      * @throws ExecutionException
778 778
      */
779 779
     private function defaultTypeResolver(
780
-      $value,
781
-      $context,
782
-      ResolveInfo $info,
783
-      AbstractTypeInterface $abstractType
780
+        $value,
781
+        $context,
782
+        ResolveInfo $info,
783
+        AbstractTypeInterface $abstractType
784 784
     ) {
785 785
         $possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
786 786
         $promisedIsTypeOfResults = [];
@@ -808,14 +808,14 @@  discard block
 block discarded – undo
808 808
 
809 809
         if (!empty($promisedIsTypeOfResults)) {
810 810
             return \React\Promise\all($promisedIsTypeOfResults)
811
-              ->then(function ($isTypeOfResults) use ($possibleTypes) {
812
-                  foreach ($isTypeOfResults as $index => $result) {
813
-                      if ($result) {
814
-                          return $possibleTypes[$index];
815
-                      }
816
-                  }
817
-                  return null;
818
-              });
811
+                ->then(function ($isTypeOfResults) use ($possibleTypes) {
812
+                    foreach ($isTypeOfResults as $index => $result) {
813
+                        if ($result) {
814
+                            return $possibleTypes[$index];
815
+                        }
816
+                    }
817
+                    return null;
818
+                });
819 819
         }
820 820
 
821 821
         return null;
@@ -835,31 +835,31 @@  discard block
 block discarded – undo
835 835
      * @throws \Throwable
836 836
      */
837 837
     private function completeObjectValue(
838
-      ObjectType $returnType,
839
-      $fieldNodes,
840
-      ResolveInfo $info,
841
-      $path,
842
-      &$result
838
+        ObjectType $returnType,
839
+        $fieldNodes,
840
+        ResolveInfo $info,
841
+        $path,
842
+        &$result
843 843
     ) {
844 844
 
845 845
         if (null !== $returnType->getIsTypeOf()) {
846 846
             $isTypeOf = $returnType->isTypeOf($result,
847
-              $this->context->getContextValue(), $info);
847
+                $this->context->getContextValue(), $info);
848 848
             //@TODO check for promise?
849 849
             if (!$isTypeOf) {
850 850
                 throw new ExecutionException(
851
-                  sprintf('Expected value of type "%s" but received: %s.',
851
+                    sprintf('Expected value of type "%s" but received: %s.',
852 852
                     (string)$returnType, toString($result))
853 853
                 );
854 854
             }
855 855
         }
856 856
 
857 857
         return $this->collectAndExecuteSubFields(
858
-          $returnType,
859
-          $fieldNodes,
860
-          $info,
861
-          $path,
862
-          $result
858
+            $returnType,
859
+            $fieldNodes,
860
+            $info,
861
+            $path,
862
+            $result
863 863
         );
864 864
     }
865 865
 
@@ -877,11 +877,11 @@  discard block
 block discarded – undo
877 877
      * @throws \Throwable
878 878
      */
879 879
     private function collectAndExecuteSubFields(
880
-      ObjectType $returnType,
881
-      $fieldNodes,
882
-      ResolveInfo $info,
883
-      $path,
884
-      &$result
880
+        ObjectType $returnType,
881
+        $fieldNodes,
882
+        ResolveInfo $info,
883
+        $path,
884
+        &$result
885 885
     ) {
886 886
         $subFields = [];
887 887
         $visitedFragmentNames = [];
@@ -890,17 +890,17 @@  discard block
 block discarded – undo
890 890
             /** @var FieldNode $fieldNode */
891 891
             if ($fieldNode->getSelectionSet() !== null) {
892 892
                 $subFields = $this->collectFields(
893
-                  $returnType,
894
-                  $fieldNode->getSelectionSet(),
895
-                  $subFields,
896
-                  $visitedFragmentNames
893
+                    $returnType,
894
+                    $fieldNode->getSelectionSet(),
895
+                    $subFields,
896
+                    $visitedFragmentNames
897 897
                 );
898 898
             }
899 899
         }
900 900
 
901 901
         if (!empty($subFields)) {
902 902
             return $this->executeFields($returnType, $result, $path,
903
-              $subFields);
903
+                $subFields);
904 904
         }
905 905
 
906 906
         return $result;
@@ -918,10 +918,10 @@  discard block
 block discarded – undo
918 918
      * @throws \Digia\GraphQL\Error\InvariantException
919 919
      */
920 920
     protected function collectFields(
921
-      ObjectType $runtimeType,
922
-      SelectionSetNode $selectionSet,
923
-      &$fields,
924
-      &$visitedFragmentNames
921
+        ObjectType $runtimeType,
922
+        SelectionSetNode $selectionSet,
923
+        &$fields,
924
+        &$visitedFragmentNames
925 925
     ) {
926 926
         foreach ($selectionSet->getSelections() as $selection) {
927 927
             // Check if this Node should be included first
@@ -939,13 +939,13 @@  discard block
 block discarded – undo
939 939
                 $fields[$fieldName][] = $selection;
940 940
             } elseif ($selection instanceof InlineFragmentNode) {
941 941
                 if (!$this->doesFragmentConditionMatch($selection,
942
-                  $runtimeType)) {
942
+                    $runtimeType)) {
943 943
                     continue;
944 944
                 }
945 945
 
946 946
                 $this->collectFields($runtimeType,
947
-                  $selection->getSelectionSet(), $fields,
948
-                  $visitedFragmentNames);
947
+                    $selection->getSelectionSet(), $fields,
948
+                    $visitedFragmentNames);
949 949
             } elseif ($selection instanceof FragmentSpreadNode) {
950 950
                 $fragmentName = $selection->getNameValue();
951 951
 
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
                 /** @var FragmentDefinitionNode $fragment */
958 958
                 $fragment = $this->context->getFragments()[$fragmentName];
959 959
                 $this->collectFields($runtimeType, $fragment->getSelectionSet(),
960
-                  $fields, $visitedFragmentNames);
960
+                    $fields, $visitedFragmentNames);
961 961
             }
962 962
         }
963 963
 
@@ -978,14 +978,14 @@  discard block
 block discarded – undo
978 978
         $contextVariables = $this->context->getVariableValues();
979 979
 
980 980
         $skip = coerceDirectiveValues(SkipDirective(), $node,
981
-          $contextVariables);
981
+            $contextVariables);
982 982
 
983 983
         if ($skip && $skip['if'] === true) {
984 984
             return false;
985 985
         }
986 986
 
987 987
         $include = coerceDirectiveValues(IncludeDirective(), $node,
988
-          $contextVariables);
988
+            $contextVariables);
989 989
 
990 990
         if ($include && $include['if'] === false) {
991 991
             return false;
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
     private function getFieldNameKey(FieldNode $node): string
1005 1005
     {
1006 1006
         return $node->getAlias() ? $node->getAlias()
1007
-          ->getValue() : $node->getNameValue();
1007
+            ->getValue() : $node->getNameValue();
1008 1008
     }
1009 1009
 
1010 1010
     /**
@@ -1015,8 +1015,8 @@  discard block
 block discarded – undo
1015 1015
      * @throws InvalidTypeException
1016 1016
      */
1017 1017
     private function doesFragmentConditionMatch(
1018
-      NodeInterface $fragment,
1019
-      ObjectType $type
1018
+        NodeInterface $fragment,
1019
+        ObjectType $type
1020 1020
     ): bool {
1021 1021
         $typeConditionNode = $fragment->getTypeCondition();
1022 1022
 
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
         }
1026 1026
 
1027 1027
         $conditionalType = typeFromAST($this->context->getSchema(),
1028
-          $typeConditionNode);
1028
+            $typeConditionNode);
1029 1029
 
1030 1030
         if ($conditionalType === $type) {
1031 1031
             return true;
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
         if ($conditionalType instanceof AbstractTypeInterface) {
1035 1035
             return $this->context->getSchema()
1036
-              ->isPossibleType($conditionalType, $type);
1036
+                ->isPossibleType($conditionalType, $type);
1037 1037
         }
1038 1038
 
1039 1039
         return false;
@@ -1050,11 +1050,11 @@  discard block
 block discarded – undo
1050 1050
      * @throws ExecutionException
1051 1051
      */
1052 1052
     private function ensureValidRuntimeType(
1053
-      $runtimeTypeOrName,
1054
-      AbstractTypeInterface $returnType,
1055
-      $fieldNodes,
1056
-      ResolveInfo $info,
1057
-      &$result
1053
+        $runtimeTypeOrName,
1054
+        AbstractTypeInterface $returnType,
1055
+        $fieldNodes,
1056
+        ResolveInfo $info,
1057
+        &$result
1058 1058
     ) {
1059 1059
         $runtimeType = is_string($runtimeTypeOrName)
1060 1060
           ? $this->context->getSchema()->getType($runtimeTypeOrName)
@@ -1068,25 +1068,25 @@  discard block
 block discarded – undo
1068 1068
             $fieldName = $info->getFieldName();
1069 1069
 
1070 1070
             throw new ExecutionException(
1071
-              "Abstract type {$returnTypeName} must resolve to an Object type at runtime " .
1072
-              "for field {$parentTypeName}.{$fieldName} with " .
1073
-              'value "' . $result . '", received "{$runtimeTypeName}".'
1071
+                "Abstract type {$returnTypeName} must resolve to an Object type at runtime " .
1072
+                "for field {$parentTypeName}.{$fieldName} with " .
1073
+                'value "' . $result . '", received "{$runtimeTypeName}".'
1074 1074
             );
1075 1075
         }
1076 1076
 
1077 1077
         if (!$this->context->getSchema()
1078
-          ->isPossibleType($returnType, $runtimeType)) {
1078
+            ->isPossibleType($returnType, $runtimeType)) {
1079 1079
             throw new ExecutionException(
1080
-              "Runtime Object type \"{$runtimeTypeName}\" is not a possible type for \"{$returnTypeName}\"."
1080
+                "Runtime Object type \"{$runtimeTypeName}\" is not a possible type for \"{$returnTypeName}\"."
1081 1081
             );
1082 1082
         }
1083 1083
 
1084 1084
         if ($runtimeType !== $this->context->getSchema()
1085 1085
             ->getType($runtimeType->getName())) {
1086 1086
             throw new ExecutionException(
1087
-              "Schema must contain unique named types but contains multiple types named \"{$runtimeTypeName}\". " .
1088
-              "Make sure that `resolveType` function of abstract type \"{$returnTypeName}\" returns the same " .
1089
-              "type instance as referenced anywhere else within the schema."
1087
+                "Schema must contain unique named types but contains multiple types named \"{$runtimeTypeName}\". " .
1088
+                "Make sure that `resolveType` function of abstract type \"{$returnTypeName}\" returns the same " .
1089
+                "type instance as referenced anywhere else within the schema."
1090 1090
             );
1091 1091
         }
1092 1092
 
@@ -1101,17 +1101,17 @@  discard block
 block discarded – undo
1101 1101
      * @return GraphQLException
1102 1102
      */
1103 1103
     protected function buildLocatedError(
1104
-      \Throwable $originalException,
1105
-      array $nodes = [],
1106
-      array $path = []
1104
+        \Throwable $originalException,
1105
+        array $nodes = [],
1106
+        array $path = []
1107 1107
     ): ExecutionException {
1108 1108
         return new ExecutionException(
1109
-          $originalException->getMessage(),
1110
-          $originalException instanceof GraphQLException ? $originalException->getNodes() : $nodes,
1111
-          $originalException instanceof GraphQLException ? $originalException->getSource() : null,
1112
-          $originalException instanceof GraphQLException ? $originalException->getPositions() : null,
1113
-          $originalException instanceof GraphQLException ? ($originalException->getPath() ?? $path) : $path,
1114
-          $originalException
1109
+            $originalException->getMessage(),
1110
+            $originalException instanceof GraphQLException ? $originalException->getNodes() : $nodes,
1111
+            $originalException instanceof GraphQLException ? $originalException->getSource() : null,
1112
+            $originalException instanceof GraphQLException ? $originalException->getPositions() : null,
1113
+            $originalException instanceof GraphQLException ? ($originalException->getPath() ?? $path) : $path,
1114
+            $originalException
1115 1115
         );
1116 1116
     }
1117 1117
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         $promise = new \React\Promise\FulfilledPromise([]);
154 154
 
155
-        $resolve = function (
155
+        $resolve = function(
156 156
           $results,
157 157
           $fieldName,
158 158
           $path,
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
             if ($this->isPromise($result)) {
173 173
                 /** @var ExtendedPromiseInterface $result */
174
-                return $result->then(function ($resolvedResult) use (
174
+                return $result->then(function($resolvedResult) use (
175 175
                   $fieldName,
176 176
                   $results
177 177
                 ) {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         };
187 187
 
188 188
         foreach ($fields as $fieldName => $fieldNodes) {
189
-            $promise = $promise->then(function ($resolvedResults) use (
189
+            $promise = $promise->then(function($resolvedResults) use (
190 190
               $resolve,
191 191
               $fieldName,
192 192
               $path,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             });
200 200
         }
201 201
 
202
-        $promise->then(function ($resolvedResults) use (&$finalResults) {
202
+        $promise->then(function($resolvedResults) use (&$finalResults) {
203 203
             $finalResults = $resolvedResults ?? [];
204 204
         });
205 205
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         if ($isContainsPromise) {
250 250
             $keys = array_keys($finalResults);
251 251
             $promise = \React\Promise\all(array_values($finalResults));
252
-            $promise->then(function ($values) use ($keys, &$finalResults) {
252
+            $promise->then(function($values) use ($keys, &$finalResults) {
253 253
                 foreach ($values as $i => $value) {
254 254
                     $finalResults[$keys[$i]] = $value;
255 255
                 }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                 $context = $this->context;
474 474
                 /** @var ExtendedPromiseInterface $completed */
475 475
                 return $completed->then(null,
476
-                  function ($error) use ($context, $fieldNodes, $path) {
476
+                  function($error) use ($context, $fieldNodes, $path) {
477 477
                       //@TODO Handle $error better
478 478
                       if ($error instanceof \Exception) {
479 479
                           $context->addError($this->buildLocatedError($error,
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
     ) {
554 554
         if ($this->isPromise($result)) {
555 555
             /** @var ExtendedPromiseInterface $result */
556
-            return $result->then(function (&$value) use (
556
+            return $result->then(function(&$value) use (
557 557
               $returnType,
558 558
               $fieldNodes,
559 559
               $info,
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
         if ($this->isPromise($runtimeType)) {
731 731
             /** @var ExtendedPromiseInterface $runtimeType */
732
-            return $runtimeType->then(function ($resolvedRuntimeType) use (
732
+            return $runtimeType->then(function($resolvedRuntimeType) use (
733 733
               $returnType,
734 734
               $fieldNodes,
735 735
               $info,
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 
809 809
         if (!empty($promisedIsTypeOfResults)) {
810 810
             return \React\Promise\all($promisedIsTypeOfResults)
811
-              ->then(function ($isTypeOfResults) use ($possibleTypes) {
811
+              ->then(function($isTypeOfResults) use ($possibleTypes) {
812 812
                   foreach ($isTypeOfResults as $index => $result) {
813 813
                       if ($result) {
814 814
                           return $possibleTypes[$index];
Please login to merge, or discard this patch.
src/Execution/ExecutionProvider.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
      * @var array
17 17
      */
18 18
     protected $provides = [
19
-      ExecutionContextBuilder::class,
20
-      ExecutionInterface::class,
21
-      ValuesHelper::class,
19
+        ExecutionContextBuilder::class,
20
+        ExecutionInterface::class,
21
+        ValuesHelper::class,
22 22
     ];
23 23
 
24 24
     /**
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     public function register()
28 28
     {
29 29
         $this->container->add(ExecutionContextBuilder::class,
30
-          ExecutionContextBuilder::class, true/* $shared */);
30
+            ExecutionContextBuilder::class, true/* $shared */);
31 31
         $this->container->add(ExecutionInterface::class, Execution::class,
32
-          true/* $shared */)
33
-          ->withArgument(ExecutionContextBuilder::class);
32
+            true/* $shared */)
33
+            ->withArgument(ExecutionContextBuilder::class);
34 34
         $this->container->add(ValuesHelper::class, ValuesHelper::class,
35
-          true/* $shared */);
35
+            true/* $shared */);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
src/Execution/ExecutionArguments.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,13 +56,13 @@
 block discarded – undo
56 56
      * @param mixed $fieldResolver
57 57
      */
58 58
     public function __construct(
59
-      Schema $schema,
60
-      DocumentNode $document,
61
-      $rootValue,
62
-      $contextValue,
63
-      array $variableValues,
64
-      OperationDefinitionNode $operation,
65
-      $fieldResolver
59
+        Schema $schema,
60
+        DocumentNode $document,
61
+        $rootValue,
62
+        $contextValue,
63
+        array $variableValues,
64
+        OperationDefinitionNode $operation,
65
+        $fieldResolver
66 66
     ) {
67 67
         $this->schema = $schema;
68 68
         $this->document = $document;
Please login to merge, or discard this patch.
src/Execution/Execution.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -42,23 +42,23 @@
 block discarded – undo
42 42
      * @throws \Exception
43 43
      */
44 44
     public function execute(
45
-      Schema $schema,
46
-      DocumentNode $documentNode,
47
-      $rootValue = null,
48
-      $contextValue = null,
49
-      $variableValues = [],
50
-      $operationName = null,
51
-      callable $fieldResolver = null
45
+        Schema $schema,
46
+        DocumentNode $documentNode,
47
+        $rootValue = null,
48
+        $contextValue = null,
49
+        $variableValues = [],
50
+        $operationName = null,
51
+        callable $fieldResolver = null
52 52
     ): ExecutionResult {
53 53
         try {
54 54
             $context = $this->contextBuilder->buildContext(
55
-              $schema,
56
-              $documentNode,
57
-              $rootValue,
58
-              $contextValue,
59
-              $variableValues,
60
-              $operationName,
61
-              $fieldResolver
55
+                $schema,
56
+                $documentNode,
57
+                $rootValue,
58
+                $contextValue,
59
+                $variableValues,
60
+                $operationName,
61
+                $fieldResolver
62 62
             );
63 63
 
64 64
             // Return early errors if execution context failed.
Please login to merge, or discard this patch.
src/Execution/ExecutionInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
      * @return mixed
21 21
      */
22 22
     public function execute(
23
-      Schema $schema,
24
-      DocumentNode $documentNode,
25
-      $rootValue = null,
26
-      $contextValue = null,
27
-      $variableValues = [],
28
-      $operationName = null,
29
-      callable $fieldResolver = null
23
+        Schema $schema,
24
+        DocumentNode $documentNode,
25
+        $rootValue = null,
26
+        $contextValue = null,
27
+        $variableValues = [],
28
+        $operationName = null,
29
+        callable $fieldResolver = null
30 30
     ): ExecutionResult;
31 31
 }
Please login to merge, or discard this patch.
src/Execution/ExecutorExecutionStrategy.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
         $visitedFragmentNames = [];
27 27
         try {
28 28
             $fields = $this->collectFields(
29
-              $objectType,
30
-              $this->operation->getSelectionSet(),
31
-              $fields,
32
-              $visitedFragmentNames
29
+                $objectType,
30
+                $this->operation->getSelectionSet(),
31
+                $fields,
32
+                $visitedFragmentNames
33 33
             );
34 34
 
35 35
             $result = ($operation === 'mutation')
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         } catch (\Exception $ex) {
42 42
             $this->context->addError(
43
-              new ExecutionException($ex->getMessage())
43
+                new ExecutionException($ex->getMessage())
44 44
             );
45 45
 
46 46
             //@TODO return [null]
Please login to merge, or discard this patch.
src/api.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  * @throws InvariantException
24 24
  */
25 25
 function buildSchema(
26
-  $source,
27
-  $resolverRegistry = [],
28
-  array $options = []
26
+    $source,
27
+    $resolverRegistry = [],
28
+    array $options = []
29 29
 ): SchemaInterface {
30 30
     return GraphQL::buildSchema($source, $resolverRegistry, $options);
31 31
 }
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
  * @throws InvariantException
41 41
  */
42 42
 function extendSchema(
43
-  SchemaInterface $schema,
44
-  $source,
45
-  $resolverRegistry = [],
46
-  array $options = []
43
+    SchemaInterface $schema,
44
+    $source,
45
+    $resolverRegistry = [],
46
+    array $options = []
47 47
 ): SchemaInterface {
48 48
     return GraphQL::extendSchema($schema, $source, $resolverRegistry, $options);
49 49
 }
@@ -120,22 +120,22 @@  discard block
 block discarded – undo
120 120
  * @return ExecutionResult
121 121
  */
122 122
 function execute(
123
-  SchemaInterface $schema,
124
-  DocumentNode $document,
125
-  $rootValue = null,
126
-  $contextValue = null,
127
-  array $variableValues = [],
128
-  $operationName = null,
129
-  callable $fieldResolver = null
123
+    SchemaInterface $schema,
124
+    DocumentNode $document,
125
+    $rootValue = null,
126
+    $contextValue = null,
127
+    array $variableValues = [],
128
+    $operationName = null,
129
+    callable $fieldResolver = null
130 130
 ): ExecutionResult {
131 131
     return GraphQL::execute(
132
-      $schema,
133
-      $document,
134
-      $rootValue,
135
-      $contextValue,
136
-      $variableValues,
137
-      $operationName,
138
-      $fieldResolver
132
+        $schema,
133
+        $document,
134
+        $rootValue,
135
+        $contextValue,
136
+        $variableValues,
137
+        $operationName,
138
+        $fieldResolver
139 139
     );
140 140
 }
141 141
 
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
  * @throws InvariantException
163 163
  */
164 164
 function graphql(
165
-  SchemaInterface $schema,
166
-  string $source,
167
-  $rootValue = null,
168
-  $contextValue = null,
169
-  array $variableValues = [],
170
-  $operationName = null,
171
-  callable $fieldResolver = null
165
+    SchemaInterface $schema,
166
+    string $source,
167
+    $rootValue = null,
168
+    $contextValue = null,
169
+    array $variableValues = [],
170
+    $operationName = null,
171
+    callable $fieldResolver = null
172 172
 ): array {
173 173
     $schemaValidationErrors = validateSchema($schema);
174 174
     if (!empty($schemaValidationErrors)) {
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
     }
190 190
 
191 191
     $result = execute(
192
-      $schema,
193
-      $document,
194
-      $rootValue,
195
-      $contextValue,
196
-      $variableValues,
197
-      $operationName,
198
-      $fieldResolver
192
+        $schema,
193
+        $document,
194
+        $rootValue,
195
+        $contextValue,
196
+        $variableValues,
197
+        $operationName,
198
+        $fieldResolver
199 199
     );
200 200
 
201 201
     return $result->toArray();
Please login to merge, or discard this patch.
src/GraphQL.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -81,19 +81,19 @@  discard block
 block discarded – undo
81 81
      * @var array
82 82
      */
83 83
     private static $providers = [
84
-      CacheProvider::class,
85
-      LanguageProvider::class,
86
-      SchemaBuildingProvider::class,
87
-      SchemaExtensionProvider::class,
88
-      SchemaValidationProvider::class,
89
-      CoercerProvider::class,
90
-      IntrospectionProvider::class,
91
-      ScalarTypesProvider::class,
92
-      DirectivesProvider::class,
93
-      RulesProvider::class,
94
-      ValidationProvider::class,
95
-      ExecutionProvider::class,
96
-      UtilityProvider::class,
84
+        CacheProvider::class,
85
+        LanguageProvider::class,
86
+        SchemaBuildingProvider::class,
87
+        SchemaExtensionProvider::class,
88
+        SchemaValidationProvider::class,
89
+        CoercerProvider::class,
90
+        IntrospectionProvider::class,
91
+        ScalarTypesProvider::class,
92
+        DirectivesProvider::class,
93
+        RulesProvider::class,
94
+        ValidationProvider::class,
95
+        ExecutionProvider::class,
96
+        UtilityProvider::class,
97 97
     ];
98 98
 
99 99
     /**
@@ -137,18 +137,18 @@  discard block
 block discarded – undo
137 137
      * @throws InvariantException
138 138
      */
139 139
     public static function buildSchema(
140
-      $source,
141
-      $resolverRegistry,
142
-      array $options = []
140
+        $source,
141
+        $resolverRegistry,
142
+        array $options = []
143 143
     ): SchemaInterface {
144 144
         return static::make(SchemaBuilderInterface::class)
145
-          ->build(
145
+            ->build(
146 146
             static::parse($source, $options),
147 147
             $resolverRegistry instanceof ResolverRegistryInterface
148 148
               ? $resolverRegistry
149 149
               : new ResolverRegistry($resolverRegistry),
150 150
             $options
151
-          );
151
+            );
152 152
     }
153 153
 
154 154
     /**
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
     public static function make(string $id, array $args = [])
161 161
     {
162 162
         return static::getInstance()
163
-          ->getContainer()
164
-          ->get($id, $args);
163
+            ->getContainer()
164
+            ->get($id, $args);
165 165
     }
166 166
 
167 167
     /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     public static function parse($source, array $options = []): DocumentNode
195 195
     {
196 196
         return static::make(ParserInterface::class)
197
-          ->parse(static::lex($source, $options));
197
+            ->parse(static::lex($source, $options));
198 198
     }
199 199
 
200 200
     /**
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
     {
209 209
         // TODO: Introduce a LexerCreator to allow setting source and options via the constructor.
210 210
         return static::make(LexerInterface::class)
211
-          ->setSource($source instanceof Source ? $source : new Source($source))
212
-          ->setOptions($options);
211
+            ->setSource($source instanceof Source ? $source : new Source($source))
212
+            ->setOptions($options);
213 213
     }
214 214
 
215 215
     /**
@@ -222,20 +222,20 @@  discard block
 block discarded – undo
222 222
      * @throws InvariantException
223 223
      */
224 224
     public static function extendSchema(
225
-      SchemaInterface $schema,
226
-      $source,
227
-      $resolverRegistry,
228
-      array $options = []
225
+        SchemaInterface $schema,
226
+        $source,
227
+        $resolverRegistry,
228
+        array $options = []
229 229
     ): SchemaInterface {
230 230
         return static::make(SchemaExtenderInterface::class)
231
-          ->extend(
231
+            ->extend(
232 232
             $schema,
233 233
             static::parse($source, $options),
234 234
             $resolverRegistry instanceof ResolverRegistryInterface
235 235
               ? $resolverRegistry
236 236
               : new ResolverRegistry($resolverRegistry),
237 237
             $options
238
-          );
238
+            );
239 239
     }
240 240
 
241 241
     /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     public static function validateSchema(SchemaInterface $schema): array
247 247
     {
248 248
         return static::make(SchemaValidatorInterface::class)
249
-          ->validate($schema);
249
+            ->validate($schema);
250 250
     }
251 251
 
252 252
     /**
@@ -257,11 +257,11 @@  discard block
 block discarded – undo
257 257
      * @throws InvariantException
258 258
      */
259 259
     public static function parseValue(
260
-      $source,
261
-      array $options = []
260
+        $source,
261
+        array $options = []
262 262
     ): ValueNodeInterface {
263 263
         return static::make(ParserInterface::class)
264
-          ->parseValue(static::lex($source, $options));
264
+            ->parseValue(static::lex($source, $options));
265 265
     }
266 266
 
267 267
     /**
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
      * @throws InvariantException
273 273
      */
274 274
     public static function parseType(
275
-      $source,
276
-      array $options = []
275
+        $source,
276
+        array $options = []
277 277
     ): TypeNodeInterface {
278 278
         return static::make(ParserInterface::class)
279
-          ->parseType(static::lex($source, $options));
279
+            ->parseType(static::lex($source, $options));
280 280
     }
281 281
 
282 282
     /**
@@ -286,11 +286,11 @@  discard block
 block discarded – undo
286 286
      * @return array
287 287
      */
288 288
     public static function validate(
289
-      SchemaInterface $schema,
290
-      DocumentNode $document
289
+        SchemaInterface $schema,
290
+        DocumentNode $document
291 291
     ): array {
292 292
         return static::make(ValidatorInterface::class)
293
-          ->validate($schema, $document);
293
+            ->validate($schema, $document);
294 294
     }
295 295
 
296 296
     /**
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
      * @return ExecutionResult
306 306
      */
307 307
     public static function execute(
308
-      SchemaInterface $schema,
309
-      DocumentNode $document,
310
-      $rootValue = null,
311
-      $contextValue = null,
312
-      array $variableValues = [],
313
-      $operationName = null,
314
-      callable $fieldResolver = null
308
+        SchemaInterface $schema,
309
+        DocumentNode $document,
310
+        $rootValue = null,
311
+        $contextValue = null,
312
+        array $variableValues = [],
313
+        $operationName = null,
314
+        callable $fieldResolver = null
315 315
     ): ExecutionResult {
316 316
         return static::make(ExecutionInterface::class)
317
-          ->execute(
317
+            ->execute(
318 318
             $schema,
319 319
             $document,
320 320
             $rootValue,
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             $variableValues,
323 323
             $operationName,
324 324
             $fieldResolver
325
-          );
325
+            );
326 326
     }
327 327
 
328 328
     /**
Please login to merge, or discard this patch.