Completed
Pull Request — master (#15)
by Christoffer
06:08 queued 03:44
created
src/Type/directives.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
 {
130 130
     return arraySome(
131 131
         specifiedDirectives(),
132
-        function (DirectiveInterface $specifiedDirective) use ($directive) {
132
+        function(DirectiveInterface $specifiedDirective) use ($directive) {
133 133
             return $specifiedDirective->getName() === $directive->getName();
134 134
         }
135 135
     );
Please login to merge, or discard this patch.
src/Language/Reader/StringReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             if ($code === 92) {
54 54
                 // \
55 55
                 $value .= sliceString($body, $chunkStart, $pos + 1);
56
-                $code  = charCodeAt($body, $pos);
56
+                $code = charCodeAt($body, $pos);
57 57
 
58 58
                 switch ($code) {
59 59
                     case 34:
Please login to merge, or discard this patch.
src/Language/AST/Node/ListValueNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function getValuesAsArray(): array
34 34
     {
35
-        return array_map(function (SerializationInterface $node) {
35
+        return array_map(function(SerializationInterface $node) {
36 36
             return $node->toArray();
37 37
         }, $this->values);
38 38
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/SelectionSetNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function getSelectionsAsArray(): array
35 35
     {
36
-        return array_map(function (SerializationInterface $node) {
36
+        return array_map(function(SerializationInterface $node) {
37 37
             return $node->toArray();
38 38
         }, $this->selections);
39 39
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/DocumentNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function getDefinitionsAsArray(): array
35 35
     {
36
-        return array_map(function (SerializationInterface $node) {
36
+        return array_map(function(SerializationInterface $node) {
37 37
             return $node->toArray();
38 38
         }, $this->definitions);
39 39
     }
Please login to merge, or discard this patch.
src/Type/introspection.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
                 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' .
34 34
                 'exposes all available types and directives on the server, as well as ' .
35 35
                 'the entry points for query, mutation, and subscription operations.',
36
-            'fields'          => function () {
36
+            'fields'          => function() {
37 37
                 return [
38 38
                     'types'            => [
39 39
                         'description' => 'A list of all types supported by this server.',
40 40
                         'type'        => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type()))),
41
-                        'resolve'     => function (SchemaInterface $schema): array {
41
+                        'resolve'     => function(SchemaInterface $schema): array {
42 42
                             return array_values($schema->getTypeMap());
43 43
                         },
44 44
                     ],
45 45
                     'queryType'        => [
46 46
                         'description' => 'The type that query operations will be rooted at.',
47 47
                         'type'        => GraphQLNonNull(__Type()),
48
-                        'resolve'     => function (SchemaInterface $schema): ObjectType {
48
+                        'resolve'     => function(SchemaInterface $schema): ObjectType {
49 49
                             return $schema->getQuery();
50 50
                         },
51 51
                     ],
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                             'If this server supports mutation, the type that ' .
55 55
                             'mutation operations will be rooted at.',
56 56
                         'type'        => __Type(),
57
-                        'resolve'     => function (SchemaInterface $schema): ObjectType {
57
+                        'resolve'     => function(SchemaInterface $schema): ObjectType {
58 58
                             return $schema->getMutation();
59 59
                         },
60 60
                     ],
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
                             'If this server support subscription, the type that ' .
64 64
                             'subscription operations will be rooted at.',
65 65
                         'type'        => __Type(),
66
-                        'resolve'     => function (SchemaInterface $schema): ObjectType {
66
+                        'resolve'     => function(SchemaInterface $schema): ObjectType {
67 67
                             return $schema->getSubscription();
68 68
                         },
69 69
                     ],
70 70
                     'directives'       => [
71 71
                         'description' => 'A list of all directives supported by this server.',
72 72
                         'type'        => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive()))),
73
-                        'resolve'     => function (SchemaInterface $schema): array {
73
+                        'resolve'     => function(SchemaInterface $schema): array {
74 74
                             return $schema->getDirectives();
75 75
                         },
76 76
                     ],
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 'execution behavior in ways field arguments will not suffice, such as ' .
101 101
                 'conditionally including or skipping a field. Directives provide this by ' .
102 102
                 'describing additional information to the executor.',
103
-            'fields'          => function () {
103
+            'fields'          => function() {
104 104
                 return [
105 105
                     'name'        => ['type' => GraphQLNonNull(GraphQLString())],
106 106
                     'description' => ['type' => GraphQLString()],
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     ],
110 110
                     'args'        => [
111 111
                         'type'    => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))),
112
-                        'resolve' => function (DirectiveInterface $directive): array {
112
+                        'resolve' => function(DirectiveInterface $directive): array {
113 113
                             return $directive->getArgs() ?: [];
114 114
                         },
115 115
                     ],
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
                 'Object and Interface types provide the fields they describe. Abstract ' .
218 218
                 'types, Union and Interface, provide the Object types possible ' .
219 219
                 'at runtime. List and NonNull types compose other types.',
220
-            'fields'          => function () {
220
+            'fields'          => function() {
221 221
                 return [
222 222
                     'kind'          => [
223 223
                         'type'    => GraphQLNonNull(__TypeKind()),
224
-                        'resolve' => function (TypeInterface $type) {
224
+                        'resolve' => function(TypeInterface $type) {
225 225
                             if ($type instanceof ScalarType) {
226 226
                                 return TypeKindEnum::SCALAR;
227 227
                             }
@@ -257,14 +257,14 @@  discard block
 block discarded – undo
257 257
                         'args'    => [
258 258
                             'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false],
259 259
                         ],
260
-                        'resolve' => function (TypeInterface $type, array $args): ?array {
260
+                        'resolve' => function(TypeInterface $type, array $args): ?array {
261 261
                             list ($includeDeprecated) = $args;
262 262
 
263 263
                             if ($type instanceof ObjectType || $type instanceof InterfaceType) {
264 264
                                 $fields = array_values($type->getFields());
265 265
 
266 266
                                 if (!$includeDeprecated) {
267
-                                    $fields = array_filter($fields, function (Field $field) {
267
+                                    $fields = array_filter($fields, function(Field $field) {
268 268
                                         return !$field->isDeprecated();
269 269
                                     });
270 270
                                 }
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
                     ],
278 278
                     'interfaces'    => [
279 279
                         'type'    => GraphQLList(GraphQLNonNull(__Type())),
280
-                        'resolve' => function (TypeInterface $type): ?array {
280
+                        'resolve' => function(TypeInterface $type): ?array {
281 281
                             return $type instanceof ObjectType ? $type->getInterfaces() : null;
282 282
                         },
283 283
                     ],
284 284
                     'possibleTypes' => [
285 285
                         'type'    => GraphQLList(GraphQLNonNull(__Type())),
286
-                        'resolve' => function (TypeInterface $type, $args, $context, $info): ?array {
286
+                        'resolve' => function(TypeInterface $type, $args, $context, $info): ?array {
287 287
                             /** @var SchemaInterface $schema */
288 288
                             list ($schema) = $info;
289 289
                             return $type instanceof AbstractType ? $schema->getPossibleTypes($type) : null;
@@ -294,14 +294,14 @@  discard block
 block discarded – undo
294 294
                         'args'    => [
295 295
                             'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false],
296 296
                         ],
297
-                        'resolve' => function (TypeInterface $type, array $args): ?array {
297
+                        'resolve' => function(TypeInterface $type, array $args): ?array {
298 298
                             list ($includeDeprecated) = $args;
299 299
 
300 300
                             if ($type instanceof EnumType) {
301 301
                                 $values = array_values($type->getValues());
302 302
 
303 303
                                 if (!$includeDeprecated) {
304
-                                    $values = array_filter($values, function (Field $field) {
304
+                                    $values = array_filter($values, function(Field $field) {
305 305
                                         return !$field->isDeprecated();
306 306
                                     });
307 307
                                 }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                     ],
315 315
                     'inputFields'   => [
316 316
                         'type'    => GraphQLList(GraphQLNonNull(__InputValue())),
317
-                        'resolve' => function (TypeInterface $type): ?array {
317
+                        'resolve' => function(TypeInterface $type): ?array {
318 318
                             return $type instanceof InputObjectType ? $type->getFields() : null;
319 319
                         },
320 320
                     ],
@@ -341,13 +341,13 @@  discard block
 block discarded – undo
341 341
             'description'     =>
342 342
                 'Object and Interface types are described by a list of Fields, each of ' .
343 343
                 'which has a name, potentially a list of arguments, and a return type.',
344
-            'fields'          => function () {
344
+            'fields'          => function() {
345 345
                 return [
346 346
                     'name'              => ['type' => GraphQLNonNull(GraphQLString())],
347 347
                     'description'       => ['type' => GraphQLString()],
348 348
                     'args'              => [
349 349
                         'type'    => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))),
350
-                        'resolve' => function (DirectiveInterface $directive): array {
350
+                        'resolve' => function(DirectiveInterface $directive): array {
351 351
                             return $directive->getArgs() ?: [];
352 352
                         },
353 353
                     ],
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                 'Arguments provided to Fields or Directives and the input fields of an ' .
378 378
                 'InputObject are represented as Input Values which describe their type ' .
379 379
                 'and optionally a default value.',
380
-            'fields'          => function () {
380
+            'fields'          => function() {
381 381
                 return [
382 382
                     'name'         => ['type' => GraphQLNonNull(GraphQLString())],
383 383
                     'description'  => ['type' => GraphQLString()],
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                         'description' =>
388 388
                             'A GraphQL-formatted string representing the default value for this ' .
389 389
                             'input value.',
390
-                        'resolve'     => function ($inputValue) {
390
+                        'resolve'     => function($inputValue) {
391 391
                             // TODO: Implement this when we have support for printing AST.
392 392
                             return null;
393 393
                         }
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                 'One possible value for a given Enum. Enum values are unique values, not ' .
416 416
                 'a placeholder for a string or numeric value. However an Enum value is ' .
417 417
                 'returned in a JSON response as a string.',
418
-            'fields'          => function () {
418
+            'fields'          => function() {
419 419
                 return [
420 420
                     'name'              => ['type' => GraphQLNonNull(GraphQLString())],
421 421
                     'description'       => ['type' => GraphQLString()],
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
         'name' => '__schema',
481 481
         'type' => GraphQLNonNull(__Schema()),
482 482
         'description' => 'Access the current type schema of this server.',
483
-        'resolve' => function ($source, $args, $context, $info): SchemaInterface {
483
+        'resolve' => function($source, $args, $context, $info): SchemaInterface {
484 484
             list ($schema) = $info;
485 485
             return $schema;
486 486
         }
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         'args' => [
501 501
             'name' => ['type' => GraphQLNonNull(GraphQLString())],
502 502
         ],
503
-        'resolve' => function ($source, $args, $context, $info): TypeInterface {
503
+        'resolve' => function($source, $args, $context, $info): TypeInterface {
504 504
             /** @var SchemaInterface $schema */
505 505
             list ($name) = $args;
506 506
             list ($schema) = $info;
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
         'name' => '__typename',
520 520
         'type' => GraphQLNonNull(GraphQLString()),
521 521
         'description' => 'The name of the current Object type at runtime.',
522
-        'resolve' => function ($source, $args, $context, $info): string {
522
+        'resolve' => function($source, $args, $context, $info): string {
523 523
             /** @var TypeInterface $parentType */
524 524
             list ($parentType) = $info;
525 525
             return $parentType->getName();
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 {
553 553
     return arraySome(
554 554
         introspectionTypes(),
555
-        function (TypeInterface $introspectionType) use ($type) {
555
+        function(TypeInterface $introspectionType) use ($type) {
556 556
             return $type->getName() === $introspectionType->getName();
557 557
         }
558 558
     );
Please login to merge, or discard this patch.
src/Language/AST/Node/DirectiveDefinitionNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function getLocationsAsArray(): array
41 41
     {
42
-        return array_map(function (SerializationInterface $node) {
42
+        return array_map(function(SerializationInterface $node) {
43 43
             return $node->toArray();
44 44
         }, $this->locations);
45 45
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/SchemaDefinitionNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     public function getOperationTypesAsArray(): array
34 34
     {
35
-        return array_map(function (SerializationInterface $node) {
35
+        return array_map(function(SerializationInterface $node) {
36 36
             return $node->toArray();
37 37
         }, $this->operationTypes);
38 38
     }
Please login to merge, or discard this patch.
src/Execution/ExecutionStrategy.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
      */
155 155
     protected function isDefinedField(ObjectType $parentType, string $fieldName)
156 156
     {
157
-       return isset($parentType->getFields()[$fieldName]);
157
+        return isset($parentType->getFields()[$fieldName]);
158 158
     }
159 159
 
160 160
     /**
Please login to merge, or discard this patch.