Passed
Push — master ( a4db6d...341e25 )
by Christoffer
03:13
created
src/Execution/ValuesResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             return $coercedValues;
63 63
         }
64 64
 
65
-        $argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) {
65
+        $argumentNodeMap = keyMap($argumentNodes, function(ArgumentNode $value) {
66 66
             return $value->getNameValue();
67 67
         });
68 68
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         array $variableValues = []
134 134
     ): ?array {
135 135
         $directiveNode = $node->hasDirectives()
136
-            ? find($node->getDirectives(), function (NameAwareInterface $value) use ($directive) {
136
+            ? find($node->getDirectives(), function(NameAwareInterface $value) use ($directive) {
137 137
                 return $value->getNameValue() === $directive->getName();
138 138
             }) : null;
139 139
 
Please login to merge, or discard this patch.
src/Type/Schema.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getDirective(string $name): ?Directive
128 128
     {
129
-        return find($this->directives, function (Directive $directive) use ($name) {
129
+        return find($this->directives, function(Directive $directive) use ($name) {
130 130
             return $directive->getName() === $name;
131 131
         });
132 132
     }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             );
180 180
 
181 181
             $this->possibleTypesMap[$abstractTypeName] = \array_reduce($possibleTypes,
182
-                function (array $map, TypeInterface $type) {
182
+                function(array $map, TypeInterface $type) {
183 183
                     /** @var NameAwareInterface $type */
184 184
                     $map[$type->getName()] = true;
185 185
                     return $map;
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         if ($type instanceof ObjectType || $type instanceof InterfaceType) {
385 385
             foreach ($type->getFields() as $field) {
386 386
                 if ($field->hasArguments()) {
387
-                    $fieldArgTypes = \array_map(function (Argument $argument) {
387
+                    $fieldArgTypes = \array_map(function(Argument $argument) {
388 388
                         return $argument->getType();
389 389
                     }, $field->getArguments());
390 390
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
             return $map;
419 419
         }
420 420
 
421
-        return \array_reduce($directive->getArguments(), function ($map, Argument $argument) {
421
+        return \array_reduce($directive->getArguments(), function($map, Argument $argument) {
422 422
             return $this->typeMapReducer($map, $argument->getType());
423 423
         }, $map);
424 424
     }
Please login to merge, or discard this patch.
src/Type/ScalarTypesProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function register()
35 35
     {
36
-        $this->container->add(GraphQL::BOOLEAN, function (BooleanCoercer $coercer) {
36
+        $this->container->add(GraphQL::BOOLEAN, function(BooleanCoercer $coercer) {
37 37
             return GraphQLScalarType([
38 38
                 'name'         => TypeNameEnum::BOOLEAN,
39 39
                 'description'  => 'The `Boolean` scalar type represents `true` or `false`.',
40
-                'serialize'    => function ($value) use ($coercer) {
40
+                'serialize'    => function($value) use ($coercer) {
41 41
                     return $coercer->coerce($value);
42 42
                 },
43
-                'parseValue'   => function ($value) use ($coercer) {
43
+                'parseValue'   => function($value) use ($coercer) {
44 44
                     return $coercer->coerce($value);
45 45
                 },
46
-                'parseLiteral' => function (NodeInterface $node) {
46
+                'parseLiteral' => function(NodeInterface $node) {
47 47
                     if ($node instanceof BooleanValueNode) {
48 48
                         return $node->getValue();
49 49
                     }
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
         }, true/* $shared */)
54 54
             ->withArgument(BooleanCoercer::class);
55 55
 
56
-        $this->container->add(GraphQL::FLOAT, function (FloatCoercer $coercer) {
56
+        $this->container->add(GraphQL::FLOAT, function(FloatCoercer $coercer) {
57 57
             return GraphQLScalarType([
58 58
                 'name'         => TypeNameEnum::FLOAT,
59 59
                 'description'  =>
60 60
                     'The `Float` scalar type represents signed double-precision fractional ' .
61 61
                     'values as specified by ' .
62 62
                     '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).',
63
-                'serialize'    => function ($value) use ($coercer) {
63
+                'serialize'    => function($value) use ($coercer) {
64 64
                     return $coercer->coerce($value);
65 65
                 },
66
-                'parseValue'   => function ($value) use ($coercer) {
66
+                'parseValue'   => function($value) use ($coercer) {
67 67
                     return $coercer->coerce($value);
68 68
                 },
69
-                'parseLiteral' => function (NodeInterface $node) {
69
+                'parseLiteral' => function(NodeInterface $node) {
70 70
                     if ($node instanceof FloatValueNode || $node instanceof IntValueNode) {
71 71
                         return $node->getValue();
72 72
                     }
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
         }, true/* $shared */)
77 77
             ->withArgument(FloatCoercer::class);
78 78
 
79
-        $this->container->add(GraphQL::INT, function (IntCoercer $coercer) {
79
+        $this->container->add(GraphQL::INT, function(IntCoercer $coercer) {
80 80
             return GraphQLScalarType([
81 81
                 'name'         => TypeNameEnum::INT,
82 82
                 'description'  =>
83 83
                     'The `Int` scalar type represents non-fractional signed whole numeric ' .
84 84
                     'values. Int can represent values between -(2^31) and 2^31 - 1.',
85
-                'serialize'    => function ($value) use ($coercer) {
85
+                'serialize'    => function($value) use ($coercer) {
86 86
                     return $coercer->coerce($value);
87 87
                 },
88
-                'parseValue'   => function ($value) use ($coercer) {
88
+                'parseValue'   => function($value) use ($coercer) {
89 89
                     return $coercer->coerce($value);
90 90
                 },
91
-                'parseLiteral' => function (NodeInterface $node) {
91
+                'parseLiteral' => function(NodeInterface $node) {
92 92
                     if ($node instanceof IntValueNode) {
93 93
                         $value = (int)$node->getValue();
94 94
                         if ((string)$node->getValue() === (string)$value &&
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }, true/* $shared */)
103 103
             ->withArgument(IntCoercer::class);
104 104
 
105
-        $this->container->add(GraphQL::ID, function (StringCoercer $coercer) {
105
+        $this->container->add(GraphQL::ID, function(StringCoercer $coercer) {
106 106
             return GraphQLScalarType([
107 107
                 'name'         => TypeNameEnum::ID,
108 108
                 'description'  =>
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
                     'response as a String; however, it is not intended to be human-readable. ' .
112 112
                     'When expected as an input type, any string (such as `"4"`) or integer ' .
113 113
                     '(such as `4`) input value will be accepted as an ID.',
114
-                'serialize'    => function ($value) use ($coercer) {
114
+                'serialize'    => function($value) use ($coercer) {
115 115
                     return $coercer->coerce($value);
116 116
                 },
117
-                'parseValue'   => function ($value) use ($coercer) {
117
+                'parseValue'   => function($value) use ($coercer) {
118 118
                     return $coercer->coerce($value);
119 119
                 },
120
-                'parseLiteral' => function (NodeInterface $node) {
120
+                'parseLiteral' => function(NodeInterface $node) {
121 121
                     if ($node instanceof StringValueNode || $node instanceof IntValueNode) {
122 122
                         return $node->getValue();
123 123
                     }
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
         }, true/* $shared */)
128 128
             ->withArgument(StringCoercer::class);
129 129
 
130
-        $this->container->add(GraphQL::STRING, function (StringCoercer $coercer) {
130
+        $this->container->add(GraphQL::STRING, function(StringCoercer $coercer) {
131 131
             return GraphQLScalarType([
132 132
                 'name'         => TypeNameEnum::STRING,
133 133
                 'description'  =>
134 134
                     'The `String` scalar type represents textual data, represented as UTF-8 ' .
135 135
                     'character sequences. The String type is most often used by GraphQL to ' .
136 136
                     'represent free-form human-readable text.',
137
-                'serialize'    => function ($value) use ($coercer) {
137
+                'serialize'    => function($value) use ($coercer) {
138 138
                     return $coercer->coerce($value);
139 139
                 },
140
-                'parseValue'   => function ($value) use ($coercer) {
140
+                'parseValue'   => function($value) use ($coercer) {
141 141
                     return $coercer->coerce($value);
142 142
                 },
143
-                'parseLiteral' => function (NodeInterface $node) {
143
+                'parseLiteral' => function(NodeInterface $node) {
144 144
                     if ($node instanceof StringValueNode) {
145 145
                         return $node->getValue();
146 146
                     }
Please login to merge, or discard this patch.
src/Execution/ExecutionResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $array = ['data' => $this->data];
67 67
 
68 68
         if (!empty($this->errors)) {
69
-            $array['errors'] = array_map(function (GraphQLException $error) {
69
+            $array['errors'] = array_map(function(GraphQLException $error) {
70 70
                 return $error->toArray();
71 71
             }, $this->errors);
72 72
         }
Please login to merge, or discard this patch.
src/Error/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
         $line < \count($lines) ? leftPad($padLen, $nextLineNum) . ': ' . $lines[$line] : null,
105 105
     ];
106 106
 
107
-    return \implode("\n", \array_filter($outputLines, function ($line) {
107
+    return \implode("\n", \array_filter($outputLines, function($line) {
108 108
         return null !== $line;
109 109
     }));
110 110
 }
Please login to merge, or discard this patch.
src/Type/introspection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 {
125 125
     return arraySome(
126 126
         introspectionTypes(),
127
-        function (TypeInterface $introspectionType) use ($type) {
127
+        function(TypeInterface $introspectionType) use ($type) {
128 128
             /** @noinspection PhpUndefinedMethodInspection */
129 129
             return $type->getName() === $introspectionType->getName();
130 130
         }
Please login to merge, or discard this patch.
src/Type/IntrospectionProvider.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     protected function registerIntrospectionTypes()
58 58
     {
59
-        $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function () {
59
+        $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function() {
60 60
             return GraphQLObjectType([
61 61
                 'name'            => GraphQL::SCHEMA_INTROSPECTION,
62 62
                 'isIntrospection' => true,
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
                     'A GraphQL Schema defines the capabilities of a GraphQL server. It ' .
65 65
                     'exposes all available types and directives on the server, as well as ' .
66 66
                     'the entry points for query, mutation, and subscription operations.',
67
-                'fields'          => function () {
67
+                'fields'          => function() {
68 68
                     return [
69 69
                         'types'            => [
70 70
                             'description' => 'A list of all types supported by this server.',
71 71
                             'type'        => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type()))),
72
-                            'resolve'     => function (SchemaInterface $schema): array {
72
+                            'resolve'     => function(SchemaInterface $schema): array {
73 73
                                 return array_values($schema->getTypeMap());
74 74
                             },
75 75
                         ],
76 76
                         'queryType'        => [
77 77
                             'description' => 'The type that query operations will be rooted at.',
78 78
                             'type'        => GraphQLNonNull(__Type()),
79
-                            'resolve'     => function (SchemaInterface $schema): ?TypeInterface {
79
+                            'resolve'     => function(SchemaInterface $schema): ?TypeInterface {
80 80
                                 return $schema->getQueryType();
81 81
                             },
82 82
                         ],
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                                 'If this server supports mutation, the type that ' .
86 86
                                 'mutation operations will be rooted at.',
87 87
                             'type'        => __Type(),
88
-                            'resolve'     => function (SchemaInterface $schema): ?TypeInterface {
88
+                            'resolve'     => function(SchemaInterface $schema): ?TypeInterface {
89 89
                                 return $schema->getMutationType();
90 90
                             },
91 91
                         ],
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
                                 'If this server support subscription, the type that ' .
95 95
                                 'subscription operations will be rooted at.',
96 96
                             'type'        => __Type(),
97
-                            'resolve'     => function (SchemaInterface $schema): ?TypeInterface {
97
+                            'resolve'     => function(SchemaInterface $schema): ?TypeInterface {
98 98
                                 return $schema->getSubscriptionType();
99 99
                             },
100 100
                         ],
101 101
                         'directives'       => [
102 102
                             'description' => 'A list of all directives supported by this server.',
103 103
                             'type'        => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive()))),
104
-                            'resolve'     => function (SchemaInterface $schema): array {
104
+                            'resolve'     => function(SchemaInterface $schema): array {
105 105
                                 return $schema->getDirectives();
106 106
                             },
107 107
                         ],
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             ]);
111 111
         }, true/* $shared */);
112 112
 
113
-        $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function () {
113
+        $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function() {
114 114
             return GraphQLObjectType([
115 115
                 'name'            => GraphQL::DIRECTIVE_INTROSPECTION,
116 116
                 'isIntrospection' => true,
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                     'execution behavior in ways field arguments will not suffice, such as ' .
122 122
                     'conditionally including or skipping a field. Directives provide this by ' .
123 123
                     'describing additional information to the executor.',
124
-                'fields'          => function () {
124
+                'fields'          => function() {
125 125
                     return [
126 126
                         'name'        => ['type' => GraphQLNonNull(GraphQLString())],
127 127
                         'description' => ['type' => GraphQLString()],
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                         ],
131 131
                         'args'        => [
132 132
                             'type'    => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))),
133
-                            'resolve' => function (DirectiveInterface $directive): array {
133
+                            'resolve' => function(DirectiveInterface $directive): array {
134 134
                                 return $directive->getArguments() ?: [];
135 135
                             },
136 136
                         ],
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             ]);
140 140
         }, true/* $shared */);
141 141
 
142
-        $this->container->add(GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, function () {
142
+        $this->container->add(GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, function() {
143 143
             return GraphQLEnumType([
144 144
                 'name'            => GraphQL::DIRECTIVE_LOCATION_INTROSPECTION,
145 145
                 'isIntrospection' => true,
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             ]);
206 206
         }, true/* $shared */);
207 207
 
208
-        $this->container->add(GraphQL::TYPE_INTROSPECTION, function () {
208
+        $this->container->add(GraphQL::TYPE_INTROSPECTION, function() {
209 209
             return GraphQLObjectType([
210 210
                 'name'            => GraphQL::TYPE_INTROSPECTION,
211 211
                 'isIntrospection' => true,
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
                     'Object and Interface types provide the fields they describe. Abstract ' .
219 219
                     'types, Union and Interface, provide the Object types possible ' .
220 220
                     'at runtime. List and NonNull types compose other types.',
221
-                'fields'          => function () {
221
+                'fields'          => function() {
222 222
                     return [
223 223
                         'kind'          => [
224 224
                             'type'    => GraphQLNonNull(__TypeKind()),
225
-                            'resolve' => function (TypeInterface $type) {
225
+                            'resolve' => function(TypeInterface $type) {
226 226
                                 if ($type instanceof ScalarType) {
227 227
                                     return TypeKindEnum::SCALAR;
228 228
                                 }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                             'args'    => [
259 259
                                 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false],
260 260
                             ],
261
-                            'resolve' => function (TypeInterface $type, array $args):
261
+                            'resolve' => function(TypeInterface $type, array $args):
262 262
                             ?array {
263 263
                                 $includeDeprecated = $args[0] ?? null;
264 264
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                                     $fields = array_values($type->getFields());
267 267
 
268 268
                                     if (!$includeDeprecated) {
269
-                                        $fields = array_filter($fields, function (Field $field) {
269
+                                        $fields = array_filter($fields, function(Field $field) {
270 270
                                             return !$field->getIsDeprecated();
271 271
                                         });
272 272
                                     }
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
                         ],
280 280
                         'interfaces'    => [
281 281
                             'type'    => GraphQLList(GraphQLNonNull(__Type())),
282
-                            'resolve' => function (TypeInterface $type): ?array {
282
+                            'resolve' => function(TypeInterface $type): ?array {
283 283
                                 return $type instanceof ObjectType ? $type->getInterfaces() : null;
284 284
                             },
285 285
                         ],
286 286
                         'possibleTypes' => [
287 287
                             'type'    => GraphQLList(GraphQLNonNull(__Type())),
288
-                            'resolve' => function (
288
+                            'resolve' => function(
289 289
                                 TypeInterface $type,
290 290
                                 array $args,
291 291
                                 array $context,
@@ -303,14 +303,14 @@  discard block
 block discarded – undo
303 303
                             'args'    => [
304 304
                                 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false],
305 305
                             ],
306
-                            'resolve' => function (TypeInterface $type, array $args): ?array {
306
+                            'resolve' => function(TypeInterface $type, array $args): ?array {
307 307
                                 [$includeDeprecated] = $args;
308 308
 
309 309
                                 if ($type instanceof EnumType) {
310 310
                                     $values = array_values($type->getValues());
311 311
 
312 312
                                     if (!$includeDeprecated) {
313
-                                        $values = array_filter($values, function (Field $field) {
313
+                                        $values = array_filter($values, function(Field $field) {
314 314
                                             return !$field->getIsDeprecated();
315 315
                                         });
316 316
                                     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                         ],
324 324
                         'inputFields'   => [
325 325
                             'type'    => GraphQLList(GraphQLNonNull(__InputValue())),
326
-                            'resolve' => function (TypeInterface $type): ?array {
326
+                            'resolve' => function(TypeInterface $type): ?array {
327 327
                                 return $type instanceof InputObjectType ? $type->getFields() : null;
328 328
                             },
329 329
                         ],
@@ -333,20 +333,20 @@  discard block
 block discarded – undo
333 333
             ]);
334 334
         }, true/* $shared */);
335 335
 
336
-        $this->container->add(GraphQL::FIELD_INTROSPECTION, function () {
336
+        $this->container->add(GraphQL::FIELD_INTROSPECTION, function() {
337 337
             return GraphQLObjectType([
338 338
                 'name'            => GraphQL::FIELD_INTROSPECTION,
339 339
                 'isIntrospection' => true,
340 340
                 'description'     =>
341 341
                     'Object and Interface types are described by a list of Fields, each of ' .
342 342
                     'which has a name, potentially a list of arguments, and a return type.',
343
-                'fields'          => function () {
343
+                'fields'          => function() {
344 344
                     return [
345 345
                         'name'              => ['type' => GraphQLNonNull(GraphQLString())],
346 346
                         'description'       => ['type' => GraphQLString()],
347 347
                         'args'              => [
348 348
                             'type'    => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))),
349
-                            'resolve' => function (ArgumentsAwareInterface $directive): array {
349
+                            'resolve' => function(ArgumentsAwareInterface $directive): array {
350 350
                                 return $directive->getArguments() ?? [];
351 351
                             },
352 352
                         ],
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             ]);
359 359
         }, true/* $shared */);
360 360
 
361
-        $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function () {
361
+        $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function() {
362 362
             return GraphQLObjectType([
363 363
                 'name'            => GraphQL::INPUT_VALUE_INTROSPECTION,
364 364
                 'isIntrospection' => true,
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                     'Arguments provided to Fields or Directives and the input fields of an ' .
367 367
                     'InputObject are represented as Input Values which describe their type ' .
368 368
                     'and optionally a default value.',
369
-                'fields'          => function () {
369
+                'fields'          => function() {
370 370
                     return [
371 371
                         'name'         => ['type' => GraphQLNonNull(GraphQLString())],
372 372
                         'description'  => ['type' => GraphQLString()],
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                             'description' =>
377 377
                                 'A GraphQL-formatted string representing the default value for this ' .
378 378
                                 'input value.',
379
-                            'resolve'     => function ($inputValue) {
379
+                            'resolve'     => function($inputValue) {
380 380
                                 // TODO: Implement this when we have support for printing AST.
381 381
                                 return null;
382 382
                             }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
             ]);
387 387
         }, true/* $shared */);
388 388
 
389
-        $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function () {
389
+        $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function() {
390 390
             return GraphQLObjectType([
391 391
                 'name'            => GraphQL::ENUM_VALUE_INTROSPECTION,
392 392
                 'isIntrospection' => true,
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                     'One possible value for a given Enum. Enum values are unique values, not ' .
395 395
                     'a placeholder for a string or numeric value. However an Enum value is ' .
396 396
                     'returned in a JSON response as a string.',
397
-                'fields'          => function () {
397
+                'fields'          => function() {
398 398
                     return [
399 399
                         'name'              => ['type' => GraphQLNonNull(GraphQLString())],
400 400
                         'description'       => ['type' => GraphQLString()],
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             ]);
406 406
         }, true/* $shared */);
407 407
 
408
-        $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function () {
408
+        $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function() {
409 409
             return GraphQLEnumType([
410 410
                 'name'            => GraphQL::TYPE_KIND_INTROSPECTION,
411 411
                 'isIntrospection' => true,
@@ -445,19 +445,19 @@  discard block
 block discarded – undo
445 445
      */
446 446
     protected function registerMetaFields()
447 447
     {
448
-        $this->container->add(GraphQL::SCHEMA_META_FIELD_DEFINITION, function ($__Schema) {
448
+        $this->container->add(GraphQL::SCHEMA_META_FIELD_DEFINITION, function($__Schema) {
449 449
             return new Field([
450 450
                 'name'        => '__schema',
451 451
                 'type'        => GraphQLNonNull($__Schema),
452 452
                 'description' => 'Access the current type schema of this server.',
453
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): SchemaInterface {
453
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): SchemaInterface {
454 454
                     return $info->getSchema();
455 455
                 }
456 456
             ]);
457 457
         })
458 458
             ->withArgument(GraphQL::SCHEMA_INTROSPECTION);
459 459
 
460
-        $this->container->add(GraphQL::TYPE_META_FIELD_DEFINITION, function ($__Type) {
460
+        $this->container->add(GraphQL::TYPE_META_FIELD_DEFINITION, function($__Type) {
461 461
             return new Field([
462 462
                 'name'        => '__type',
463 463
                 'type'        => $__Type,
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                 'args'        => [
466 466
                     'name' => ['type' => GraphQLNonNull(GraphQLString())],
467 467
                 ],
468
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): TypeInterface {
468
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): TypeInterface {
469 469
                     ['name' => $name] = $args;
470 470
                     $schema = $info->getSchema();
471 471
                     return $schema->getType($name);
@@ -474,12 +474,12 @@  discard block
 block discarded – undo
474 474
         })
475 475
             ->withArgument(GraphQL::TYPE_INTROSPECTION);
476 476
 
477
-        $this->container->add(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function () {
477
+        $this->container->add(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function() {
478 478
             return new Field([
479 479
                 'name'        => '__typename',
480 480
                 'type'        => GraphQLNonNull(GraphQLString()),
481 481
                 'description' => 'The name of the current Object type at runtime.',
482
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): string {
482
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): string {
483 483
                     $parentType = $info->getParentType();
484 484
                     return null !== $parentType ? $parentType->getName() : null;
485 485
                 }
Please login to merge, or discard this patch.
src/Execution/ExecutionStrategy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if ($isContainsPromise) {
252 252
             $keys    = array_keys($finalResults);
253 253
             $promise = \React\Promise\all(array_values($finalResults));
254
-            $promise->then(function ($values) use ($keys, &$finalResults) {
254
+            $promise->then(function($values) use ($keys, &$finalResults) {
255 255
                 foreach ($values as $i => $value) {
256 256
                     $finalResults[$keys[$i]] = $value;
257 257
                 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
         $promise = new \React\Promise\FulfilledPromise([]);
287 287
 
288
-        $resolve = function ($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) {
288
+        $resolve = function($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) {
289 289
             $fieldPath   = $path;
290 290
             $fieldPath[] = $fieldName;
291 291
             try {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
             if ($this->isPromise($result)) {
298 298
                 /** @var ExtendedPromiseInterface $result */
299
-                return $result->then(function ($resolvedResult) use ($fieldName, $results) {
299
+                return $result->then(function($resolvedResult) use ($fieldName, $results) {
300 300
                     $results[$fieldName] = $resolvedResult;
301 301
                     return $results;
302 302
                 });
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         };
309 309
 
310 310
         foreach ($fields as $fieldName => $fieldNodes) {
311
-            $promise = $promise->then(function ($resolvedResults) use (
311
+            $promise = $promise->then(function($resolvedResults) use (
312 312
                 $resolve,
313 313
                 $fieldName,
314 314
                 $path,
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             });
321 321
         }
322 322
 
323
-        $promise->then(function ($resolvedResults) use (&$finalResults) {
323
+        $promise->then(function($resolvedResults) use (&$finalResults) {
324 324
             $finalResults = $resolvedResults ?? [];
325 325
         });
326 326
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
             if ($this->isPromise($completed)) {
505 505
                 $context = $this->context;
506 506
                 /** @var ExtendedPromiseInterface $completed */
507
-                return $completed->then(null, function ($error) use ($context, $fieldNodes, $path) {
507
+                return $completed->then(null, function($error) use ($context, $fieldNodes, $path) {
508 508
                     $context->addError($this->buildLocatedError($error, $fieldNodes, $path));
509 509
                     return new \React\Promise\FulfilledPromise(null);
510 510
                 });
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
     ) {
573 573
         if ($this->isPromise($result)) {
574 574
             /** @var ExtendedPromiseInterface $result */
575
-            return $result->then(function (&$value) use ($returnType, $fieldNodes, $info, $path) {
575
+            return $result->then(function(&$value) use ($returnType, $fieldNodes, $info, $path) {
576 576
                 return $this->completeValue($returnType, $fieldNodes, $info, $path, $value);
577 577
             });
578 578
         }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
         if ($this->isPromise($runtimeType)) {
662 662
             /** @var ExtendedPromiseInterface $runtimeType */
663
-            return $runtimeType->then(function ($resolvedRuntimeType) use (
663
+            return $runtimeType->then(function($resolvedRuntimeType) use (
664 664
                 $returnType,
665 665
                 $fieldNodes,
666 666
                 $info,
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
         if (!empty($promisedIsTypeOfResults)) {
787 787
             return \React\Promise\all($promisedIsTypeOfResults)
788
-                ->then(function ($isTypeOfResults) use ($possibleTypes) {
788
+                ->then(function($isTypeOfResults) use ($possibleTypes) {
789 789
                     foreach ($isTypeOfResults as $index => $result) {
790 790
                         if ($result) {
791 791
                             return $possibleTypes[$index];
Please login to merge, or discard this patch.
src/Language/LanguageProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function register()
33 33
     {
34
-        $this->container->add(ASTDirectorInterface::class, function () {
34
+        $this->container->add(ASTDirectorInterface::class, function() {
35 35
             return new ASTDirector(SupportedASTBuilders::get());
36 36
         });
37 37
 
38
-        $this->container->add(NodeDirectorInterface::class, function () {
38
+        $this->container->add(NodeDirectorInterface::class, function() {
39 39
             return new NodeDirector(SupportedNodeBuilders::get());
40 40
         });
41 41
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             ->withArgument(ASTDirectorInterface::class)
44 44
             ->withArgument(NodeDirectorInterface::class);
45 45
 
46
-        $this->container->add(LexerInterface::class, function () {
46
+        $this->container->add(LexerInterface::class, function() {
47 47
             return new Lexer(SupportedReaders::get());
48 48
         });
49 49
 
Please login to merge, or discard this patch.