@@ -251,7 +251,7 @@ discard block |
||
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 | } |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | if ($this->isPromise($completed)) { |
476 | 476 | $context = $this->context; |
477 | 477 | /** @var ExtendedPromiseInterface $completed */ |
478 | - return $completed->then(null, function ($error) use ($context) { |
|
478 | + return $completed->then(null, function($error) use ($context) { |
|
479 | 479 | $context->addError($error); |
480 | 480 | return new \React\Promise\FulfilledPromise(null); |
481 | 481 | }); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | ) { |
542 | 542 | if ($this->isPromise($result)) { |
543 | 543 | /** @var ExtendedPromiseInterface $result */ |
544 | - return $result->then(function (&$value) use ($returnType, $fieldNodes, $info, $path) { |
|
544 | + return $result->then(function(&$value) use ($returnType, $fieldNodes, $info, $path) { |
|
545 | 545 | return $this->completeValue($returnType, $fieldNodes, $info, $path, $value); |
546 | 546 | }); |
547 | 547 | } |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | |
630 | 630 | if ($this->isPromise($runtimeType)) { |
631 | 631 | /** @var ExtendedPromiseInterface $runtimeType */ |
632 | - return $runtimeType->then(function ($resolvedRuntimeType) use ( |
|
632 | + return $runtimeType->then(function($resolvedRuntimeType) use ( |
|
633 | 633 | $returnType, |
634 | 634 | $fieldNodes, |
635 | 635 | $info, |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | |
745 | 745 | if (!empty($promisedIsTypeOfResults)) { |
746 | 746 | return \React\Promise\all($promisedIsTypeOfResults) |
747 | - ->then(function ($isTypeOfResults) use ($possibleTypes) { |
|
747 | + ->then(function($isTypeOfResults) use ($possibleTypes) { |
|
748 | 748 | foreach ($isTypeOfResults as $index => $result) { |
749 | 749 | if ($result) { |
750 | 750 | return $possibleTypes[$index]; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $builtInTypes = keyMap( |
99 | 99 | \array_merge(specifiedScalarTypes(), introspectionTypes()), |
100 | - function (NamedTypeInterface $type) { |
|
100 | + function(NamedTypeInterface $type) { |
|
101 | 101 | return $type->getName(); |
102 | 102 | } |
103 | 103 | ); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | return GraphQLDirective([ |
160 | 160 | 'name' => $node->getNameValue(), |
161 | 161 | 'description' => $node->getDescriptionValue(), |
162 | - 'locations' => \array_map(function (NameNode $node) { |
|
162 | + 'locations' => \array_map(function(NameNode $node) { |
|
163 | 163 | return $node->getValue(); |
164 | 164 | }, $node->getLocations()), |
165 | 165 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -208,10 +208,10 @@ discard block |
||
208 | 208 | { |
209 | 209 | return keyValueMap( |
210 | 210 | $nodes, |
211 | - function (InputValueDefinitionNode $value) { |
|
211 | + function(InputValueDefinitionNode $value) { |
|
212 | 212 | return $value->getNameValue(); |
213 | 213 | }, |
214 | - function (InputValueDefinitionNode $value): array { |
|
214 | + function(InputValueDefinitionNode $value): array { |
|
215 | 215 | $type = $this->buildWrappedType($value->getType()); |
216 | 216 | $defaultValue = $value->getDefaultValue(); |
217 | 217 | return [ |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | return GraphQLObjectType([ |
264 | 264 | 'name' => $node->getNameValue(), |
265 | 265 | 'description' => $node->getDescriptionValue(), |
266 | - 'fields' => function () use ($node) { |
|
266 | + 'fields' => function() use ($node) { |
|
267 | 267 | return $this->buildFields($node); |
268 | 268 | }, |
269 | - 'interfaces' => function () use ($node) { |
|
270 | - return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) { |
|
269 | + 'interfaces' => function() use ($node) { |
|
270 | + return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) { |
|
271 | 271 | return $this->buildType($interface); |
272 | 272 | }, $node->getInterfaces()) : []; |
273 | 273 | }, |
@@ -284,11 +284,11 @@ discard block |
||
284 | 284 | |
285 | 285 | return $node->hasFields() ? keyValueMap( |
286 | 286 | $node->getFields(), |
287 | - function ($value) { |
|
287 | + function($value) { |
|
288 | 288 | /** @noinspection PhpUndefinedMethodInspection */ |
289 | 289 | return $value->getNameValue(); |
290 | 290 | }, |
291 | - function ($value) use ($resolverMap) { |
|
291 | + function($value) use ($resolverMap) { |
|
292 | 292 | return $this->buildField($value, $resolverMap); |
293 | 293 | } |
294 | 294 | ) : []; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | return GraphQLInterfaceType([ |
304 | 304 | 'name' => $node->getNameValue(), |
305 | 305 | 'description' => $node->getDescriptionValue(), |
306 | - 'fields' => function () use ($node): array { |
|
306 | + 'fields' => function() use ($node): array { |
|
307 | 307 | return $this->buildFields($node); |
308 | 308 | }, |
309 | 309 | 'astNode' => $node, |
@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | 'description' => $node->getDescriptionValue(), |
322 | 322 | 'values' => $node->hasValues() ? keyValueMap( |
323 | 323 | $node->getValues(), |
324 | - function (EnumValueDefinitionNode $value): string { |
|
324 | + function(EnumValueDefinitionNode $value): string { |
|
325 | 325 | return $value->getNameValue(); |
326 | 326 | }, |
327 | - function (EnumValueDefinitionNode $value): array { |
|
327 | + function(EnumValueDefinitionNode $value): array { |
|
328 | 328 | return [ |
329 | 329 | 'description' => $value->getDescriptionValue(), |
330 | 330 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | return GraphQLUnionType([ |
346 | 346 | 'name' => $node->getNameValue(), |
347 | 347 | 'description' => $node->getDescriptionValue(), |
348 | - 'types' => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) { |
|
348 | + 'types' => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) { |
|
349 | 349 | return $this->buildType($type); |
350 | 350 | }, $node->getTypes()) : [], |
351 | 351 | 'astNode' => $node, |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | return GraphQLScalarType([ |
362 | 362 | 'name' => $node->getNameValue(), |
363 | 363 | 'description' => $node->getDescriptionValue(), |
364 | - 'serialize' => function ($value) { |
|
364 | + 'serialize' => function($value) { |
|
365 | 365 | return $value; |
366 | 366 | }, |
367 | 367 | 'astNode' => $node, |
@@ -377,13 +377,13 @@ discard block |
||
377 | 377 | return GraphQLInputObjectType([ |
378 | 378 | 'name' => $node->getNameValue(), |
379 | 379 | 'description' => $node->getDescriptionValue(), |
380 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
380 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
381 | 381 | return keyValueMap( |
382 | 382 | $node->getFields(), |
383 | - function (InputValueDefinitionNode $value): string { |
|
383 | + function(InputValueDefinitionNode $value): string { |
|
384 | 384 | return $value->getNameValue(); |
385 | 385 | }, |
386 | - function (InputValueDefinitionNode $value): array { |
|
386 | + function(InputValueDefinitionNode $value): array { |
|
387 | 387 | $type = $this->buildWrappedType($value->getType()); |
388 | 388 | return [ |
389 | 389 | 'type' => $type, |
@@ -126,7 +126,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -33,17 +33,17 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -66,7 +66,7 @@ |
||
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 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function register() |
44 | 44 | { |
45 | - $this->container->add(GraphQL::INTROSPECTION_SCHEMA, function () { |
|
45 | + $this->container->add(GraphQL::INTROSPECTION_SCHEMA, function() { |
|
46 | 46 | return GraphQLObjectType([ |
47 | 47 | 'name' => GraphQL::INTROSPECTION_SCHEMA, |
48 | 48 | 'isIntrospection' => true, |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' . |
51 | 51 | 'exposes all available types and directives on the server, as well as ' . |
52 | 52 | 'the entry points for query, mutation, and subscription operations.', |
53 | - 'fields' => function () { |
|
53 | + 'fields' => function() { |
|
54 | 54 | return [ |
55 | 55 | 'types' => [ |
56 | 56 | 'description' => 'A list of all types supported by this server.', |
57 | 57 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type()))), |
58 | - 'resolve' => function (SchemaInterface $schema): array { |
|
58 | + 'resolve' => function(SchemaInterface $schema): array { |
|
59 | 59 | return array_values($schema->getTypeMap()); |
60 | 60 | }, |
61 | 61 | ], |
62 | 62 | 'queryType' => [ |
63 | 63 | 'description' => 'The type that query operations will be rooted at.', |
64 | 64 | 'type' => GraphQLNonNull(__Type()), |
65 | - 'resolve' => function (SchemaInterface $schema): ?TypeInterface { |
|
65 | + 'resolve' => function(SchemaInterface $schema): ?TypeInterface { |
|
66 | 66 | return $schema->getQueryType(); |
67 | 67 | }, |
68 | 68 | ], |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | 'If this server supports mutation, the type that ' . |
72 | 72 | 'mutation operations will be rooted at.', |
73 | 73 | 'type' => __Type(), |
74 | - 'resolve' => function (SchemaInterface $schema): ?TypeInterface { |
|
74 | + 'resolve' => function(SchemaInterface $schema): ?TypeInterface { |
|
75 | 75 | return $schema->getMutationType(); |
76 | 76 | }, |
77 | 77 | ], |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | 'If this server support subscription, the type that ' . |
81 | 81 | 'subscription operations will be rooted at.', |
82 | 82 | 'type' => __Type(), |
83 | - 'resolve' => function (SchemaInterface $schema): ?TypeInterface { |
|
83 | + 'resolve' => function(SchemaInterface $schema): ?TypeInterface { |
|
84 | 84 | return $schema->getSubscriptionType(); |
85 | 85 | }, |
86 | 86 | ], |
87 | 87 | 'directives' => [ |
88 | 88 | 'description' => 'A list of all directives supported by this server.', |
89 | 89 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive()))), |
90 | - 'resolve' => function (SchemaInterface $schema): array { |
|
90 | + 'resolve' => function(SchemaInterface $schema): array { |
|
91 | 91 | return $schema->getDirectives(); |
92 | 92 | }, |
93 | 93 | ], |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ]); |
97 | 97 | }, true/* $shared */); |
98 | 98 | |
99 | - $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE, function () { |
|
99 | + $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE, function() { |
|
100 | 100 | return GraphQLObjectType([ |
101 | 101 | 'name' => GraphQL::INTROSPECTION_DIRECTIVE, |
102 | 102 | 'isIntrospection' => true, |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'execution behavior in ways field arguments will not suffice, such as ' . |
108 | 108 | 'conditionally including or skipping a field. Directives provide this by ' . |
109 | 109 | 'describing additional information to the executor.', |
110 | - 'fields' => function () { |
|
110 | + 'fields' => function() { |
|
111 | 111 | return [ |
112 | 112 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
113 | 113 | 'description' => ['type' => GraphQLString()], |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | ], |
117 | 117 | 'args' => [ |
118 | 118 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
119 | - 'resolve' => function (DirectiveInterface $directive): array { |
|
119 | + 'resolve' => function(DirectiveInterface $directive): array { |
|
120 | 120 | return $directive->getArguments() ?: []; |
121 | 121 | }, |
122 | 122 | ], |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ]); |
126 | 126 | }, true/* $shared */); |
127 | 127 | |
128 | - $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, function () { |
|
128 | + $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, function() { |
|
129 | 129 | return GraphQLEnumType([ |
130 | 130 | 'name' => GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, |
131 | 131 | 'isIntrospection' => true, |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | ]); |
192 | 192 | }, true/* $shared */); |
193 | 193 | |
194 | - $this->container->add(GraphQL::INTROSPECTION_TYPE, function () { |
|
194 | + $this->container->add(GraphQL::INTROSPECTION_TYPE, function() { |
|
195 | 195 | return GraphQLObjectType([ |
196 | 196 | 'name' => GraphQL::INTROSPECTION_TYPE, |
197 | 197 | 'isIntrospection' => true, |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | 'Object and Interface types provide the fields they describe. Abstract ' . |
205 | 205 | 'types, Union and Interface, provide the Object types possible ' . |
206 | 206 | 'at runtime. List and NonNull types compose other types.', |
207 | - 'fields' => function () { |
|
207 | + 'fields' => function() { |
|
208 | 208 | return [ |
209 | 209 | 'kind' => [ |
210 | 210 | 'type' => GraphQLNonNull(__TypeKind()), |
211 | - 'resolve' => function (TypeInterface $type) { |
|
211 | + 'resolve' => function(TypeInterface $type) { |
|
212 | 212 | if ($type instanceof ScalarType) { |
213 | 213 | return TypeKindEnum::SCALAR; |
214 | 214 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'args' => [ |
245 | 245 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
246 | 246 | ], |
247 | - 'resolve' => function (TypeInterface $type, array $args): |
|
247 | + 'resolve' => function(TypeInterface $type, array $args): |
|
248 | 248 | ?array { |
249 | 249 | $includeDeprecated = $args[0] ?? null; |
250 | 250 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $fields = array_values($type->getFields()); |
253 | 253 | |
254 | 254 | if (!$includeDeprecated) { |
255 | - $fields = array_filter($fields, function (Field $field) { |
|
255 | + $fields = array_filter($fields, function(Field $field) { |
|
256 | 256 | return !$field->getIsDeprecated(); |
257 | 257 | }); |
258 | 258 | } |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | ], |
266 | 266 | 'interfaces' => [ |
267 | 267 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
268 | - 'resolve' => function (TypeInterface $type): ?array { |
|
268 | + 'resolve' => function(TypeInterface $type): ?array { |
|
269 | 269 | return $type instanceof ObjectType ? $type->getInterfaces() : null; |
270 | 270 | }, |
271 | 271 | ], |
272 | 272 | 'possibleTypes' => [ |
273 | 273 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
274 | - 'resolve' => function (TypeInterface $type, array $args, array $context, ResolveInfo |
|
274 | + 'resolve' => function(TypeInterface $type, array $args, array $context, ResolveInfo |
|
275 | 275 | $info): |
276 | 276 | ?array { |
277 | 277 | /** @var SchemaInterface $schema */ |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | 'args' => [ |
286 | 286 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
287 | 287 | ], |
288 | - 'resolve' => function (TypeInterface $type, array $args): ?array { |
|
288 | + 'resolve' => function(TypeInterface $type, array $args): ?array { |
|
289 | 289 | [$includeDeprecated] = $args; |
290 | 290 | |
291 | 291 | if ($type instanceof EnumType) { |
292 | 292 | $values = array_values($type->getValues()); |
293 | 293 | |
294 | 294 | if (!$includeDeprecated) { |
295 | - $values = array_filter($values, function (Field $field) { |
|
295 | + $values = array_filter($values, function(Field $field) { |
|
296 | 296 | return !$field->getIsDeprecated(); |
297 | 297 | }); |
298 | 298 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | ], |
306 | 306 | 'inputFields' => [ |
307 | 307 | 'type' => GraphQLList(GraphQLNonNull(__InputValue())), |
308 | - 'resolve' => function (TypeInterface $type): ?array { |
|
308 | + 'resolve' => function(TypeInterface $type): ?array { |
|
309 | 309 | return $type instanceof InputObjectType ? $type->getFields() : null; |
310 | 310 | }, |
311 | 311 | ], |
@@ -315,20 +315,20 @@ discard block |
||
315 | 315 | ]); |
316 | 316 | }, true/* $shared */); |
317 | 317 | |
318 | - $this->container->add(GraphQL::INTROSPECTION_FIELD, function () { |
|
318 | + $this->container->add(GraphQL::INTROSPECTION_FIELD, function() { |
|
319 | 319 | return GraphQLObjectType([ |
320 | 320 | 'name' => GraphQL::INTROSPECTION_FIELD, |
321 | 321 | 'isIntrospection' => true, |
322 | 322 | 'description' => |
323 | 323 | 'Object and Interface types are described by a list of Fields, each of ' . |
324 | 324 | 'which has a name, potentially a list of arguments, and a return type.', |
325 | - 'fields' => function () { |
|
325 | + 'fields' => function() { |
|
326 | 326 | return [ |
327 | 327 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
328 | 328 | 'description' => ['type' => GraphQLString()], |
329 | 329 | 'args' => [ |
330 | 330 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
331 | - 'resolve' => function (ArgumentsAwareInterface $directive): array { |
|
331 | + 'resolve' => function(ArgumentsAwareInterface $directive): array { |
|
332 | 332 | return $directive->getArguments() ?? []; |
333 | 333 | }, |
334 | 334 | ], |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | ]); |
341 | 341 | }, true/* $shared */); |
342 | 342 | |
343 | - $this->container->add(GraphQL::INTROSPECTION_INPUT_VALUE, function () { |
|
343 | + $this->container->add(GraphQL::INTROSPECTION_INPUT_VALUE, function() { |
|
344 | 344 | return GraphQLObjectType([ |
345 | 345 | 'name' => GraphQL::INTROSPECTION_INPUT_VALUE, |
346 | 346 | 'isIntrospection' => true, |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | 'Arguments provided to Fields or Directives and the input fields of an ' . |
349 | 349 | 'InputObject are represented as Input Values which describe their type ' . |
350 | 350 | 'and optionally a default value.', |
351 | - 'fields' => function () { |
|
351 | + 'fields' => function() { |
|
352 | 352 | return [ |
353 | 353 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
354 | 354 | 'description' => ['type' => GraphQLString()], |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | 'description' => |
359 | 359 | 'A GraphQL-formatted string representing the default value for this ' . |
360 | 360 | 'input value.', |
361 | - 'resolve' => function ($inputValue) { |
|
361 | + 'resolve' => function($inputValue) { |
|
362 | 362 | // TODO: Implement this when we have support for printing AST. |
363 | 363 | return null; |
364 | 364 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | ]); |
369 | 369 | }, true/* $shared */); |
370 | 370 | |
371 | - $this->container->add(GraphQL::INTROSPECTION_ENUM_VALUE, function () { |
|
371 | + $this->container->add(GraphQL::INTROSPECTION_ENUM_VALUE, function() { |
|
372 | 372 | return GraphQLObjectType([ |
373 | 373 | 'name' => GraphQL::INTROSPECTION_ENUM_VALUE, |
374 | 374 | 'isIntrospection' => true, |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | 'One possible value for a given Enum. Enum values are unique values, not ' . |
377 | 377 | 'a placeholder for a string or numeric value. However an Enum value is ' . |
378 | 378 | 'returned in a JSON response as a string.', |
379 | - 'fields' => function () { |
|
379 | + 'fields' => function() { |
|
380 | 380 | return [ |
381 | 381 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
382 | 382 | 'description' => ['type' => GraphQLString()], |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | ]); |
388 | 388 | }, true/* $shared */); |
389 | 389 | |
390 | - $this->container->add(GraphQL::INTROSPECTION_TYPE_KIND, function () { |
|
390 | + $this->container->add(GraphQL::INTROSPECTION_TYPE_KIND, function() { |
|
391 | 391 | return GraphQLEnumType([ |
392 | 392 | 'name' => GraphQL::INTROSPECTION_TYPE_KIND, |
393 | 393 | 'isIntrospection' => true, |