@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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 |
@@ -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 | } |
@@ -104,7 +104,7 @@ |
||
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 | } |
@@ -124,7 +124,7 @@ |
||
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 | } |
@@ -56,7 +56,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -31,11 +31,11 @@ discard block |
||
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 |
||
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 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $name = $this->buildAST(ASTKindEnum::NAME, $lexer); |
31 | 31 | $interfaces = $this->buildAST(ASTKindEnum::IMPLEMENTS_INTERFACES, $lexer); |
32 | 32 | $directives = $this->buildAST(ASTKindEnum::DIRECTIVES, $lexer); |
33 | - $fields = $this->buildAST(ASTKindEnum::FIELDS_DEFINITION, $lexer);; |
|
33 | + $fields = $this->buildAST(ASTKindEnum::FIELDS_DEFINITION, $lexer); ; |
|
34 | 34 | |
35 | 35 | if (count($interfaces) === 0 && count($directives) === 0 && count($fields) === 0) { |
36 | 36 | throw $this->unexpected($lexer); |