@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | return newObjectType([ |
148 | 148 | 'name' => $typeName, |
149 | 149 | 'description' => $type->getDescription(), |
150 | - 'interfaces' => function () use ($type) { |
|
150 | + 'interfaces' => function() use ($type) { |
|
151 | 151 | return $this->extendImplementedInterfaces($type); |
152 | 152 | }, |
153 | - 'fields' => function () use ($type) { |
|
153 | + 'fields' => function() use ($type) { |
|
154 | 154 | return $this->extendFieldMap($type); |
155 | 155 | }, |
156 | 156 | 'astNode' => $type->getAstNode(), |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | $typeName = $type->getName(); |
186 | 186 | |
187 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
187 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
188 | 188 | return $this->getExtendedType($interface); |
189 | 189 | }, $type->getInterfaces()); |
190 | 190 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | 'deprecationReason' => $field->getDeprecationReason(), |
229 | 229 | 'type' => $this->extendFieldType($field->getType()), |
230 | 230 | 'args' => keyMap($field->getArguments(), |
231 | - function (Argument $argument) { |
|
231 | + function(Argument $argument) { |
|
232 | 232 | return $argument->getName(); |
233 | 233 | }), |
234 | 234 | 'astNode' => $field->getAstNode(), |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | return newInterfaceType([ |
303 | 303 | 'name' => $typeName, |
304 | 304 | 'description' => $type->getDescription(), |
305 | - 'fields' => function () use ($type) { |
|
305 | + 'fields' => function() use ($type) { |
|
306 | 306 | return $this->extendFieldMap($type); |
307 | 307 | }, |
308 | 308 | 'astNode' => $type->getAstNode(), |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | return newUnionType([ |
323 | 323 | 'name' => $type->getName(), |
324 | 324 | 'description' => $type->getDescription(), |
325 | - 'types' => \array_map(function ($unionType) { |
|
325 | + 'types' => \array_map(function($unionType) { |
|
326 | 326 | return $this->getExtendedType($unionType); |
327 | 327 | }, $type->getTypes()), |
328 | 328 | 'astNode' => $type->getAstNode(), |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function getExtendedTypes(): array |
366 | 366 | { |
367 | - $extendedTypes = \array_map(function ($type) { |
|
367 | + $extendedTypes = \array_map(function($type) { |
|
368 | 368 | return $this->getExtendedType($type); |
369 | 369 | }, $this->info->getSchema()->getTypeMap()); |
370 | 370 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | return \array_merge( |
389 | 389 | $existingDirectives, |
390 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
390 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
391 | 391 | return $this->definitionBuilder->buildDirective($node); |
392 | 392 | }, $this->info->getDirectiveDefinitions()) |
393 | 393 | ); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | if (!empty($errors)) { |
23 | 23 | $message = \implode("\n", |
24 | - \array_map(function (SchemaValidationException $error) { |
|
24 | + \array_map(function(SchemaValidationException $error) { |
|
25 | 25 | return $error->getMessage(); |
26 | 26 | }, $errors)); |
27 | 27 |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | foreach ($interfaceField->getArguments() as $interfaceArgument) { |
470 | 470 | $argumentName = $interfaceArgument->getName(); |
471 | 471 | $objectArgument = find($objectField->getArguments(), |
472 | - function (Argument $argument) use ($argumentName) { |
|
472 | + function(Argument $argument) use ($argumentName) { |
|
473 | 473 | return $argument->getName() === $argumentName; |
474 | 474 | }); |
475 | 475 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | $argumentName = $objectArgument->getName(); |
533 | 533 | $interfaceArgument = find( |
534 | 534 | $interfaceField->getArguments(), |
535 | - function (Argument $argument) use ($argumentName) { |
|
535 | + function(Argument $argument) use ($argumentName) { |
|
536 | 536 | return $argument->getName() === $argumentName; |
537 | 537 | } |
538 | 538 | ); |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | } |
678 | 678 | |
679 | 679 | return \array_filter($node->getTypes(), |
680 | - function (NamedTypeNode $type) use ($memberTypeName) { |
|
680 | + function(NamedTypeNode $type) use ($memberTypeName) { |
|
681 | 681 | return $type->getNameValue() === $memberTypeName; |
682 | 682 | }); |
683 | 683 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | return \array_filter($node->getValues(), |
759 | - function (NameAwareInterface $type) use ($valueName) { |
|
759 | + function(NameAwareInterface $type) use ($valueName) { |
|
760 | 760 | return $type->getNameValue() === $valueName; |
761 | 761 | }); |
762 | 762 | } |
@@ -97,7 +97,7 @@ |
||
97 | 97 | /** @var OperationTypeDefinitionNode $operationTypeNode */ |
98 | 98 | $operationTypeNode = find( |
99 | 99 | $node->getOperationTypes(), |
100 | - function (OperationTypeDefinitionNode $operationType) use ($operation |
|
100 | + function(OperationTypeDefinitionNode $operationType) use ($operation |
|
101 | 101 | ) { |
102 | 102 | return $operationType->getOperation() === $operation; |
103 | 103 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function getDirective(string $name): ?Directive |
138 | 138 | { |
139 | 139 | return find($this->directives, |
140 | - function (Directive $directive) use ($name) { |
|
140 | + function(Directive $directive) use ($name) { |
|
141 | 141 | return $directive->getName() === $name; |
142 | 142 | }); |
143 | 143 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | ); |
215 | 215 | |
216 | 216 | $this->possibleTypesMap[$abstractTypeName] = \array_reduce($possibleTypes, |
217 | - function (array $map, TypeInterface $type) { |
|
217 | + function(array $map, TypeInterface $type) { |
|
218 | 218 | /** @var NameAwareInterface $type */ |
219 | 219 | $map[$type->getName()] = true; |
220 | 220 | return $map; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | } |
384 | 384 | |
385 | 385 | return \array_reduce($directive->getArguments(), |
386 | - function ($map, Argument $argument) { |
|
386 | + function($map, Argument $argument) { |
|
387 | 387 | return $this->typeMapReducer($map, $argument->getType()); |
388 | 388 | }, $map); |
389 | 389 | } |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
437 | 437 | foreach ($type->getFields() as $field) { |
438 | 438 | if ($field->hasArguments()) { |
439 | - $fieldArgTypes = \array_map(function (Argument $argument) { |
|
439 | + $fieldArgTypes = \array_map(function(Argument $argument) { |
|
440 | 440 | return $argument->getType(); |
441 | 441 | }, $field->getArguments()); |
442 | 442 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function buildTypes(): array |
80 | 80 | { |
81 | - return \array_map(function (TypeDefinitionNodeInterface $definition) { |
|
81 | + return \array_map(function(TypeDefinitionNodeInterface $definition) { |
|
82 | 82 | return $this->definitionBuilder->buildType($definition); |
83 | 83 | }, \array_values($this->info->getTypeDefinitionMap())); |
84 | 84 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function buildDirectives(): array |
90 | 90 | { |
91 | - $directives = \array_map(function (DirectiveDefinitionNode $definition |
|
91 | + $directives = \array_map(function(DirectiveDefinitionNode $definition |
|
92 | 92 | ) { |
93 | 93 | return $this->definitionBuilder->buildDirective($definition); |
94 | 94 | }, $this->info->getDirectiveDefinitions()); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | foreach ($specifiedDirectivesMap as $name => $directive) { |
103 | 103 | if (!arraySome($directives, |
104 | - function (Directive $directive) use ($name) { |
|
104 | + function(Directive $directive) use ($name) { |
|
105 | 105 | return $directive->getName() === $name; |
106 | 106 | })) { |
107 | 107 | $directives[] = $directive; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $builtInTypes = keyMap( |
104 | 104 | \array_merge(specifiedScalarTypes(), introspectionTypes()), |
105 | - function (NamedTypeInterface $type) { |
|
105 | + function(NamedTypeInterface $type) { |
|
106 | 106 | return $type->getName(); |
107 | 107 | } |
108 | 108 | ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function buildTypes(array $nodes): array |
119 | 119 | { |
120 | - return \array_map(function (NodeInterface $node) { |
|
120 | + return \array_map(function(NodeInterface $node) { |
|
121 | 121 | return $this->buildType($node); |
122 | 122 | }, $nodes); |
123 | 123 | } |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | return newObjectType([ |
199 | 199 | 'name' => $node->getNameValue(), |
200 | 200 | 'description' => $node->getDescriptionValue(), |
201 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
201 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
202 | 202 | return $this->buildFields($node); |
203 | 203 | } : [], |
204 | 204 | // Note: While this could make early assertions to get the correctly |
205 | 205 | // typed values, that would throw immediately while type system |
206 | 206 | // validation with validateSchema() will produce more actionable results. |
207 | - 'interfaces' => function () use ($node) { |
|
208 | - return $node->hasInterfaces() ? \array_map(function ( |
|
207 | + 'interfaces' => function() use ($node) { |
|
208 | + return $node->hasInterfaces() ? \array_map(function( |
|
209 | 209 | NodeInterface $interface |
210 | 210 | ) { |
211 | 211 | return $this->buildType($interface); |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | { |
225 | 225 | return keyValueMap( |
226 | 226 | $node->getFields(), |
227 | - function ($value) { |
|
227 | + function($value) { |
|
228 | 228 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
229 | 229 | return $value->getNameValue(); |
230 | 230 | }, |
231 | - function ($value) use ($node) { |
|
231 | + function($value) use ($node) { |
|
232 | 232 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
233 | 233 | return $this->buildField($value, |
234 | 234 | $this->getFieldResolver($node->getNameValue(), |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | { |
292 | 292 | return keyValueMap( |
293 | 293 | $nodes, |
294 | - function (InputValueDefinitionNode $value) { |
|
294 | + function(InputValueDefinitionNode $value) { |
|
295 | 295 | return $value->getNameValue(); |
296 | 296 | }, |
297 | - function (InputValueDefinitionNode $value): array { |
|
297 | + function(InputValueDefinitionNode $value): array { |
|
298 | 298 | $type = $this->buildWrappedType($value->getType()); |
299 | 299 | $defaultValue = $value->getDefaultValue(); |
300 | 300 | return [ |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | return newInterfaceType([ |
349 | 349 | 'name' => $node->getNameValue(), |
350 | 350 | 'description' => $node->getDescriptionValue(), |
351 | - 'fields' => $node->hasFields() ? function () use ($node): array { |
|
351 | + 'fields' => $node->hasFields() ? function() use ($node) : array { |
|
352 | 352 | return $this->buildFields($node); |
353 | 353 | } : [], |
354 | 354 | 'resolveType' => $this->getTypeResolver($node->getNameValue()), |
@@ -380,10 +380,10 @@ discard block |
||
380 | 380 | 'description' => $node->getDescriptionValue(), |
381 | 381 | 'values' => $node->hasValues() ? keyValueMap( |
382 | 382 | $node->getValues(), |
383 | - function (EnumValueDefinitionNode $value): string { |
|
383 | + function(EnumValueDefinitionNode $value): string { |
|
384 | 384 | return $value->getNameValue(); |
385 | 385 | }, |
386 | - function (EnumValueDefinitionNode $value): array { |
|
386 | + function(EnumValueDefinitionNode $value): array { |
|
387 | 387 | return [ |
388 | 388 | 'description' => $value->getDescriptionValue(), |
389 | 389 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | return newUnionType([ |
406 | 406 | 'name' => $node->getNameValue(), |
407 | 407 | 'description' => $node->getDescriptionValue(), |
408 | - 'types' => $node->hasTypes() ? \array_map(function ( |
|
408 | + 'types' => $node->hasTypes() ? \array_map(function( |
|
409 | 409 | TypeNodeInterface $type |
410 | 410 | ) { |
411 | 411 | return $this->buildType($type); |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | return newScalarType([ |
426 | 426 | 'name' => $node->getNameValue(), |
427 | 427 | 'description' => $node->getDescriptionValue(), |
428 | - 'serialize' => function ($value) { |
|
428 | + 'serialize' => function($value) { |
|
429 | 429 | return $value; |
430 | 430 | }, |
431 | 431 | 'astNode' => $node, |
@@ -442,13 +442,13 @@ discard block |
||
442 | 442 | return newInputObjectType([ |
443 | 443 | 'name' => $node->getNameValue(), |
444 | 444 | 'description' => $node->getDescriptionValue(), |
445 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
445 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
446 | 446 | return keyValueMap( |
447 | 447 | $node->getFields(), |
448 | - function (InputValueDefinitionNode $value): string { |
|
448 | + function(InputValueDefinitionNode $value): string { |
|
449 | 449 | return $value->getNameValue(); |
450 | 450 | }, |
451 | - function (InputValueDefinitionNode $value): array { |
|
451 | + function(InputValueDefinitionNode $value): array { |
|
452 | 452 | $type = $this->buildWrappedType($value->getType()); |
453 | 453 | $defaultValue = $value->getDefaultValue(); |
454 | 454 | return [ |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | return newDirective([ |
483 | 483 | 'name' => $node->getNameValue(), |
484 | 484 | 'description' => $node->getDescriptionValue(), |
485 | - 'locations' => \array_map(function (NameNode $node) { |
|
485 | + 'locations' => \array_map(function(NameNode $node) { |
|
486 | 486 | return $node->getValue(); |
487 | 487 | }, $node->getLocations()), |
488 | 488 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -35,7 +35,7 @@ |
||
35 | 35 | ->withArgument(ASTBuilderInterface::class) |
36 | 36 | ->withArgument(NodeBuilderInterface::class); |
37 | 37 | |
38 | - $this->container->add(LexerInterface::class, function () { |
|
38 | + $this->container->add(LexerInterface::class, function() { |
|
39 | 39 | return new Lexer(SupportedReaders::get()); |
40 | 40 | }); |
41 | 41 |
@@ -107,7 +107,7 @@ |
||
107 | 107 | if (null !== $fieldOrDirective) { |
108 | 108 | $argumentDefinition = find( |
109 | 109 | $fieldOrDirective->getArguments(), |
110 | - function (Argument $argument) use ($node) { |
|
110 | + function(Argument $argument) use ($node) { |
|
111 | 111 | return $argument->getName() === $node->getNameValue(); |
112 | 112 | } |
113 | 113 | ); |