@@ -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 | ); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function buildTypes(array $nodes): array |
| 112 | 112 | { |
| 113 | - return \array_map(function (NodeInterface $node) { |
|
| 113 | + return \array_map(function(NodeInterface $node) { |
|
| 114 | 114 | return $this->buildType($node); |
| 115 | 115 | }, $nodes); |
| 116 | 116 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | return GraphQLDirective([ |
| 147 | 147 | 'name' => $node->getNameValue(), |
| 148 | 148 | 'description' => $node->getDescriptionValue(), |
| 149 | - 'locations' => \array_map(function (NameNode $node) { |
|
| 149 | + 'locations' => \array_map(function(NameNode $node) { |
|
| 150 | 150 | return $node->getValue(); |
| 151 | 151 | }, $node->getLocations()), |
| 152 | 152 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -190,10 +190,10 @@ discard block |
||
| 190 | 190 | { |
| 191 | 191 | return keyValueMap( |
| 192 | 192 | $nodes, |
| 193 | - function (InputValueDefinitionNode $value) { |
|
| 193 | + function(InputValueDefinitionNode $value) { |
|
| 194 | 194 | return $value->getNameValue(); |
| 195 | 195 | }, |
| 196 | - function (InputValueDefinitionNode $value): array { |
|
| 196 | + function(InputValueDefinitionNode $value): array { |
|
| 197 | 197 | $type = $this->buildWrappedType($value->getType()); |
| 198 | 198 | $defaultValue = $value->getDefaultValue(); |
| 199 | 199 | return [ |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | return GraphQLObjectType([ |
| 246 | 246 | 'name' => $node->getNameValue(), |
| 247 | 247 | 'description' => $node->getDescriptionValue(), |
| 248 | - 'fields' => function () use ($node) { |
|
| 248 | + 'fields' => function() use ($node) { |
|
| 249 | 249 | return $this->buildFields($node); |
| 250 | 250 | }, |
| 251 | - 'interfaces' => function () use ($node) { |
|
| 252 | - return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) { |
|
| 251 | + 'interfaces' => function() use ($node) { |
|
| 252 | + return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) { |
|
| 253 | 253 | return $this->buildType($interface); |
| 254 | 254 | }, $node->getInterfaces()) : []; |
| 255 | 255 | }, |
@@ -265,11 +265,11 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | return $node->hasFields() ? keyValueMap( |
| 267 | 267 | $node->getFields(), |
| 268 | - function ($value) { |
|
| 268 | + function($value) { |
|
| 269 | 269 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 270 | 270 | return $value->getNameValue(); |
| 271 | 271 | }, |
| 272 | - function ($value) use ($node) { |
|
| 272 | + function($value) use ($node) { |
|
| 273 | 273 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 274 | 274 | return $this->buildField( |
| 275 | 275 | $value, |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | return GraphQLInterfaceType([ |
| 289 | 289 | 'name' => $node->getNameValue(), |
| 290 | 290 | 'description' => $node->getDescriptionValue(), |
| 291 | - 'fields' => function () use ($node): array { |
|
| 291 | + 'fields' => function() use ($node): array { |
|
| 292 | 292 | return $this->buildFields($node); |
| 293 | 293 | }, |
| 294 | 294 | 'astNode' => $node, |
@@ -306,10 +306,10 @@ discard block |
||
| 306 | 306 | 'description' => $node->getDescriptionValue(), |
| 307 | 307 | 'values' => $node->hasValues() ? keyValueMap( |
| 308 | 308 | $node->getValues(), |
| 309 | - function (EnumValueDefinitionNode $value): string { |
|
| 309 | + function(EnumValueDefinitionNode $value): string { |
|
| 310 | 310 | return $value->getNameValue(); |
| 311 | 311 | }, |
| 312 | - function (EnumValueDefinitionNode $value): array { |
|
| 312 | + function(EnumValueDefinitionNode $value): array { |
|
| 313 | 313 | return [ |
| 314 | 314 | 'description' => $value->getDescriptionValue(), |
| 315 | 315 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | return GraphQLUnionType([ |
| 331 | 331 | 'name' => $node->getNameValue(), |
| 332 | 332 | 'description' => $node->getDescriptionValue(), |
| 333 | - 'types' => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) { |
|
| 333 | + 'types' => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) { |
|
| 334 | 334 | return $this->buildType($type); |
| 335 | 335 | }, $node->getTypes()) : [], |
| 336 | 336 | 'astNode' => $node, |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | return GraphQLScalarType([ |
| 347 | 347 | 'name' => $node->getNameValue(), |
| 348 | 348 | 'description' => $node->getDescriptionValue(), |
| 349 | - 'serialize' => function ($value) { |
|
| 349 | + 'serialize' => function($value) { |
|
| 350 | 350 | return $value; |
| 351 | 351 | }, |
| 352 | 352 | 'astNode' => $node, |
@@ -362,13 +362,13 @@ discard block |
||
| 362 | 362 | return GraphQLInputObjectType([ |
| 363 | 363 | 'name' => $node->getNameValue(), |
| 364 | 364 | 'description' => $node->getDescriptionValue(), |
| 365 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
| 365 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
| 366 | 366 | return keyValueMap( |
| 367 | 367 | $node->getFields(), |
| 368 | - function (InputValueDefinitionNode $value): string { |
|
| 368 | + function(InputValueDefinitionNode $value): string { |
|
| 369 | 369 | return $value->getNameValue(); |
| 370 | 370 | }, |
| 371 | - function (InputValueDefinitionNode $value): array { |
|
| 371 | + function(InputValueDefinitionNode $value): array { |
|
| 372 | 372 | $type = $this->buildWrappedType($value->getType()); |
| 373 | 373 | $defaultValue = $value->getDefaultValue(); |
| 374 | 374 | return [ |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | public function getExtendedTypes(): array |
| 250 | 250 | { |
| 251 | 251 | return \array_merge( |
| 252 | - \array_map(function ($type) { |
|
| 252 | + \array_map(function($type) { |
|
| 253 | 253 | return $this->getExtendedType($type); |
| 254 | 254 | }, \array_values($this->schema->getTypeMap())), |
| 255 | 255 | $this->definitionBuilder->buildTypes(\array_values($this->typeDefinitionMap)) |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | return \array_merge( |
| 270 | 270 | $existingDirectives, |
| 271 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
| 271 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
| 272 | 272 | return $this->definitionBuilder->buildDirective($node); |
| 273 | 273 | }, $this->directiveDefinitions) |
| 274 | 274 | ); |
@@ -395,10 +395,10 @@ discard block |
||
| 395 | 395 | return GraphQLObjectType([ |
| 396 | 396 | 'name' => $typeName, |
| 397 | 397 | 'description' => $type->getDescription(), |
| 398 | - 'interfaces' => function () use ($type) { |
|
| 398 | + 'interfaces' => function() use ($type) { |
|
| 399 | 399 | return $this->extendImplementedInterfaces($type); |
| 400 | 400 | }, |
| 401 | - 'fields' => function () use ($type) { |
|
| 401 | + 'fields' => function() use ($type) { |
|
| 402 | 402 | return $this->extendFieldMap($type); |
| 403 | 403 | }, |
| 404 | 404 | 'astNode' => $type->getAstNode(), |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | return GraphQLInterfaceType([ |
| 426 | 426 | 'name' => $typeName, |
| 427 | 427 | 'description' => $type->getDescription(), |
| 428 | - 'fields' => function () use ($type) { |
|
| 428 | + 'fields' => function() use ($type) { |
|
| 429 | 429 | return $this->extendFieldMap($type); |
| 430 | 430 | }, |
| 431 | 431 | 'astNode' => $type->getAstNode(), |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | return GraphQLUnionType([ |
| 445 | 445 | 'name' => $type->getName(), |
| 446 | 446 | 'description' => $type->getDescription(), |
| 447 | - 'types' => \array_map(function ($unionType) { |
|
| 447 | + 'types' => \array_map(function($unionType) { |
|
| 448 | 448 | return $this->getExtendedType($unionType); |
| 449 | 449 | }, $type->getTypes()), |
| 450 | 450 | 'astNode' => $type->getAstNode(), |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | protected function extendImplementedInterfaces(ObjectType $type): array |
| 461 | 461 | { |
| 462 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
| 462 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
| 463 | 463 | return $this->getExtendedType($interface); |
| 464 | 464 | }, $type->getInterfaces()); |
| 465 | 465 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | 'description' => $field->getDescription(), |
| 502 | 502 | 'deprecationReason' => $field->getDeprecationReason(), |
| 503 | 503 | 'type' => $this->extendFieldType($field->getType()), |
| 504 | - 'args' => keyMap($field->getArguments(), function (Argument $argument) { |
|
| 504 | + 'args' => keyMap($field->getArguments(), function(Argument $argument) { |
|
| 505 | 505 | return $argument->getName(); |
| 506 | 506 | }), |
| 507 | 507 | 'astNode' => $field->getAstNode(), |
@@ -77,27 +77,27 @@ |
||
| 77 | 77 | |
| 78 | 78 | $definitionBuilder = $this->definitionBuilderCreator->create($nodeMap, null, $resolverRegistry); |
| 79 | 79 | |
| 80 | - $types = array_map(function (TypeDefinitionNodeInterface $definition) use ($definitionBuilder) { |
|
| 80 | + $types = array_map(function(TypeDefinitionNodeInterface $definition) use ($definitionBuilder) { |
|
| 81 | 81 | return $definitionBuilder->buildType($definition); |
| 82 | 82 | }, $typeDefinitions); |
| 83 | 83 | |
| 84 | - $directives = array_map(function (DirectiveDefinitionNode $definition) use ($definitionBuilder) { |
|
| 84 | + $directives = array_map(function(DirectiveDefinitionNode $definition) use ($definitionBuilder) { |
|
| 85 | 85 | return $definitionBuilder->buildDirective($definition); |
| 86 | 86 | }, $directiveDefinitions); |
| 87 | 87 | |
| 88 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 88 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 89 | 89 | return $directive->getName() === 'skip'; |
| 90 | 90 | })) { |
| 91 | 91 | $directives[] = GraphQLSkipDirective(); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 94 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 95 | 95 | return $directive->getName() === 'include'; |
| 96 | 96 | })) { |
| 97 | 97 | $directives[] = GraphQLIncludeDirective(); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 100 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 101 | 101 | return $directive->getName() === 'deprecated'; |
| 102 | 102 | })) { |
| 103 | 103 | $directives[] = GraphQLDeprecatedDirective(); |