@@ -78,27 +78,27 @@ |
||
78 | 78 | |
79 | 79 | $this->definitionBuilder->setTypeDefinitionMap($nodeMap); |
80 | 80 | |
81 | - $types = array_map(function (TypeDefinitionNodeInterface $definition) { |
|
81 | + $types = array_map(function(TypeDefinitionNodeInterface $definition) { |
|
82 | 82 | return $this->definitionBuilder->buildType($definition); |
83 | 83 | }, $typeDefinitions); |
84 | 84 | |
85 | - $directives = array_map(function (DirectiveDefinitionNode $definition) { |
|
85 | + $directives = array_map(function(DirectiveDefinitionNode $definition) { |
|
86 | 86 | return $this->definitionBuilder->buildDirective($definition); |
87 | 87 | }, $directiveDefinitions); |
88 | 88 | |
89 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
89 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
90 | 90 | return $directive->getName() === 'skip'; |
91 | 91 | })) { |
92 | 92 | $directives[] = GraphQLSkipDirective(); |
93 | 93 | } |
94 | 94 | |
95 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
95 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
96 | 96 | return $directive->getName() === 'include'; |
97 | 97 | })) { |
98 | 98 | $directives[] = GraphQLIncludeDirective(); |
99 | 99 | } |
100 | 100 | |
101 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
101 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
102 | 102 | return $directive->getName() === 'deprecated'; |
103 | 103 | })) { |
104 | 104 | $directives[] = GraphQLDeprecatedDirective(); |
@@ -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 | ); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | return GraphQLDirective([ |
161 | 161 | 'name' => $node->getNameValue(), |
162 | 162 | 'description' => $node->getDescriptionValue(), |
163 | - 'locations' => array_map(function (NameNode $node) { |
|
163 | + 'locations' => array_map(function(NameNode $node) { |
|
164 | 164 | return $node->getValue(); |
165 | 165 | }, $node->getLocations()), |
166 | 166 | 'arguments' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | { |
208 | 208 | return keyValueMap( |
209 | 209 | $nodes, |
210 | - function (InputValueDefinitionNode $value) { |
|
210 | + function(InputValueDefinitionNode $value) { |
|
211 | 211 | return $value->getNameValue(); |
212 | 212 | }, |
213 | - function (InputValueDefinitionNode $value): array { |
|
213 | + function(InputValueDefinitionNode $value): array { |
|
214 | 214 | $type = $this->buildWrappedType($value->getType()); |
215 | 215 | return [ |
216 | 216 | 'type' => $type, |
@@ -259,11 +259,11 @@ discard block |
||
259 | 259 | return GraphQLObjectType([ |
260 | 260 | 'name' => $node->getNameValue(), |
261 | 261 | 'description' => $node->getDescriptionValue(), |
262 | - 'fields' => function () use ($node) { |
|
262 | + 'fields' => function() use ($node) { |
|
263 | 263 | return $this->buildFields($node); |
264 | 264 | }, |
265 | - 'interfaces' => function () use ($node) { |
|
266 | - return $node->hasInterfaces() ? array_map(function (NodeInterface $interface) { |
|
265 | + 'interfaces' => function() use ($node) { |
|
266 | + return $node->hasInterfaces() ? array_map(function(NodeInterface $interface) { |
|
267 | 267 | return $this->buildType($interface); |
268 | 268 | }, $node->getInterfaces()) : []; |
269 | 269 | }, |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | |
281 | 281 | return $node->hasFields() ? keyValueMap( |
282 | 282 | $node->getFields(), |
283 | - function ($value) { |
|
283 | + function($value) { |
|
284 | 284 | /** @noinspection PhpUndefinedMethodInspection */ |
285 | 285 | return $value->getNameValue(); |
286 | 286 | }, |
287 | - function ($value) use ($resolverMap) { |
|
287 | + function($value) use ($resolverMap) { |
|
288 | 288 | return $this->buildField($value, $resolverMap); |
289 | 289 | } |
290 | 290 | ) : []; |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return GraphQLInterfaceType([ |
300 | 300 | 'name' => $node->getNameValue(), |
301 | 301 | 'description' => $node->getDescriptionValue(), |
302 | - 'fields' => function () use ($node): array { |
|
302 | + 'fields' => function() use ($node): array { |
|
303 | 303 | return $this->buildFields($node); |
304 | 304 | }, |
305 | 305 | 'astNode' => $node, |
@@ -317,10 +317,10 @@ discard block |
||
317 | 317 | 'description' => $node->getDescriptionValue(), |
318 | 318 | 'values' => $node->hasValues() ? keyValueMap( |
319 | 319 | $node->getValues(), |
320 | - function (EnumValueDefinitionNode $value): string { |
|
320 | + function(EnumValueDefinitionNode $value): string { |
|
321 | 321 | return $value->getNameValue(); |
322 | 322 | }, |
323 | - function (EnumValueDefinitionNode $value): array { |
|
323 | + function(EnumValueDefinitionNode $value): array { |
|
324 | 324 | return [ |
325 | 325 | 'description' => $value->getDescriptionValue(), |
326 | 326 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | return GraphQLUnionType([ |
342 | 342 | 'name' => $node->getNameValue(), |
343 | 343 | 'description' => $node->getDescriptionValue(), |
344 | - 'types' => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) { |
|
344 | + 'types' => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) { |
|
345 | 345 | return $this->buildType($type); |
346 | 346 | }, $node->getTypes()) : [], |
347 | 347 | 'astNode' => $node, |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | return GraphQLScalarType([ |
358 | 358 | 'name' => $node->getNameValue(), |
359 | 359 | 'description' => $node->getDescriptionValue(), |
360 | - 'serialize' => function ($value) { |
|
360 | + 'serialize' => function($value) { |
|
361 | 361 | return $value; |
362 | 362 | }, |
363 | 363 | 'astNode' => $node, |
@@ -373,13 +373,13 @@ discard block |
||
373 | 373 | return GraphQLInputObjectType([ |
374 | 374 | 'name' => $node->getNameValue(), |
375 | 375 | 'description' => $node->getDescriptionValue(), |
376 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
376 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
377 | 377 | return keyValueMap( |
378 | 378 | $node->getFields(), |
379 | - function (InputValueDefinitionNode $value): string { |
|
379 | + function(InputValueDefinitionNode $value): string { |
|
380 | 380 | return $value->getNameValue(); |
381 | 381 | }, |
382 | - function (InputValueDefinitionNode $value): array { |
|
382 | + function(InputValueDefinitionNode $value): array { |
|
383 | 383 | $type = $this->buildWrappedType($value->getType()); |
384 | 384 | return [ |
385 | 385 | 'type' => $type, |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | return $count === 1 |
34 | 34 | ? $selected[0] |
35 | - : \array_reduce($selected, function ($list, $item) use ($count, &$index) { |
|
35 | + : \array_reduce($selected, function($list, $item) use ($count, &$index) { |
|
36 | 36 | $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
37 | 37 | $item; |
38 | 38 | $index++; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $result = \array_keys($optionsByDistance); |
68 | 68 | |
69 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
69 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
70 | 70 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
71 | 71 | }); |
72 | 72 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | function quotedOrList(array $items): string |
83 | 83 | { |
84 | - return orList(array_map(function ($item) { |
|
84 | + return orList(array_map(function($item) { |
|
85 | 85 | return '"' . $item . '"'; |
86 | 86 | }, $items)); |
87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function arrayEvery(array $array, callable $fn): bool |
97 | 97 | { |
98 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
98 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
99 | 99 | return $result && $fn($value); |
100 | 100 | }, true); |
101 | 101 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function arraySome(array $array, callable $fn) |
109 | 109 | { |
110 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
110 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
111 | 111 | return $result || $fn($value); |
112 | 112 | }); |
113 | 113 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | function keyMap(array $array, callable $keyFn): array |
137 | 137 | { |
138 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
138 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
139 | 139 | $map[$keyFn($item)] = $item; |
140 | 140 | return $map; |
141 | 141 | }, []); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | function keyValueMap(array $array, callable $keyFn, callable $valFn): array |
151 | 151 | { |
152 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
152 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
153 | 153 | $map[$keyFn($item)] = $valFn($item); |
154 | 154 | return $map; |
155 | 155 | }, []); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'name' => '__schema', |
86 | 86 | 'type' => GraphQLNonNull(__Schema()), |
87 | 87 | 'description' => 'Access the current type schema of this server.', |
88 | - 'resolve' => function ($source, $args, $context, ResolveInfo $info): SchemaInterface { |
|
88 | + 'resolve' => function($source, $args, $context, ResolveInfo $info): SchemaInterface { |
|
89 | 89 | $schema = $info->getSchema(); |
90 | 90 | return $schema; |
91 | 91 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'args' => [ |
106 | 106 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
107 | 107 | ], |
108 | - 'resolve' => function ($source, $args, $context, ResolveInfo $info): TypeInterface { |
|
108 | + 'resolve' => function($source, $args, $context, ResolveInfo $info): TypeInterface { |
|
109 | 109 | /** @var SchemaInterface $schema */ |
110 | 110 | $name = $args['name']; |
111 | 111 | $schema = $info->getSchema(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'name' => '__typename', |
125 | 125 | 'type' => GraphQLNonNull(GraphQLString()), |
126 | 126 | 'description' => 'The name of the current Object type at runtime.', |
127 | - 'resolve' => function ($source, $args, $context, ResolveInfo $info): string { |
|
127 | + 'resolve' => function($source, $args, $context, ResolveInfo $info): string { |
|
128 | 128 | /** @var NamedTypeInterface $parentType */ |
129 | 129 | $parentType = $info->getParentType(); |
130 | 130 | return $parentType->getName(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | return arraySome( |
159 | 159 | introspectionTypes(), |
160 | - function (TypeInterface $introspectionType) use ($type) { |
|
160 | + function(TypeInterface $introspectionType) use ($type) { |
|
161 | 161 | /** @noinspection PhpUndefinedMethodInspection */ |
162 | 162 | return $type->getName() === $introspectionType->getName(); |
163 | 163 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function register() |
43 | 43 | { |
44 | - $this->container->add(GraphQL::INTROSPECTION_SCHEMA, function () { |
|
44 | + $this->container->add(GraphQL::INTROSPECTION_SCHEMA, function() { |
|
45 | 45 | return GraphQLObjectType([ |
46 | 46 | 'name' => GraphQL::INTROSPECTION_SCHEMA, |
47 | 47 | 'isIntrospection' => true, |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' . |
50 | 50 | 'exposes all available types and directives on the server, as well as ' . |
51 | 51 | 'the entry points for query, mutation, and subscription operations.', |
52 | - 'fields' => function () { |
|
52 | + 'fields' => function() { |
|
53 | 53 | return [ |
54 | 54 | 'types' => [ |
55 | 55 | 'description' => 'A list of all types supported by this server.', |
56 | 56 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type()))), |
57 | - 'resolve' => function (SchemaInterface $schema): array { |
|
57 | + 'resolve' => function(SchemaInterface $schema): array { |
|
58 | 58 | return array_values($schema->getTypeMap()); |
59 | 59 | }, |
60 | 60 | ], |
61 | 61 | 'queryType' => [ |
62 | 62 | 'description' => 'The type that query operations will be rooted at.', |
63 | 63 | 'type' => GraphQLNonNull(__Type()), |
64 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
64 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
65 | 65 | return $schema->getQuery(); |
66 | 66 | }, |
67 | 67 | ], |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'If this server supports mutation, the type that ' . |
71 | 71 | 'mutation operations will be rooted at.', |
72 | 72 | 'type' => __Type(), |
73 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
73 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
74 | 74 | return $schema->getMutation(); |
75 | 75 | }, |
76 | 76 | ], |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | 'If this server support subscription, the type that ' . |
80 | 80 | 'subscription operations will be rooted at.', |
81 | 81 | 'type' => __Type(), |
82 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
82 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
83 | 83 | return $schema->getSubscription(); |
84 | 84 | }, |
85 | 85 | ], |
86 | 86 | 'directives' => [ |
87 | 87 | 'description' => 'A list of all directives supported by this server.', |
88 | 88 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive()))), |
89 | - 'resolve' => function (SchemaInterface $schema): array { |
|
89 | + 'resolve' => function(SchemaInterface $schema): array { |
|
90 | 90 | return $schema->getDirectives(); |
91 | 91 | }, |
92 | 92 | ], |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ]); |
96 | 96 | }, true/* $shared */); |
97 | 97 | |
98 | - $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE, function () { |
|
98 | + $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE, function() { |
|
99 | 99 | return GraphQLObjectType([ |
100 | 100 | 'name' => GraphQL::INTROSPECTION_DIRECTIVE, |
101 | 101 | 'isIntrospection' => true, |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'execution behavior in ways field arguments will not suffice, such as ' . |
107 | 107 | 'conditionally including or skipping a field. Directives provide this by ' . |
108 | 108 | 'describing additional information to the executor.', |
109 | - 'fields' => function () { |
|
109 | + 'fields' => function() { |
|
110 | 110 | return [ |
111 | 111 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
112 | 112 | 'description' => ['type' => GraphQLString()], |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ], |
116 | 116 | 'args' => [ |
117 | 117 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
118 | - 'resolve' => function (DirectiveInterface $directive): array { |
|
118 | + 'resolve' => function(DirectiveInterface $directive): array { |
|
119 | 119 | return $directive->getArguments() ?: []; |
120 | 120 | }, |
121 | 121 | ], |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ]); |
125 | 125 | }, true/* $shared */); |
126 | 126 | |
127 | - $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, function () { |
|
127 | + $this->container->add(GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, function() { |
|
128 | 128 | return GraphQLEnumType([ |
129 | 129 | 'name' => GraphQL::INTROSPECTION_DIRECTIVE_LOCATION, |
130 | 130 | 'isIntrospection' => true, |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ]); |
191 | 191 | }, true/* $shared */); |
192 | 192 | |
193 | - $this->container->add(GraphQL::INTROSPECTION_TYPE, function () { |
|
193 | + $this->container->add(GraphQL::INTROSPECTION_TYPE, function() { |
|
194 | 194 | return GraphQLObjectType([ |
195 | 195 | 'name' => GraphQL::INTROSPECTION_TYPE, |
196 | 196 | 'isIntrospection' => true, |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | 'Object and Interface types provide the fields they describe. Abstract ' . |
204 | 204 | 'types, Union and Interface, provide the Object types possible ' . |
205 | 205 | 'at runtime. List and NonNull types compose other types.', |
206 | - 'fields' => function () { |
|
206 | + 'fields' => function() { |
|
207 | 207 | return [ |
208 | 208 | 'kind' => [ |
209 | 209 | 'type' => GraphQLNonNull(__TypeKind()), |
210 | - 'resolve' => function (TypeInterface $type) { |
|
210 | + 'resolve' => function(TypeInterface $type) { |
|
211 | 211 | if ($type instanceof ScalarType) { |
212 | 212 | return TypeKindEnum::SCALAR; |
213 | 213 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'args' => [ |
244 | 244 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
245 | 245 | ], |
246 | - 'resolve' => function (TypeInterface $type, array $args): |
|
246 | + 'resolve' => function(TypeInterface $type, array $args): |
|
247 | 247 | ?array { |
248 | 248 | $includeDeprecated = $args[0] ?? null; |
249 | 249 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $fields = array_values($type->getFields()); |
252 | 252 | |
253 | 253 | if (!$includeDeprecated) { |
254 | - $fields = array_filter($fields, function (Field $field) { |
|
254 | + $fields = array_filter($fields, function(Field $field) { |
|
255 | 255 | return !$field->isDeprecated(); |
256 | 256 | }); |
257 | 257 | } |
@@ -264,13 +264,13 @@ discard block |
||
264 | 264 | ], |
265 | 265 | 'interfaces' => [ |
266 | 266 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
267 | - 'resolve' => function (TypeInterface $type): ?array { |
|
267 | + 'resolve' => function(TypeInterface $type): ?array { |
|
268 | 268 | return $type instanceof ObjectType ? $type->getInterfaces() : null; |
269 | 269 | }, |
270 | 270 | ], |
271 | 271 | 'possibleTypes' => [ |
272 | 272 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
273 | - 'resolve' => function (TypeInterface $type, array $args, array $context, ResolveInfo |
|
273 | + 'resolve' => function(TypeInterface $type, array $args, array $context, ResolveInfo |
|
274 | 274 | $info): |
275 | 275 | ?array { |
276 | 276 | /** @var SchemaInterface $schema */ |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | 'args' => [ |
285 | 285 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
286 | 286 | ], |
287 | - 'resolve' => function (TypeInterface $type, array $args): ?array { |
|
287 | + 'resolve' => function(TypeInterface $type, array $args): ?array { |
|
288 | 288 | [$includeDeprecated] = $args; |
289 | 289 | |
290 | 290 | if ($type instanceof EnumType) { |
291 | 291 | $values = array_values($type->getValues()); |
292 | 292 | |
293 | 293 | if (!$includeDeprecated) { |
294 | - $values = array_filter($values, function (Field $field) { |
|
294 | + $values = array_filter($values, function(Field $field) { |
|
295 | 295 | return !$field->isDeprecated(); |
296 | 296 | }); |
297 | 297 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | ], |
305 | 305 | 'inputFields' => [ |
306 | 306 | 'type' => GraphQLList(GraphQLNonNull(__InputValue())), |
307 | - 'resolve' => function (TypeInterface $type): ?array { |
|
307 | + 'resolve' => function(TypeInterface $type): ?array { |
|
308 | 308 | return $type instanceof InputObjectType ? $type->getFields() : null; |
309 | 309 | }, |
310 | 310 | ], |
@@ -314,20 +314,20 @@ discard block |
||
314 | 314 | ]); |
315 | 315 | }, true/* $shared */); |
316 | 316 | |
317 | - $this->container->add(GraphQL::INTROSPECTION_FIELD, function () { |
|
317 | + $this->container->add(GraphQL::INTROSPECTION_FIELD, function() { |
|
318 | 318 | return GraphQLObjectType([ |
319 | 319 | 'name' => GraphQL::INTROSPECTION_FIELD, |
320 | 320 | 'isIntrospection' => true, |
321 | 321 | 'description' => |
322 | 322 | 'Object and Interface types are described by a list of Fields, each of ' . |
323 | 323 | 'which has a name, potentially a list of arguments, and a return type.', |
324 | - 'fields' => function () { |
|
324 | + 'fields' => function() { |
|
325 | 325 | return [ |
326 | 326 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
327 | 327 | 'description' => ['type' => GraphQLString()], |
328 | 328 | 'args' => [ |
329 | 329 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
330 | - 'resolve' => function (DirectiveInterface $directive): array { |
|
330 | + 'resolve' => function(DirectiveInterface $directive): array { |
|
331 | 331 | return $directive->getArguments() ?: []; |
332 | 332 | }, |
333 | 333 | ], |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | ]); |
340 | 340 | }, true/* $shared */); |
341 | 341 | |
342 | - $this->container->add(GraphQL::INTROSPECTION_INPUT_VALUE, function () { |
|
342 | + $this->container->add(GraphQL::INTROSPECTION_INPUT_VALUE, function() { |
|
343 | 343 | return GraphQLObjectType([ |
344 | 344 | 'name' => GraphQL::INTROSPECTION_INPUT_VALUE, |
345 | 345 | 'isIntrospection' => true, |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | 'Arguments provided to Fields or Directives and the input fields of an ' . |
348 | 348 | 'InputObject are represented as Input Values which describe their type ' . |
349 | 349 | 'and optionally a default value.', |
350 | - 'fields' => function () { |
|
350 | + 'fields' => function() { |
|
351 | 351 | return [ |
352 | 352 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
353 | 353 | 'description' => ['type' => GraphQLString()], |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | 'description' => |
358 | 358 | 'A GraphQL-formatted string representing the default value for this ' . |
359 | 359 | 'input value.', |
360 | - 'resolve' => function ($inputValue) { |
|
360 | + 'resolve' => function($inputValue) { |
|
361 | 361 | // TODO: Implement this when we have support for printing AST. |
362 | 362 | return null; |
363 | 363 | } |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | ]); |
368 | 368 | }, true/* $shared */); |
369 | 369 | |
370 | - $this->container->add(GraphQL::INTROSPECTION_ENUM_VALUE, function () { |
|
370 | + $this->container->add(GraphQL::INTROSPECTION_ENUM_VALUE, function() { |
|
371 | 371 | return GraphQLObjectType([ |
372 | 372 | 'name' => GraphQL::INTROSPECTION_ENUM_VALUE, |
373 | 373 | 'isIntrospection' => true, |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | 'One possible value for a given Enum. Enum values are unique values, not ' . |
376 | 376 | 'a placeholder for a string or numeric value. However an Enum value is ' . |
377 | 377 | 'returned in a JSON response as a string.', |
378 | - 'fields' => function () { |
|
378 | + 'fields' => function() { |
|
379 | 379 | return [ |
380 | 380 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
381 | 381 | 'description' => ['type' => GraphQLString()], |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | ]); |
387 | 387 | }, true/* $shared */); |
388 | 388 | |
389 | - $this->container->add(GraphQL::INTROSPECTION_TYPE_KIND, function () { |
|
389 | + $this->container->add(GraphQL::INTROSPECTION_TYPE_KIND, function() { |
|
390 | 390 | return GraphQLEnumType([ |
391 | 391 | 'name' => GraphQL::INTROSPECTION_TYPE_KIND, |
392 | 392 | 'isIntrospection' => true, |