@@ -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 | return $type->getName() === $specifiedScalarType->getName(); |
| 77 | 77 | } |
| 78 | 78 | ); |
@@ -214,14 +214,14 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | protected function registerParser() |
| 216 | 216 | { |
| 217 | - $this->shared(NodeBuilderInterface::class, function () { |
|
| 217 | + $this->shared(NodeBuilderInterface::class, function() { |
|
| 218 | 218 | return new NodeBuilder(self::getNodeBuilders()); |
| 219 | 219 | }); |
| 220 | 220 | |
| 221 | 221 | $this->shared(ParserInterface::class, Parser::class) |
| 222 | 222 | ->withArgument(NodeBuilderInterface::class); |
| 223 | 223 | |
| 224 | - $this->bind(LexerInterface::class, function () { |
|
| 224 | + $this->bind(LexerInterface::class, function() { |
|
| 225 | 225 | return new Lexer(self::getSourceReaders()); |
| 226 | 226 | }); |
| 227 | 227 | } |
@@ -253,18 +253,18 @@ discard block |
||
| 253 | 253 | return (bool)$value; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $this->shared('GraphQLBoolean', function () { |
|
| 256 | + $this->shared('GraphQLBoolean', function() { |
|
| 257 | 257 | return GraphQLScalarType([ |
| 258 | 258 | 'name' => TypeNameEnum::BOOLEAN, |
| 259 | 259 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
| 260 | - 'serialize' => function ($value) { |
|
| 260 | + 'serialize' => function($value) { |
|
| 261 | 261 | return coerceBoolean($value); |
| 262 | 262 | }, |
| 263 | - 'parseValue' => function ($value) { |
|
| 263 | + 'parseValue' => function($value) { |
|
| 264 | 264 | return coerceBoolean($value); |
| 265 | 265 | }, |
| 266 | 266 | |
| 267 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 267 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 268 | 268 | /** @var BooleanValueNode $astNode */ |
| 269 | 269 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
| 270 | 270 | }, |
@@ -289,20 +289,20 @@ discard block |
||
| 289 | 289 | throw new \TypeError(sprintf('Float cannot represent non numeric value: %s', $value)); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - $this->shared('GraphQLFloat', function () { |
|
| 292 | + $this->shared('GraphQLFloat', function() { |
|
| 293 | 293 | return GraphQLScalarType([ |
| 294 | 294 | 'name' => TypeNameEnum::FLOAT, |
| 295 | 295 | 'description' => |
| 296 | 296 | 'The `Float` scalar type represents signed double-precision fractional ' . |
| 297 | 297 | 'values as specified by ' . |
| 298 | 298 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
| 299 | - 'serialize' => function ($value) { |
|
| 299 | + 'serialize' => function($value) { |
|
| 300 | 300 | return coerceFloat($value); |
| 301 | 301 | }, |
| 302 | - 'parseValue' => function ($value) { |
|
| 302 | + 'parseValue' => function($value) { |
|
| 303 | 303 | return coerceFloat($value); |
| 304 | 304 | }, |
| 305 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 305 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 306 | 306 | /** @var FloatValueNode $astNode */ |
| 307 | 307 | return in_array($astNode->getKind(), [NodeKindEnum::FLOAT, NodeKindEnum::INT], true) |
| 308 | 308 | ? $astNode->getValue() |
@@ -340,19 +340,19 @@ discard block |
||
| 340 | 340 | return $intValue; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - $this->shared('GraphQLInt', function () { |
|
| 343 | + $this->shared('GraphQLInt', function() { |
|
| 344 | 344 | return GraphQLScalarType([ |
| 345 | 345 | 'name' => TypeNameEnum::INT, |
| 346 | 346 | 'description' => |
| 347 | 347 | 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
| 348 | 348 | 'values. Int can represent values between -(2^31) and 2^31 - 1.', |
| 349 | - 'serialize' => function ($value) { |
|
| 349 | + 'serialize' => function($value) { |
|
| 350 | 350 | return coerceInt($value); |
| 351 | 351 | }, |
| 352 | - 'parseValue' => function ($value) { |
|
| 352 | + 'parseValue' => function($value) { |
|
| 353 | 353 | return coerceInt($value); |
| 354 | 354 | }, |
| 355 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 355 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 356 | 356 | /** @var IntValueNode $astNode */ |
| 357 | 357 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
| 358 | 358 | }, |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | return (string)$value; |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - $this->shared('GraphQLID', function () { |
|
| 388 | + $this->shared('GraphQLID', function() { |
|
| 389 | 389 | return GraphQLScalarType([ |
| 390 | 390 | 'name' => TypeNameEnum::ID, |
| 391 | 391 | 'description' => |
@@ -394,13 +394,13 @@ discard block |
||
| 394 | 394 | 'response as a String; however, it is not intended to be human-readable. ' . |
| 395 | 395 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
| 396 | 396 | '(such as `4`) input value will be accepted as an ID.', |
| 397 | - 'serialize' => function ($value) { |
|
| 397 | + 'serialize' => function($value) { |
|
| 398 | 398 | return coerceString($value); |
| 399 | 399 | }, |
| 400 | - 'parseValue' => function ($value) { |
|
| 400 | + 'parseValue' => function($value) { |
|
| 401 | 401 | return coerceString($value); |
| 402 | 402 | }, |
| 403 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 403 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 404 | 404 | /** @var StringValueNode $astNode */ |
| 405 | 405 | return in_array($astNode->getKind(), [NodeKindEnum::STRING, NodeKindEnum::INT], true) |
| 406 | 406 | ? $astNode->getValue() |
@@ -409,20 +409,20 @@ discard block |
||
| 409 | 409 | ]); |
| 410 | 410 | }); |
| 411 | 411 | |
| 412 | - $this->shared('GraphQLString', function () { |
|
| 412 | + $this->shared('GraphQLString', function() { |
|
| 413 | 413 | return GraphQLScalarType([ |
| 414 | 414 | 'name' => TypeNameEnum::STRING, |
| 415 | 415 | 'description' => |
| 416 | 416 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
| 417 | 417 | 'character sequences. The String type is most often used by GraphQL to ' . |
| 418 | 418 | 'represent free-form human-readable text.', |
| 419 | - 'serialize' => function ($value) { |
|
| 419 | + 'serialize' => function($value) { |
|
| 420 | 420 | return coerceString($value); |
| 421 | 421 | }, |
| 422 | - 'parseValue' => function ($value) { |
|
| 422 | + 'parseValue' => function($value) { |
|
| 423 | 423 | return coerceString($value); |
| 424 | 424 | }, |
| 425 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 425 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 426 | 426 | /** @var StringValueNode $astNode */ |
| 427 | 427 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
| 428 | 428 | }, |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | protected function registerDirectives() |
| 437 | 437 | { |
| 438 | - $this->shared('GraphQLIncludeDirective', function () { |
|
| 438 | + $this->shared('GraphQLIncludeDirective', function() { |
|
| 439 | 439 | return GraphQLDirective([ |
| 440 | 440 | 'name' => 'include', |
| 441 | 441 | 'description' => |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | ]); |
| 456 | 456 | }); |
| 457 | 457 | |
| 458 | - $this->shared('GraphQLSkipDirective', function () { |
|
| 458 | + $this->shared('GraphQLSkipDirective', function() { |
|
| 459 | 459 | return GraphQLDirective([ |
| 460 | 460 | 'name' => 'skip', |
| 461 | 461 | 'description' => |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | ]); |
| 476 | 476 | }); |
| 477 | 477 | |
| 478 | - $this->shared('GraphQLDeprecatedDirective', function () { |
|
| 478 | + $this->shared('GraphQLDeprecatedDirective', function() { |
|
| 479 | 479 | return GraphQLDirective([ |
| 480 | 480 | 'name' => 'deprecated', |
| 481 | 481 | 'description' => 'Marks an element of a GraphQL schema as no longer supported.', |