@@ -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 | ); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function registerParser() |
178 | 178 | { |
179 | - $this->singleton(NodeBuilderInterface::class, function () { |
|
179 | + $this->singleton(NodeBuilderInterface::class, function() { |
|
180 | 180 | $builders = [ |
181 | 181 | // Standard |
182 | 182 | new ArgumentBuilder(), |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | ->singleton(ParserInterface::class, Parser::class) |
232 | 232 | ->addArgument(NodeBuilderInterface::class); |
233 | 233 | |
234 | - $this->container->add(LexerInterface::class, function () { |
|
234 | + $this->container->add(LexerInterface::class, function() { |
|
235 | 235 | $readers = [ |
236 | 236 | new AmpReader(), |
237 | 237 | new AtReader(), |
@@ -282,18 +282,18 @@ discard block |
||
282 | 282 | return (bool)$value; |
283 | 283 | } |
284 | 284 | |
285 | - $this->singleton('GraphQLBoolean', function () { |
|
285 | + $this->singleton('GraphQLBoolean', function() { |
|
286 | 286 | return GraphQLScalarType([ |
287 | 287 | 'name' => TypeNameEnum::BOOLEAN, |
288 | 288 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
289 | - 'serialize' => function ($value) { |
|
289 | + 'serialize' => function($value) { |
|
290 | 290 | return coerceBoolean($value); |
291 | 291 | }, |
292 | - 'parseValue' => function ($value) { |
|
292 | + 'parseValue' => function($value) { |
|
293 | 293 | return coerceBoolean($value); |
294 | 294 | }, |
295 | 295 | |
296 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
296 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
297 | 297 | /** @var BooleanValueNode $astNode */ |
298 | 298 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
299 | 299 | }, |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | throw new \TypeError(sprintf('Float cannot represent non numeric value: %s', $value)); |
319 | 319 | } |
320 | 320 | |
321 | - $this->singleton('GraphQLFloat', function () { |
|
321 | + $this->singleton('GraphQLFloat', function() { |
|
322 | 322 | return GraphQLScalarType([ |
323 | 323 | 'name' => TypeNameEnum::FLOAT, |
324 | 324 | 'description' => |
325 | 325 | 'The `Float` scalar type represents signed double-precision fractional ' . |
326 | 326 | 'values as specified by ' . |
327 | 327 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
328 | - 'serialize' => function ($value) { |
|
328 | + 'serialize' => function($value) { |
|
329 | 329 | return coerceFloat($value); |
330 | 330 | }, |
331 | - 'parseValue' => function ($value) { |
|
331 | + 'parseValue' => function($value) { |
|
332 | 332 | return coerceFloat($value); |
333 | 333 | }, |
334 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
334 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
335 | 335 | /** @var FloatValueNode $astNode */ |
336 | 336 | return in_array($astNode->getKind(), [NodeKindEnum::FLOAT, NodeKindEnum::INT], true) |
337 | 337 | ? $astNode->getValue() |
@@ -369,19 +369,19 @@ discard block |
||
369 | 369 | return $intValue; |
370 | 370 | } |
371 | 371 | |
372 | - $this->singleton('GraphQLInt', function () { |
|
372 | + $this->singleton('GraphQLInt', function() { |
|
373 | 373 | return GraphQLScalarType([ |
374 | 374 | 'name' => TypeNameEnum::INT, |
375 | 375 | 'description' => |
376 | 376 | 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
377 | 377 | 'values. Int can represent values between -(2^31) and 2^31 - 1.', |
378 | - 'serialize' => function ($value) { |
|
378 | + 'serialize' => function($value) { |
|
379 | 379 | return coerceInt($value); |
380 | 380 | }, |
381 | - 'parseValue' => function ($value) { |
|
381 | + 'parseValue' => function($value) { |
|
382 | 382 | return coerceInt($value); |
383 | 383 | }, |
384 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
384 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
385 | 385 | /** @var IntValueNode $astNode */ |
386 | 386 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
387 | 387 | }, |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | return (string)$value; |
415 | 415 | } |
416 | 416 | |
417 | - $this->singleton('GraphQLID', function () { |
|
417 | + $this->singleton('GraphQLID', function() { |
|
418 | 418 | return GraphQLScalarType([ |
419 | 419 | 'name' => TypeNameEnum::ID, |
420 | 420 | 'description' => |
@@ -423,13 +423,13 @@ discard block |
||
423 | 423 | 'response as a String; however, it is not intended to be human-readable. ' . |
424 | 424 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
425 | 425 | '(such as `4`) input value will be accepted as an ID.', |
426 | - 'serialize' => function ($value) { |
|
426 | + 'serialize' => function($value) { |
|
427 | 427 | return coerceString($value); |
428 | 428 | }, |
429 | - 'parseValue' => function ($value) { |
|
429 | + 'parseValue' => function($value) { |
|
430 | 430 | return coerceString($value); |
431 | 431 | }, |
432 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
432 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
433 | 433 | /** @var StringValueNode $astNode */ |
434 | 434 | return in_array($astNode->getKind(), [NodeKindEnum::STRING, NodeKindEnum::INT], true) |
435 | 435 | ? $astNode->getValue() |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | ]); |
439 | 439 | }); |
440 | 440 | |
441 | - $this->singleton('GraphQLString', function () { |
|
441 | + $this->singleton('GraphQLString', function() { |
|
442 | 442 | return GraphQLScalarType([ |
443 | 443 | 'name' => TypeNameEnum::STRING, |
444 | 444 | 'description' => |
445 | 445 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
446 | 446 | 'character sequences. The String type is most often used by GraphQL to ' . |
447 | 447 | 'represent free-form human-readable text.', |
448 | - 'serialize' => function ($value) { |
|
448 | + 'serialize' => function($value) { |
|
449 | 449 | return coerceString($value); |
450 | 450 | }, |
451 | - 'parseValue' => function ($value) { |
|
451 | + 'parseValue' => function($value) { |
|
452 | 452 | return coerceString($value); |
453 | 453 | }, |
454 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
454 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
455 | 455 | /** @var StringValueNode $astNode */ |
456 | 456 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
457 | 457 | }, |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | */ |
465 | 465 | protected function registerDirectives() |
466 | 466 | { |
467 | - $this->singleton('GraphQLIncludeDirective', function () { |
|
467 | + $this->singleton('GraphQLIncludeDirective', function() { |
|
468 | 468 | return GraphQLDirective([ |
469 | 469 | 'name' => 'include', |
470 | 470 | 'description' => |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | ]); |
485 | 485 | }); |
486 | 486 | |
487 | - $this->singleton('GraphQLSkipDirective', function () { |
|
487 | + $this->singleton('GraphQLSkipDirective', function() { |
|
488 | 488 | return GraphQLDirective([ |
489 | 489 | 'name' => 'skip', |
490 | 490 | 'description' => |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | ]); |
505 | 505 | }); |
506 | 506 | |
507 | - $this->singleton('GraphQLDeprecatedDirective', function () { |
|
507 | + $this->singleton('GraphQLDeprecatedDirective', function() { |
|
508 | 508 | return GraphQLDirective([ |
509 | 509 | 'name' => 'deprecated', |
510 | 510 | 'description' => 'Marks an element of a GraphQL schema as no longer supported.', |