Completed
Pull Request — master (#15)
by Christoffer
06:08 queued 03:44
created
src/Language/AST/Node/InputFieldsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Language/Parser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
          * @return mixed
497 497
          * @throws GraphQLError
498 498
          */
499
-        $parseType = function (LexerInterface $lexer) {
499
+        $parseType = function(LexerInterface $lexer) {
500 500
             $this->expect($lexer, TokenKindEnum::COLON);
501 501
             return $this->parseTypeReference($lexer);
502 502
         };
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
          * @return mixed
627 627
          * @throws GraphQLError
628 628
          */
629
-        $parseValue = function (LexerInterface $lexer) {
629
+        $parseValue = function(LexerInterface $lexer) {
630 630
             $this->expect($lexer, TokenKindEnum::COLON);
631 631
             return $this->parseValueLiteral($lexer, false);
632 632
         };
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
          * @return mixed
654 654
          * @throws GraphQLError
655 655
          */
656
-        $parseValue = function (LexerInterface $lexer) {
656
+        $parseValue = function(LexerInterface $lexer) {
657 657
             $this->expect($lexer, TokenKindEnum::COLON);
658 658
             return $this->parseConstValue($lexer);
659 659
         };
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 
717 717
         // TODO: Consider adding experimental support fragment variables
718 718
 
719
-        $parseTypeCondition = function (LexerInterface $lexer) {
719
+        $parseTypeCondition = function(LexerInterface $lexer) {
720 720
             $this->expectKeyword($lexer, 'on');
721 721
             return $this->parseNamedType($lexer);
722 722
         };
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
     {
913 913
         $start = $lexer->getToken();
914 914
 
915
-        $parseValue = function (LexerInterface $lexer, bool $isConst) {
915
+        $parseValue = function(LexerInterface $lexer, bool $isConst) {
916 916
             $this->expect($lexer, TokenKindEnum::COLON);
917 917
             return $this->parseValueLiteral($lexer, $isConst);
918 918
         };
Please login to merge, or discard this patch.
src/Type/scalars.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
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
     );
Please login to merge, or discard this patch.
src/GraphQL.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -231,14 +231,14 @@  discard block
 block discarded – undo
231 231
      */
232 232
     protected function registerParser()
233 233
     {
234
-        $this->shared(NodeBuilderInterface::class, function () {
234
+        $this->shared(NodeBuilderInterface::class, function() {
235 235
             return new NodeBuilder(self::getNodeBuilders());
236 236
         });
237 237
 
238 238
         $this->shared(ParserInterface::class, Parser::class)
239 239
             ->withArgument(NodeBuilderInterface::class);
240 240
 
241
-        $this->bind(LexerInterface::class, function () {
241
+        $this->bind(LexerInterface::class, function() {
242 242
             return new Lexer(self::getSourceReaders());
243 243
         });
244 244
     }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     {
256 256
         $this->shared(DefinitionBuilderInterface::class, DefinitionBuilder::class)
257 257
             ->withArguments([
258
-                function (NamedTypeNode $node) {
258
+                function(NamedTypeNode $node) {
259 259
                     throw new \Exception(sprintf('Type "%s" not found in document.', $node->getNameValue()));
260 260
                 },
261 261
                 CacheInterface::class,
@@ -284,18 +284,18 @@  discard block
 block discarded – undo
284 284
             return (bool)$value;
285 285
         }
286 286
 
287
-        $this->shared('GraphQLBoolean', function () {
287
+        $this->shared('GraphQLBoolean', function() {
288 288
             return GraphQLScalarType([
289 289
                 'name' => TypeNameEnum::BOOLEAN,
290 290
                 'description' => 'The `Boolean` scalar type represents `true` or `false`.',
291
-                'serialize' => function ($value) {
291
+                'serialize' => function($value) {
292 292
                     return coerceBoolean($value);
293 293
                 },
294
-                'parseValue' => function ($value) {
294
+                'parseValue' => function($value) {
295 295
                     return coerceBoolean($value);
296 296
                 },
297 297
 
298
-                'parseLiteral' => function (NodeInterface $astNode) {
298
+                'parseLiteral' => function(NodeInterface $astNode) {
299 299
                     /** @var BooleanValueNode $astNode */
300 300
                     return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null;
301 301
                 },
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
             throw new \TypeError(sprintf('Float cannot represent non numeric value: %s', $value));
321 321
         }
322 322
 
323
-        $this->shared('GraphQLFloat', function () {
323
+        $this->shared('GraphQLFloat', function() {
324 324
             return GraphQLScalarType([
325 325
                 'name' => TypeNameEnum::FLOAT,
326 326
                 'description' =>
327 327
                     'The `Float` scalar type represents signed double-precision fractional ' .
328 328
                     'values as specified by ' .
329 329
                     '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).',
330
-                'serialize' => function ($value) {
330
+                'serialize' => function($value) {
331 331
                     return coerceFloat($value);
332 332
                 },
333
-                'parseValue' => function ($value) {
333
+                'parseValue' => function($value) {
334 334
                     return coerceFloat($value);
335 335
                 },
336
-                'parseLiteral' => function (NodeInterface $astNode) {
336
+                'parseLiteral' => function(NodeInterface $astNode) {
337 337
                     /** @var FloatValueNode $astNode */
338 338
                     return in_array($astNode->getKind(), [NodeKindEnum::FLOAT, NodeKindEnum::INT], true)
339 339
                         ? $astNode->getValue()
@@ -371,19 +371,19 @@  discard block
 block discarded – undo
371 371
             return $intValue;
372 372
         }
373 373
 
374
-        $this->shared('GraphQLInt', function () {
374
+        $this->shared('GraphQLInt', function() {
375 375
             return GraphQLScalarType([
376 376
                 'name' => TypeNameEnum::INT,
377 377
                 'description' =>
378 378
                     'The `Int` scalar type represents non-fractional signed whole numeric ' .
379 379
                     'values. Int can represent values between -(2^31) and 2^31 - 1.',
380
-                'serialize' => function ($value) {
380
+                'serialize' => function($value) {
381 381
                     return coerceInt($value);
382 382
                 },
383
-                'parseValue' => function ($value) {
383
+                'parseValue' => function($value) {
384 384
                     return coerceInt($value);
385 385
                 },
386
-                'parseLiteral' => function (NodeInterface $astNode) {
386
+                'parseLiteral' => function(NodeInterface $astNode) {
387 387
                     /** @var IntValueNode $astNode */
388 388
                     return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null;
389 389
                 },
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             return (string)$value;
417 417
         }
418 418
 
419
-        $this->shared('GraphQLID', function () {
419
+        $this->shared('GraphQLID', function() {
420 420
             return GraphQLScalarType([
421 421
                 'name' => TypeNameEnum::ID,
422 422
                 'description' =>
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
                     'response as a String; however, it is not intended to be human-readable. ' .
426 426
                     'When expected as an input type, any string (such as `"4"`) or integer ' .
427 427
                     '(such as `4`) input value will be accepted as an ID.',
428
-                'serialize' => function ($value) {
428
+                'serialize' => function($value) {
429 429
                     return coerceString($value);
430 430
                 },
431
-                'parseValue' => function ($value) {
431
+                'parseValue' => function($value) {
432 432
                     return coerceString($value);
433 433
                 },
434
-                'parseLiteral' => function (NodeInterface $astNode) {
434
+                'parseLiteral' => function(NodeInterface $astNode) {
435 435
                     /** @var StringValueNode $astNode */
436 436
                     return in_array($astNode->getKind(), [NodeKindEnum::STRING, NodeKindEnum::INT], true)
437 437
                         ? $astNode->getValue()
@@ -440,20 +440,20 @@  discard block
 block discarded – undo
440 440
             ]);
441 441
         });
442 442
 
443
-        $this->shared('GraphQLString', function () {
443
+        $this->shared('GraphQLString', function() {
444 444
             return GraphQLScalarType([
445 445
                 'name' => TypeNameEnum::STRING,
446 446
                 'description' =>
447 447
                     'The `String` scalar type represents textual data, represented as UTF-8 ' .
448 448
                     'character sequences. The String type is most often used by GraphQL to ' .
449 449
                     'represent free-form human-readable text.',
450
-                'serialize' => function ($value) {
450
+                'serialize' => function($value) {
451 451
                     return coerceString($value);
452 452
                 },
453
-                'parseValue' => function ($value) {
453
+                'parseValue' => function($value) {
454 454
                     return coerceString($value);
455 455
                 },
456
-                'parseLiteral' => function (NodeInterface $astNode) {
456
+                'parseLiteral' => function(NodeInterface $astNode) {
457 457
                     /** @var StringValueNode $astNode */
458 458
                     return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null;
459 459
                 },
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
      */
467 467
     protected function registerDirectives()
468 468
     {
469
-        $this->shared('GraphQLIncludeDirective', function () {
469
+        $this->shared('GraphQLIncludeDirective', function() {
470 470
             return GraphQLDirective([
471 471
                 'name' => 'include',
472 472
                 'description' =>
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             ]);
487 487
         });
488 488
 
489
-        $this->shared('GraphQLSkipDirective', function () {
489
+        $this->shared('GraphQLSkipDirective', function() {
490 490
             return GraphQLDirective([
491 491
                 'name' => 'skip',
492 492
                 'description' =>
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
             ]);
507 507
         });
508 508
 
509
-        $this->shared('GraphQLDeprecatedDirective', function () {
509
+        $this->shared('GraphQLDeprecatedDirective', function() {
510 510
             return GraphQLDirective([
511 511
                 'name' => 'deprecated',
512 512
                 'description' => 'Marks an element of a GraphQL schema as no longer supported.',
Please login to merge, or discard this patch.
src/Cache/RuntimeCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
      */
60 60
     public function getMultiple($keys, $default = null)
61 61
     {
62
-        return array_filter($this->cache, function ($key) use ($keys) {
62
+        return array_filter($this->cache, function($key) use ($keys) {
63 63
             return \in_array($key, $keys, true);
64 64
         }, ARRAY_FILTER_USE_KEY);
65 65
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/ArgumentsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function getArgumentsAsArray(): 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->getArguments());
39 39
     }
Please login to merge, or discard this patch.