@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $builtInTypes = keyMap( |
97 | 97 | \array_merge(specifiedScalarTypes(), introspectionTypes()), |
98 | - function (NamedTypeInterface $type) { |
|
98 | + function(NamedTypeInterface $type) { |
|
99 | 99 | return $type->getName(); |
100 | 100 | } |
101 | 101 | ); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return GraphQLDirective([ |
137 | 137 | 'name' => $node->getNameValue(), |
138 | 138 | 'description' => $node->getDescriptionValue(), |
139 | - 'locations' => \array_map(function (NameNode $node) { |
|
139 | + 'locations' => \array_map(function(NameNode $node) { |
|
140 | 140 | return $node->getValue(); |
141 | 141 | }, $node->getLocations()), |
142 | 142 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | { |
181 | 181 | return keyValueMap( |
182 | 182 | $nodes, |
183 | - function (InputValueDefinitionNode $value) { |
|
183 | + function(InputValueDefinitionNode $value) { |
|
184 | 184 | return $value->getNameValue(); |
185 | 185 | }, |
186 | - function (InputValueDefinitionNode $value): array { |
|
186 | + function(InputValueDefinitionNode $value): array { |
|
187 | 187 | $type = $this->buildWrappedType($value->getType()); |
188 | 188 | $defaultValue = $value->getDefaultValue(); |
189 | 189 | return [ |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | return GraphQLObjectType([ |
236 | 236 | 'name' => $node->getNameValue(), |
237 | 237 | 'description' => $node->getDescriptionValue(), |
238 | - 'fields' => function () use ($node) { |
|
238 | + 'fields' => function() use ($node) { |
|
239 | 239 | return $this->buildFields($node); |
240 | 240 | }, |
241 | - 'interfaces' => function () use ($node) { |
|
242 | - return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) { |
|
241 | + 'interfaces' => function() use ($node) { |
|
242 | + return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) { |
|
243 | 243 | return $this->buildType($interface); |
244 | 244 | }, $node->getInterfaces()) : []; |
245 | 245 | }, |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | |
258 | 258 | return $node->hasFields() ? keyValueMap( |
259 | 259 | $node->getFields(), |
260 | - function ($value) { |
|
260 | + function($value) { |
|
261 | 261 | /** @noinspection PhpUndefinedMethodInspection */ |
262 | 262 | return $value->getNameValue(); |
263 | 263 | }, |
264 | - function ($value) use ($resolverMap) { |
|
264 | + function($value) use ($resolverMap) { |
|
265 | 265 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
266 | 266 | return $this->buildField($value, $resolverMap[$value->getNameValue()] ?? null); |
267 | 267 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | return GraphQLInterfaceType([ |
278 | 278 | 'name' => $node->getNameValue(), |
279 | 279 | 'description' => $node->getDescriptionValue(), |
280 | - 'fields' => function () use ($node): array { |
|
280 | + 'fields' => function() use ($node): array { |
|
281 | 281 | return $this->buildFields($node); |
282 | 282 | }, |
283 | 283 | 'astNode' => $node, |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | 'description' => $node->getDescriptionValue(), |
296 | 296 | 'values' => $node->hasValues() ? keyValueMap( |
297 | 297 | $node->getValues(), |
298 | - function (EnumValueDefinitionNode $value): string { |
|
298 | + function(EnumValueDefinitionNode $value): string { |
|
299 | 299 | return $value->getNameValue(); |
300 | 300 | }, |
301 | - function (EnumValueDefinitionNode $value): array { |
|
301 | + function(EnumValueDefinitionNode $value): array { |
|
302 | 302 | return [ |
303 | 303 | 'description' => $value->getDescriptionValue(), |
304 | 304 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return GraphQLUnionType([ |
320 | 320 | 'name' => $node->getNameValue(), |
321 | 321 | 'description' => $node->getDescriptionValue(), |
322 | - 'types' => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) { |
|
322 | + 'types' => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) { |
|
323 | 323 | return $this->buildType($type); |
324 | 324 | }, $node->getTypes()) : [], |
325 | 325 | 'astNode' => $node, |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | return GraphQLScalarType([ |
336 | 336 | 'name' => $node->getNameValue(), |
337 | 337 | 'description' => $node->getDescriptionValue(), |
338 | - 'serialize' => function ($value) { |
|
338 | + 'serialize' => function($value) { |
|
339 | 339 | return $value; |
340 | 340 | }, |
341 | 341 | 'astNode' => $node, |
@@ -351,13 +351,13 @@ discard block |
||
351 | 351 | return GraphQLInputObjectType([ |
352 | 352 | 'name' => $node->getNameValue(), |
353 | 353 | 'description' => $node->getDescriptionValue(), |
354 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
354 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
355 | 355 | return keyValueMap( |
356 | 356 | $node->getFields(), |
357 | - function (InputValueDefinitionNode $value): string { |
|
357 | + function(InputValueDefinitionNode $value): string { |
|
358 | 358 | return $value->getNameValue(); |
359 | 359 | }, |
360 | - function (InputValueDefinitionNode $value): array { |
|
360 | + function(InputValueDefinitionNode $value): array { |
|
361 | 361 | $type = $this->buildWrappedType($value->getType()); |
362 | 362 | $defaultValue = $value->getDefaultValue(); |
363 | 363 | return [ |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | return $schema; |
177 | 177 | } |
178 | 178 | |
179 | - $resolveTypeFunction = function (NamedTypeNode $node) use ($schema): ?TypeInterface { |
|
179 | + $resolveTypeFunction = function(NamedTypeNode $node) use ($schema): ?TypeInterface { |
|
180 | 180 | $typeName = $node->getNameValue(); |
181 | 181 | $existingType = $schema->getType($typeName); |
182 | 182 | |
@@ -289,10 +289,10 @@ discard block |
||
289 | 289 | return GraphQLObjectType([ |
290 | 290 | 'name' => $typeName, |
291 | 291 | 'description' => $type->getDescription(), |
292 | - 'interfaces' => function () use ($type) { |
|
292 | + 'interfaces' => function() use ($type) { |
|
293 | 293 | return $this->extendImplementedInterfaces($type); |
294 | 294 | }, |
295 | - 'fields' => function () use ($type) { |
|
295 | + 'fields' => function() use ($type) { |
|
296 | 296 | return $this->extendFieldMap($type); |
297 | 297 | }, |
298 | 298 | 'astNode' => $type->getAstNode(), |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return GraphQLInterfaceType([ |
320 | 320 | 'name' => $typeName, |
321 | 321 | 'description' => $type->getDescription(), |
322 | - 'fields' => function () use ($type) { |
|
322 | + 'fields' => function() use ($type) { |
|
323 | 323 | return $this->extendFieldMap($type); |
324 | 324 | }, |
325 | 325 | 'astNode' => $type->getAstNode(), |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | return GraphQLUnionType([ |
339 | 339 | 'name' => $type->getName(), |
340 | 340 | 'description' => $type->getDescription(), |
341 | - 'types' => \array_map(function ($unionType) { |
|
341 | + 'types' => \array_map(function($unionType) { |
|
342 | 342 | return $this->getExtendedType($unionType); |
343 | 343 | }, $type->getTypes()), |
344 | 344 | 'astNode' => $type->getAstNode(), |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | */ |
354 | 354 | protected function extendImplementedInterfaces(ObjectType $type): array |
355 | 355 | { |
356 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
356 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
357 | 357 | return $this->getExtendedType($interface); |
358 | 358 | }, $type->getInterfaces()); |
359 | 359 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | 'description' => $field->getDescription(), |
396 | 396 | 'deprecationReason' => $field->getDeprecationReason(), |
397 | 397 | 'type' => $this->extendFieldType($field->getType()), |
398 | - 'args' => keyMap($field->getArguments(), function (Argument $argument) { |
|
398 | + 'args' => keyMap($field->getArguments(), function(Argument $argument) { |
|
399 | 399 | return $argument->getName(); |
400 | 400 | }), |
401 | 401 | 'astNode' => $field->getAstNode(), |