@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getLocationsAsArray(): ?array |
| 154 | 154 | { |
| 155 | - return !empty($this->locations) ? \array_map(function (SourceLocation $location) { |
|
| 155 | + return !empty($this->locations) ? \array_map(function(SourceLocation $location) { |
|
| 156 | 156 | return $location->toArray(); |
| 157 | 157 | }, $this->locations) : null; |
| 158 | 158 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $nodes = [$nodes]; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - $this->nodes = \array_filter($nodes, function ($node) { |
|
| 196 | + $this->nodes = \array_filter($nodes, function($node) { |
|
| 197 | 197 | return null !== $node; |
| 198 | 198 | }); |
| 199 | 199 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | protected function resolvePositions(?array $positions) |
| 225 | 225 | { |
| 226 | 226 | if (null === $positions && !empty($this->nodes)) { |
| 227 | - $positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) { |
|
| 227 | + $positions = \array_reduce($this->nodes, function(array $list, ?NodeInterface $node) { |
|
| 228 | 228 | if (null !== $node) { |
| 229 | 229 | $location = $node->getLocation(); |
| 230 | 230 | if (null !== $location) { |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | protected function resolveLocations(?array $positions, ?Source $source) |
| 253 | 253 | { |
| 254 | 254 | if (null !== $positions && null !== $source) { |
| 255 | - $locations = \array_map(function ($position) use ($source) { |
|
| 255 | + $locations = \array_map(function($position) use ($source) { |
|
| 256 | 256 | return SourceLocation::fromSource($source, $position); |
| 257 | 257 | }, $positions); |
| 258 | 258 | } elseif (!empty($this->nodes)) { |
| 259 | - $locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
| 259 | + $locations = \array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
| 260 | 260 | $location = $node->getLocation(); |
| 261 | 261 | if (null !== $location) { |
| 262 | 262 | $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart()); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function buildTypes(array $nodes): array |
| 109 | 109 | { |
| 110 | - return \array_map(function (NodeInterface $node) { |
|
| 110 | + return \array_map(function(NodeInterface $node) { |
|
| 111 | 111 | return $this->buildType($node); |
| 112 | 112 | }, $nodes); |
| 113 | 113 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $directive = newDirective([ |
| 159 | 159 | 'name' => $node->getNameValue(), |
| 160 | 160 | 'description' => $node->getDescriptionValue(), |
| 161 | - 'locations' => \array_map(function (NameNode $node) { |
|
| 161 | + 'locations' => \array_map(function(NameNode $node) { |
|
| 162 | 162 | return $node->getValue(); |
| 163 | 163 | }, $node->getLocations()), |
| 164 | 164 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | { |
| 227 | 227 | $typesMap = keyMap( |
| 228 | 228 | \array_merge($customTypes, specifiedScalarTypes(), introspectionTypes()), |
| 229 | - function (NamedTypeInterface $type) { |
|
| 229 | + function(NamedTypeInterface $type) { |
|
| 230 | 230 | return $type->getName(); |
| 231 | 231 | } |
| 232 | 232 | ); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | $directivesMap = keyMap( |
| 245 | 245 | \array_merge($customDirectives, specifiedDirectives()), |
| 246 | - function (Directive $directive) { |
|
| 246 | + function(Directive $directive) { |
|
| 247 | 247 | return $directive->getName(); |
| 248 | 248 | } |
| 249 | 249 | ); |
@@ -262,10 +262,10 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | return keyValueMap( |
| 264 | 264 | $nodes, |
| 265 | - function (InputValueDefinitionNode $value) { |
|
| 265 | + function(InputValueDefinitionNode $value) { |
|
| 266 | 266 | return $value->getNameValue(); |
| 267 | 267 | }, |
| 268 | - function (InputValueDefinitionNode $value): array { |
|
| 268 | + function(InputValueDefinitionNode $value): array { |
|
| 269 | 269 | $type = $this->buildWrappedType($value->getType()); |
| 270 | 270 | $defaultValue = $value->getDefaultValue(); |
| 271 | 271 | return [ |
@@ -319,14 +319,14 @@ discard block |
||
| 319 | 319 | return newObjectType([ |
| 320 | 320 | 'name' => $node->getNameValue(), |
| 321 | 321 | 'description' => $node->getDescriptionValue(), |
| 322 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
| 322 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
| 323 | 323 | return $this->buildFields($node); |
| 324 | 324 | } : [], |
| 325 | 325 | // Note: While this could make early assertions to get the correctly |
| 326 | 326 | // typed values, that would throw immediately while type system |
| 327 | 327 | // validation with validateSchema() will produce more actionable results. |
| 328 | - 'interfaces' => function () use ($node) { |
|
| 329 | - return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) { |
|
| 328 | + 'interfaces' => function() use ($node) { |
|
| 329 | + return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) { |
|
| 330 | 330 | return $this->buildType($interface); |
| 331 | 331 | }, $node->getInterfaces()) : []; |
| 332 | 332 | }, |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | { |
| 343 | 343 | return keyValueMap( |
| 344 | 344 | $node->getFields(), |
| 345 | - function ($value) { |
|
| 345 | + function($value) { |
|
| 346 | 346 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 347 | 347 | return $value->getNameValue(); |
| 348 | 348 | }, |
| 349 | - function ($value) use ($node) { |
|
| 349 | + function($value) use ($node) { |
|
| 350 | 350 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
| 351 | 351 | return $this->buildField($value, |
| 352 | 352 | $this->getFieldResolver($node->getNameValue(), $value->getNameValue())); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | return newInterfaceType([ |
| 377 | 377 | 'name' => $node->getNameValue(), |
| 378 | 378 | 'description' => $node->getDescriptionValue(), |
| 379 | - 'fields' => $node->hasFields() ? function () use ($node): array { |
|
| 379 | + 'fields' => $node->hasFields() ? function() use ($node) : array { |
|
| 380 | 380 | return $this->buildFields($node); |
| 381 | 381 | } : [], |
| 382 | 382 | 'resolveType' => $this->getTypeResolver($node->getNameValue()), |
@@ -396,10 +396,10 @@ discard block |
||
| 396 | 396 | 'description' => $node->getDescriptionValue(), |
| 397 | 397 | 'values' => $node->hasValues() ? keyValueMap( |
| 398 | 398 | $node->getValues(), |
| 399 | - function (EnumValueDefinitionNode $value): ?string { |
|
| 399 | + function(EnumValueDefinitionNode $value): ?string { |
|
| 400 | 400 | return $value->getNameValue(); |
| 401 | 401 | }, |
| 402 | - function (EnumValueDefinitionNode $value): array { |
|
| 402 | + function(EnumValueDefinitionNode $value): array { |
|
| 403 | 403 | return [ |
| 404 | 404 | 'description' => $value->getDescriptionValue(), |
| 405 | 405 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | return newUnionType([ |
| 422 | 422 | 'name' => $node->getNameValue(), |
| 423 | 423 | 'description' => $node->getDescriptionValue(), |
| 424 | - 'types' => $node->hasTypes() ? \array_map(function (NodeInterface $type) { |
|
| 424 | + 'types' => $node->hasTypes() ? \array_map(function(NodeInterface $type) { |
|
| 425 | 425 | return $this->buildType($type); |
| 426 | 426 | }, $node->getTypes()) : [], |
| 427 | 427 | 'resolveType' => $this->getTypeResolver($node->getNameValue()), |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | return newScalarType([ |
| 451 | 451 | 'name' => $node->getNameValue(), |
| 452 | 452 | 'description' => $node->getDescriptionValue(), |
| 453 | - 'serialize' => function ($value) { |
|
| 453 | + 'serialize' => function($value) { |
|
| 454 | 454 | return $value; |
| 455 | 455 | }, |
| 456 | 456 | 'astNode' => $node, |
@@ -467,13 +467,13 @@ discard block |
||
| 467 | 467 | return newInputObjectType([ |
| 468 | 468 | 'name' => $node->getNameValue(), |
| 469 | 469 | 'description' => $node->getDescriptionValue(), |
| 470 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
| 470 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
| 471 | 471 | return keyValueMap( |
| 472 | 472 | $node->getFields(), |
| 473 | - function (InputValueDefinitionNode $value): ?string { |
|
| 473 | + function(InputValueDefinitionNode $value): ?string { |
|
| 474 | 474 | return $value->getNameValue(); |
| 475 | 475 | }, |
| 476 | - function (InputValueDefinitionNode $value): array { |
|
| 476 | + function(InputValueDefinitionNode $value): array { |
|
| 477 | 477 | $type = $this->buildWrappedType($value->getType()); |
| 478 | 478 | $defaultValue = $value->getDefaultValue(); |
| 479 | 479 | return [ |