@@ -77,27 +77,27 @@ |
||
| 77 | 77 | |
| 78 | 78 | $definitionBuilder = $this->definitionBuilderCreator->create($nodeMap, $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(); |
@@ -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 | }, |
@@ -255,11 +255,11 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | return $node->hasFields() ? keyValueMap( |
| 257 | 257 | $node->getFields(), |
| 258 | - function ($value) { |
|
| 258 | + function($value) { |
|
| 259 | 259 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 260 | 260 | return $value->getNameValue(); |
| 261 | 261 | }, |
| 262 | - function ($value) use ($node) { |
|
| 262 | + function($value) use ($node) { |
|
| 263 | 263 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 264 | 264 | return $this->buildField( |
| 265 | 265 | $value, |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | return GraphQLInterfaceType([ |
| 279 | 279 | 'name' => $node->getNameValue(), |
| 280 | 280 | 'description' => $node->getDescriptionValue(), |
| 281 | - 'fields' => function () use ($node): array { |
|
| 281 | + 'fields' => function() use ($node): array { |
|
| 282 | 282 | return $this->buildFields($node); |
| 283 | 283 | }, |
| 284 | 284 | 'astNode' => $node, |
@@ -296,10 +296,10 @@ discard block |
||
| 296 | 296 | 'description' => $node->getDescriptionValue(), |
| 297 | 297 | 'values' => $node->hasValues() ? keyValueMap( |
| 298 | 298 | $node->getValues(), |
| 299 | - function (EnumValueDefinitionNode $value): string { |
|
| 299 | + function(EnumValueDefinitionNode $value): string { |
|
| 300 | 300 | return $value->getNameValue(); |
| 301 | 301 | }, |
| 302 | - function (EnumValueDefinitionNode $value): array { |
|
| 302 | + function(EnumValueDefinitionNode $value): array { |
|
| 303 | 303 | return [ |
| 304 | 304 | 'description' => $value->getDescriptionValue(), |
| 305 | 305 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | return GraphQLUnionType([ |
| 321 | 321 | 'name' => $node->getNameValue(), |
| 322 | 322 | 'description' => $node->getDescriptionValue(), |
| 323 | - 'types' => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) { |
|
| 323 | + 'types' => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) { |
|
| 324 | 324 | return $this->buildType($type); |
| 325 | 325 | }, $node->getTypes()) : [], |
| 326 | 326 | 'astNode' => $node, |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | return GraphQLScalarType([ |
| 337 | 337 | 'name' => $node->getNameValue(), |
| 338 | 338 | 'description' => $node->getDescriptionValue(), |
| 339 | - 'serialize' => function ($value) { |
|
| 339 | + 'serialize' => function($value) { |
|
| 340 | 340 | return $value; |
| 341 | 341 | }, |
| 342 | 342 | 'astNode' => $node, |
@@ -352,13 +352,13 @@ discard block |
||
| 352 | 352 | return GraphQLInputObjectType([ |
| 353 | 353 | 'name' => $node->getNameValue(), |
| 354 | 354 | 'description' => $node->getDescriptionValue(), |
| 355 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
| 355 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
| 356 | 356 | return keyValueMap( |
| 357 | 357 | $node->getFields(), |
| 358 | - function (InputValueDefinitionNode $value): string { |
|
| 358 | + function(InputValueDefinitionNode $value): string { |
|
| 359 | 359 | return $value->getNameValue(); |
| 360 | 360 | }, |
| 361 | - function (InputValueDefinitionNode $value): array { |
|
| 361 | + function(InputValueDefinitionNode $value): array { |
|
| 362 | 362 | $type = $this->buildWrappedType($value->getType()); |
| 363 | 363 | $defaultValue = $value->getDefaultValue(); |
| 364 | 364 | return [ |