@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function getOperationTypesAsArray(): array |
| 35 | 35 | { |
| 36 | - return array_map(function (SerializationInterface $node) { |
|
| 36 | + return array_map(function(SerializationInterface $node) { |
|
| 37 | 37 | return $node->toArray(); |
| 38 | 38 | }, $this->operationTypes); |
| 39 | 39 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function getFieldsAsArray(): array |
| 28 | 28 | { |
| 29 | - return array_map(function (SerializationInterface $node) { |
|
| 29 | + return array_map(function(SerializationInterface $node) { |
|
| 30 | 30 | return $node->toArray(); |
| 31 | 31 | }, $this->fields); |
| 32 | 32 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | * @return mixed |
| 440 | 440 | * @throws GraphQLError |
| 441 | 441 | */ |
| 442 | - $parseType = function (LexerInterface $lexer) { |
|
| 442 | + $parseType = function(LexerInterface $lexer) { |
|
| 443 | 443 | $this->expect($lexer, TokenKindEnum::COLON); |
| 444 | 444 | return $this->parseTypeReference($lexer); |
| 445 | 445 | }; |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | * @return mixed |
| 570 | 570 | * @throws GraphQLError |
| 571 | 571 | */ |
| 572 | - $parseValue = function (LexerInterface $lexer) { |
|
| 572 | + $parseValue = function(LexerInterface $lexer) { |
|
| 573 | 573 | $this->expect($lexer, TokenKindEnum::COLON); |
| 574 | 574 | return $this->parseValueLiteral($lexer, false); |
| 575 | 575 | }; |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | * @return mixed |
| 597 | 597 | * @throws GraphQLError |
| 598 | 598 | */ |
| 599 | - $parseValue = function (LexerInterface $lexer) { |
|
| 599 | + $parseValue = function(LexerInterface $lexer) { |
|
| 600 | 600 | $this->expect($lexer, TokenKindEnum::COLON); |
| 601 | 601 | return $this->parseConstValue($lexer); |
| 602 | 602 | }; |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $this->expectKeyword($lexer, KeywordEnum::FRAGMENT); |
| 659 | 659 | |
| 660 | - $parseTypeCondition = function (LexerInterface $lexer) { |
|
| 660 | + $parseTypeCondition = function(LexerInterface $lexer) { |
|
| 661 | 661 | $this->expectKeyword($lexer, 'on'); |
| 662 | 662 | return $this->parseNamedType($lexer); |
| 663 | 663 | }; |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | { |
| 855 | 855 | $start = $lexer->getToken(); |
| 856 | 856 | |
| 857 | - $parseValue = function (LexerInterface $lexer, bool $isConst) { |
|
| 857 | + $parseValue = function(LexerInterface $lexer, bool $isConst) { |
|
| 858 | 858 | $this->expect($lexer, TokenKindEnum::COLON); |
| 859 | 859 | return $this->parseValueLiteral($lexer, $isConst); |
| 860 | 860 | }; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $builtInTypes = keyMap( |
| 79 | 79 | array_merge(specifiedScalarTypes()/*, introspectionTypes()*/), |
| 80 | - function (NamedTypeInterface $type) { |
|
| 80 | + function(NamedTypeInterface $type) { |
|
| 81 | 81 | return $type->getName(); |
| 82 | 82 | } |
| 83 | 83 | ); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return GraphQLDirective([ |
| 133 | 133 | 'name' => $node->getNameValue(), |
| 134 | 134 | 'description' => $node->getDescriptionValue(), |
| 135 | - 'locations' => array_map(function (NameNode $node) { |
|
| 135 | + 'locations' => array_map(function(NameNode $node) { |
|
| 136 | 136 | return $node->getValue(); |
| 137 | 137 | }, $node->getLocations()), |
| 138 | 138 | 'arguments' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | return keyValMap( |
| 181 | 181 | $nodes, |
| 182 | - function (InputValueDefinitionNode $value) { |
|
| 182 | + function(InputValueDefinitionNode $value) { |
|
| 183 | 183 | return $value->getNameValue(); |
| 184 | 184 | }, |
| 185 | - function (InputValueDefinitionNode $value): array { |
|
| 185 | + function(InputValueDefinitionNode $value): array { |
|
| 186 | 186 | $type = $this->buildWrappedType($value->getType()); |
| 187 | 187 | return [ |
| 188 | 188 | 'type' => $type, |
@@ -231,11 +231,11 @@ discard block |
||
| 231 | 231 | return GraphQLObjectType([ |
| 232 | 232 | 'name' => $node->getNameValue(), |
| 233 | 233 | 'description' => $node->getDescriptionValue(), |
| 234 | - 'fields' => function () use ($node) { |
|
| 234 | + 'fields' => function() use ($node) { |
|
| 235 | 235 | return $this->buildFields($node); |
| 236 | 236 | }, |
| 237 | - 'interfaces' => function () use ($node) { |
|
| 238 | - return $node->hasInterfaces() ? array_map(function (InterfaceTypeDefinitionNode $interface) { |
|
| 237 | + 'interfaces' => function() use ($node) { |
|
| 238 | + return $node->hasInterfaces() ? array_map(function(InterfaceTypeDefinitionNode $interface) { |
|
| 239 | 239 | return $this->buildType($interface); |
| 240 | 240 | }, $node->getInterfaces()) : []; |
| 241 | 241 | }, |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | { |
| 253 | 253 | return $node->hasFields() ? keyValMap( |
| 254 | 254 | $node->getFields(), |
| 255 | - function ($value) { |
|
| 255 | + function($value) { |
|
| 256 | 256 | /** @noinspection PhpUndefinedMethodInspection */ |
| 257 | 257 | return $value->getNameValue(); |
| 258 | 258 | }, |
| 259 | - function ($value) { |
|
| 259 | + function($value) { |
|
| 260 | 260 | return $this->buildField($value); |
| 261 | 261 | } |
| 262 | 262 | ) : []; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | return GraphQLInterfaceType([ |
| 272 | 272 | 'name' => $node->getNameValue(), |
| 273 | 273 | 'description' => $node->getDescriptionValue(), |
| 274 | - 'fields' => function () use ($node): array { |
|
| 274 | + 'fields' => function() use ($node): array { |
|
| 275 | 275 | return $this->buildFields($node); |
| 276 | 276 | }, |
| 277 | 277 | 'astNode' => $node, |
@@ -289,10 +289,10 @@ discard block |
||
| 289 | 289 | 'description' => $node->getDescriptionValue(), |
| 290 | 290 | 'values' => $node->hasValues() ? keyValMap( |
| 291 | 291 | $node->getValues(), |
| 292 | - function (EnumValueDefinitionNode $value): string { |
|
| 292 | + function(EnumValueDefinitionNode $value): string { |
|
| 293 | 293 | return $value->getNameValue(); |
| 294 | 294 | }, |
| 295 | - function (EnumValueDefinitionNode $value): array { |
|
| 295 | + function(EnumValueDefinitionNode $value): array { |
|
| 296 | 296 | return [ |
| 297 | 297 | 'description' => $value->getDescriptionValue(), |
| 298 | 298 | 'deprecationReason' => getDeprecationReason($value), |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | return GraphQLUnionType([ |
| 310 | 310 | 'name' => $node->getNameValue(), |
| 311 | 311 | 'description' => $node->getDescriptionValue(), |
| 312 | - 'types' => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) { |
|
| 312 | + 'types' => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) { |
|
| 313 | 313 | return $this->buildType($type); |
| 314 | 314 | }, $node->getTypes()) : [], |
| 315 | 315 | 'astNode' => $node, |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | return GraphQLScalarType([ |
| 326 | 326 | 'name' => $node->getNameValue(), |
| 327 | 327 | 'description' => $node->getDescriptionValue(), |
| 328 | - 'serialize' => function ($value) { |
|
| 328 | + 'serialize' => function($value) { |
|
| 329 | 329 | return $value; |
| 330 | 330 | }, |
| 331 | 331 | 'astNode' => $node, |
@@ -345,10 +345,10 @@ discard block |
||
| 345 | 345 | 'description' => $node->getDescriptionValue(), |
| 346 | 346 | 'fields' => $node->hasFields() ? keyValMap( |
| 347 | 347 | $node->getFields(), |
| 348 | - function (InputValueDefinitionNode $value): string { |
|
| 348 | + function(InputValueDefinitionNode $value): string { |
|
| 349 | 349 | return $value->getNameValue(); |
| 350 | 350 | }, |
| 351 | - function (InputValueDefinitionNode $value): array { |
|
| 351 | + function(InputValueDefinitionNode $value): array { |
|
| 352 | 352 | $type = $this->buildWrappedType($value->getType()); |
| 353 | 353 | return [ |
| 354 | 354 | 'type' => $type, |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | { |
| 73 | 73 | return arraySome( |
| 74 | 74 | specifiedScalarTypes(), |
| 75 | - function (ScalarType $specifiedScalarType) use ($type) { |
|
| 75 | + function(ScalarType $specifiedScalarType) use ($type) { |
|
| 76 | 76 | /** @noinspection PhpUndefinedMethodInspection */ |
| 77 | 77 | return $type->getName() === $specifiedScalarType->getName(); |
| 78 | 78 | } |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' . |
| 34 | 34 | 'exposes all available types and directives on the server, as well as ' . |
| 35 | 35 | 'the entry points for query, mutation, and subscription operations.', |
| 36 | - 'fields' => function () { |
|
| 36 | + 'fields' => function() { |
|
| 37 | 37 | return [ |
| 38 | 38 | 'types' => [ |
| 39 | 39 | 'description' => 'A list of all types supported by this server.', |
| 40 | 40 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type()))), |
| 41 | - 'resolve' => function (SchemaInterface $schema): array { |
|
| 41 | + 'resolve' => function(SchemaInterface $schema): array { |
|
| 42 | 42 | return array_values($schema->getTypeMap()); |
| 43 | 43 | }, |
| 44 | 44 | ], |
| 45 | 45 | 'queryType' => [ |
| 46 | 46 | 'description' => 'The type that query operations will be rooted at.', |
| 47 | 47 | 'type' => GraphQLNonNull(__Type()), |
| 48 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
| 48 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
| 49 | 49 | return $schema->getQuery(); |
| 50 | 50 | }, |
| 51 | 51 | ], |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'If this server supports mutation, the type that ' . |
| 55 | 55 | 'mutation operations will be rooted at.', |
| 56 | 56 | 'type' => __Type(), |
| 57 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
| 57 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
| 58 | 58 | return $schema->getMutation(); |
| 59 | 59 | }, |
| 60 | 60 | ], |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | 'If this server support subscription, the type that ' . |
| 64 | 64 | 'subscription operations will be rooted at.', |
| 65 | 65 | 'type' => __Type(), |
| 66 | - 'resolve' => function (SchemaInterface $schema): ObjectType { |
|
| 66 | + 'resolve' => function(SchemaInterface $schema): ObjectType { |
|
| 67 | 67 | return $schema->getSubscription(); |
| 68 | 68 | }, |
| 69 | 69 | ], |
| 70 | 70 | 'directives' => [ |
| 71 | 71 | 'description' => 'A list of all directives supported by this server.', |
| 72 | 72 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive()))), |
| 73 | - 'resolve' => function (SchemaInterface $schema): array { |
|
| 73 | + 'resolve' => function(SchemaInterface $schema): array { |
|
| 74 | 74 | return $schema->getDirectives(); |
| 75 | 75 | }, |
| 76 | 76 | ], |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'execution behavior in ways field arguments will not suffice, such as ' . |
| 101 | 101 | 'conditionally including or skipping a field. Directives provide this by ' . |
| 102 | 102 | 'describing additional information to the executor.', |
| 103 | - 'fields' => function () { |
|
| 103 | + 'fields' => function() { |
|
| 104 | 104 | return [ |
| 105 | 105 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
| 106 | 106 | 'description' => ['type' => GraphQLString()], |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | ], |
| 110 | 110 | 'args' => [ |
| 111 | 111 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
| 112 | - 'resolve' => function (DirectiveInterface $directive): array { |
|
| 112 | + 'resolve' => function(DirectiveInterface $directive): array { |
|
| 113 | 113 | return $directive->getArguments() ?: []; |
| 114 | 114 | }, |
| 115 | 115 | ], |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | 'Object and Interface types provide the fields they describe. Abstract ' . |
| 218 | 218 | 'types, Union and Interface, provide the Object types possible ' . |
| 219 | 219 | 'at runtime. List and NonNull types compose other types.', |
| 220 | - 'fields' => function () { |
|
| 220 | + 'fields' => function() { |
|
| 221 | 221 | return [ |
| 222 | 222 | 'kind' => [ |
| 223 | 223 | 'type' => GraphQLNonNull(__TypeKind()), |
| 224 | - 'resolve' => function (TypeInterface $type) { |
|
| 224 | + 'resolve' => function(TypeInterface $type) { |
|
| 225 | 225 | if ($type instanceof ScalarType) { |
| 226 | 226 | return TypeKindEnum::SCALAR; |
| 227 | 227 | } |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | 'args' => [ |
| 258 | 258 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
| 259 | 259 | ], |
| 260 | - 'resolve' => function (TypeInterface $type, array $args): ?array { |
|
| 260 | + 'resolve' => function(TypeInterface $type, array $args): ?array { |
|
| 261 | 261 | [$includeDeprecated] = $args; |
| 262 | 262 | |
| 263 | 263 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
| 264 | 264 | $fields = array_values($type->getFields()); |
| 265 | 265 | |
| 266 | 266 | if (!$includeDeprecated) { |
| 267 | - $fields = array_filter($fields, function (Field $field) { |
|
| 267 | + $fields = array_filter($fields, function(Field $field) { |
|
| 268 | 268 | return !$field->isDeprecated(); |
| 269 | 269 | }); |
| 270 | 270 | } |
@@ -277,13 +277,13 @@ discard block |
||
| 277 | 277 | ], |
| 278 | 278 | 'interfaces' => [ |
| 279 | 279 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
| 280 | - 'resolve' => function (TypeInterface $type): ?array { |
|
| 280 | + 'resolve' => function(TypeInterface $type): ?array { |
|
| 281 | 281 | return $type instanceof ObjectType ? $type->getInterfaces() : null; |
| 282 | 282 | }, |
| 283 | 283 | ], |
| 284 | 284 | 'possibleTypes' => [ |
| 285 | 285 | 'type' => GraphQLList(GraphQLNonNull(__Type())), |
| 286 | - 'resolve' => function (TypeInterface $type, $args, $context, $info): ?array { |
|
| 286 | + 'resolve' => function(TypeInterface $type, $args, $context, $info): ?array { |
|
| 287 | 287 | /** @var SchemaInterface $schema */ |
| 288 | 288 | [$schema] = $info; |
| 289 | 289 | /** @noinspection PhpParamsInspection */ |
@@ -295,14 +295,14 @@ discard block |
||
| 295 | 295 | 'args' => [ |
| 296 | 296 | 'includeDeprecated' => ['type' => GraphQLBoolean(), 'defaultValue' => false], |
| 297 | 297 | ], |
| 298 | - 'resolve' => function (TypeInterface $type, array $args): ?array { |
|
| 298 | + 'resolve' => function(TypeInterface $type, array $args): ?array { |
|
| 299 | 299 | [$includeDeprecated] = $args; |
| 300 | 300 | |
| 301 | 301 | if ($type instanceof EnumType) { |
| 302 | 302 | $values = array_values($type->getValues()); |
| 303 | 303 | |
| 304 | 304 | if (!$includeDeprecated) { |
| 305 | - $values = array_filter($values, function (Field $field) { |
|
| 305 | + $values = array_filter($values, function(Field $field) { |
|
| 306 | 306 | return !$field->isDeprecated(); |
| 307 | 307 | }); |
| 308 | 308 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | ], |
| 316 | 316 | 'inputFields' => [ |
| 317 | 317 | 'type' => GraphQLList(GraphQLNonNull(__InputValue())), |
| 318 | - 'resolve' => function (TypeInterface $type): ?array { |
|
| 318 | + 'resolve' => function(TypeInterface $type): ?array { |
|
| 319 | 319 | return $type instanceof InputObjectType ? $type->getFields() : null; |
| 320 | 320 | }, |
| 321 | 321 | ], |
@@ -342,13 +342,13 @@ discard block |
||
| 342 | 342 | 'description' => |
| 343 | 343 | 'Object and Interface types are described by a list of Fields, each of ' . |
| 344 | 344 | 'which has a name, potentially a list of arguments, and a return type.', |
| 345 | - 'fields' => function () { |
|
| 345 | + 'fields' => function() { |
|
| 346 | 346 | return [ |
| 347 | 347 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
| 348 | 348 | 'description' => ['type' => GraphQLString()], |
| 349 | 349 | 'args' => [ |
| 350 | 350 | 'type' => GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue()))), |
| 351 | - 'resolve' => function (DirectiveInterface $directive): array { |
|
| 351 | + 'resolve' => function(DirectiveInterface $directive): array { |
|
| 352 | 352 | return $directive->getArguments() ?: []; |
| 353 | 353 | }, |
| 354 | 354 | ], |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | 'Arguments provided to Fields or Directives and the input fields of an ' . |
| 379 | 379 | 'InputObject are represented as Input Values which describe their type ' . |
| 380 | 380 | 'and optionally a default value.', |
| 381 | - 'fields' => function () { |
|
| 381 | + 'fields' => function() { |
|
| 382 | 382 | return [ |
| 383 | 383 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
| 384 | 384 | 'description' => ['type' => GraphQLString()], |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | 'description' => |
| 389 | 389 | 'A GraphQL-formatted string representing the default value for this ' . |
| 390 | 390 | 'input value.', |
| 391 | - 'resolve' => function ($inputValue) { |
|
| 391 | + 'resolve' => function($inputValue) { |
|
| 392 | 392 | // TODO: Implement this when we have support for printing AST. |
| 393 | 393 | return null; |
| 394 | 394 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | 'One possible value for a given Enum. Enum values are unique values, not ' . |
| 417 | 417 | 'a placeholder for a string or numeric value. However an Enum value is ' . |
| 418 | 418 | 'returned in a JSON response as a string.', |
| 419 | - 'fields' => function () { |
|
| 419 | + 'fields' => function() { |
|
| 420 | 420 | return [ |
| 421 | 421 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
| 422 | 422 | 'description' => ['type' => GraphQLString()], |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | 'name' => '__schema', |
| 482 | 482 | 'type' => GraphQLNonNull(__Schema()), |
| 483 | 483 | 'description' => 'Access the current type schema of this server.', |
| 484 | - 'resolve' => function ($source, $args, $context, $info): SchemaInterface { |
|
| 484 | + 'resolve' => function($source, $args, $context, $info): SchemaInterface { |
|
| 485 | 485 | [$schema] = $info; |
| 486 | 486 | return $schema; |
| 487 | 487 | } |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | 'args' => [ |
| 502 | 502 | 'name' => ['type' => GraphQLNonNull(GraphQLString())], |
| 503 | 503 | ], |
| 504 | - 'resolve' => function ($source, $args, $context, $info): TypeInterface { |
|
| 504 | + 'resolve' => function($source, $args, $context, $info): TypeInterface { |
|
| 505 | 505 | /** @var SchemaInterface $schema */ |
| 506 | 506 | [$name] = $args; |
| 507 | 507 | [$schema] = $info; |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | 'name' => '__typename', |
| 521 | 521 | 'type' => GraphQLNonNull(GraphQLString()), |
| 522 | 522 | 'description' => 'The name of the current Object type at runtime.', |
| 523 | - 'resolve' => function ($source, $args, $context, $info): string { |
|
| 523 | + 'resolve' => function($source, $args, $context, $info): string { |
|
| 524 | 524 | /** @var NamedTypeInterface $parentType */ |
| 525 | 525 | [$parentType] = $info; |
| 526 | 526 | return $parentType->getName(); |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | { |
| 554 | 554 | return arraySome( |
| 555 | 555 | introspectionTypes(), |
| 556 | - function (TypeInterface $introspectionType) use ($type) { |
|
| 556 | + function(TypeInterface $introspectionType) use ($type) { |
|
| 557 | 557 | /** @noinspection PhpUndefinedMethodInspection */ |
| 558 | 558 | return $type->getName() === $introspectionType->getName(); |
| 559 | 559 | } |
@@ -29,14 +29,14 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function register() |
| 31 | 31 | { |
| 32 | - $this->container->add(NodeBuilderInterface::class, function () { |
|
| 32 | + $this->container->add(NodeBuilderInterface::class, function() { |
|
| 33 | 33 | return new NodeBuilder(SupportedBuilders::get()); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | 36 | $this->container->add(ParserInterface::class, Parser::class, true/* $shared */) |
| 37 | 37 | ->withArgument(NodeBuilderInterface::class); |
| 38 | 38 | |
| 39 | - $this->container->add(LexerInterface::class, function () { |
|
| 39 | + $this->container->add(LexerInterface::class, function() { |
|
| 40 | 40 | return new Lexer(SupportedReaders::get()); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function register() |
| 29 | 29 | { |
| 30 | - $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function () { |
|
| 30 | + $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function() { |
|
| 31 | 31 | return GraphQLDirective([ |
| 32 | 32 | 'name' => 'include', |
| 33 | 33 | 'description' => |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ]); |
| 48 | 48 | }, true/* $shared */); |
| 49 | 49 | |
| 50 | - $this->container->add(GraphQL::SKIP_DIRECTIVE, function () { |
|
| 50 | + $this->container->add(GraphQL::SKIP_DIRECTIVE, function() { |
|
| 51 | 51 | return GraphQLDirective([ |
| 52 | 52 | 'name' => 'skip', |
| 53 | 53 | 'description' => |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ]); |
| 68 | 68 | }, true/* $shared */); |
| 69 | 69 | |
| 70 | - $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function () { |
|
| 70 | + $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function() { |
|
| 71 | 71 | return GraphQLDirective([ |
| 72 | 72 | 'name' => 'deprecated', |
| 73 | 73 | 'description' => 'Marks an element of a GraphQL schema as no longer supported.', |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | return (bool)$value; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $this->container->add(GraphQL::BOOLEAN, function () { |
|
| 51 | + $this->container->add(GraphQL::BOOLEAN, function() { |
|
| 52 | 52 | return GraphQLScalarType([ |
| 53 | 53 | 'name' => TypeNameEnum::BOOLEAN, |
| 54 | 54 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
| 55 | - 'serialize' => function ($value) { |
|
| 55 | + 'serialize' => function($value) { |
|
| 56 | 56 | return coerceBoolean($value); |
| 57 | 57 | }, |
| 58 | - 'parseValue' => function ($value) { |
|
| 58 | + 'parseValue' => function($value) { |
|
| 59 | 59 | return coerceBoolean($value); |
| 60 | 60 | }, |
| 61 | 61 | |
| 62 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 62 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 63 | 63 | /** @var BooleanValueNode $astNode */ |
| 64 | 64 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
| 65 | 65 | }, |
@@ -84,20 +84,20 @@ discard block |
||
| 84 | 84 | throw new \TypeError(sprintf('Float cannot represent non numeric value: %s', $value)); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $this->container->add(GraphQL::FLOAT, function () { |
|
| 87 | + $this->container->add(GraphQL::FLOAT, function() { |
|
| 88 | 88 | return GraphQLScalarType([ |
| 89 | 89 | 'name' => TypeNameEnum::FLOAT, |
| 90 | 90 | 'description' => |
| 91 | 91 | 'The `Float` scalar type represents signed double-precision fractional ' . |
| 92 | 92 | 'values as specified by ' . |
| 93 | 93 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
| 94 | - 'serialize' => function ($value) { |
|
| 94 | + 'serialize' => function($value) { |
|
| 95 | 95 | return coerceFloat($value); |
| 96 | 96 | }, |
| 97 | - 'parseValue' => function ($value) { |
|
| 97 | + 'parseValue' => function($value) { |
|
| 98 | 98 | return coerceFloat($value); |
| 99 | 99 | }, |
| 100 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 100 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 101 | 101 | /** @var FloatValueNode $astNode */ |
| 102 | 102 | return $astNode->getKind() === NodeKindEnum::FLOAT || $astNode->getKind() === NodeKindEnum::INT |
| 103 | 103 | ? $astNode->getValue() |
@@ -135,19 +135,19 @@ discard block |
||
| 135 | 135 | return $intValue; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $this->container->add(GraphQL::INT, function () { |
|
| 138 | + $this->container->add(GraphQL::INT, function() { |
|
| 139 | 139 | return GraphQLScalarType([ |
| 140 | 140 | 'name' => TypeNameEnum::INT, |
| 141 | 141 | 'description' => |
| 142 | 142 | 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
| 143 | 143 | 'values. Int can represent values between -(2^31) and 2^31 - 1.', |
| 144 | - 'serialize' => function ($value) { |
|
| 144 | + 'serialize' => function($value) { |
|
| 145 | 145 | return coerceInt($value); |
| 146 | 146 | }, |
| 147 | - 'parseValue' => function ($value) { |
|
| 147 | + 'parseValue' => function($value) { |
|
| 148 | 148 | return coerceInt($value); |
| 149 | 149 | }, |
| 150 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 150 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 151 | 151 | /** @var IntValueNode $astNode */ |
| 152 | 152 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
| 153 | 153 | }, |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | return (string)$value; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $this->container->add(GraphQL::ID, function () { |
|
| 183 | + $this->container->add(GraphQL::ID, function() { |
|
| 184 | 184 | return GraphQLScalarType([ |
| 185 | 185 | 'name' => TypeNameEnum::ID, |
| 186 | 186 | 'description' => |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | 'response as a String; however, it is not intended to be human-readable. ' . |
| 190 | 190 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
| 191 | 191 | '(such as `4`) input value will be accepted as an ID.', |
| 192 | - 'serialize' => function ($value) { |
|
| 192 | + 'serialize' => function($value) { |
|
| 193 | 193 | return coerceString($value); |
| 194 | 194 | }, |
| 195 | - 'parseValue' => function ($value) { |
|
| 195 | + 'parseValue' => function($value) { |
|
| 196 | 196 | return coerceString($value); |
| 197 | 197 | }, |
| 198 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 198 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 199 | 199 | /** @var StringValueNode $astNode */ |
| 200 | 200 | return $astNode->getKind() === NodeKindEnum::STRING || $astNode->getKind() === NodeKindEnum::INT |
| 201 | 201 | ? $astNode->getValue() |
@@ -204,20 +204,20 @@ discard block |
||
| 204 | 204 | ]); |
| 205 | 205 | }, true/* $shared */); |
| 206 | 206 | |
| 207 | - $this->container->add(GraphQL::STRING, function () { |
|
| 207 | + $this->container->add(GraphQL::STRING, function() { |
|
| 208 | 208 | return GraphQLScalarType([ |
| 209 | 209 | 'name' => TypeNameEnum::STRING, |
| 210 | 210 | 'description' => |
| 211 | 211 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
| 212 | 212 | 'character sequences. The String type is most often used by GraphQL to ' . |
| 213 | 213 | 'represent free-form human-readable text.', |
| 214 | - 'serialize' => function ($value) { |
|
| 214 | + 'serialize' => function($value) { |
|
| 215 | 215 | return coerceString($value); |
| 216 | 216 | }, |
| 217 | - 'parseValue' => function ($value) { |
|
| 217 | + 'parseValue' => function($value) { |
|
| 218 | 218 | return coerceString($value); |
| 219 | 219 | }, |
| 220 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 220 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 221 | 221 | /** @var StringValueNode $astNode */ |
| 222 | 222 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
| 223 | 223 | }, |