Passed
Pull Request — master (#23)
by Christoffer
01:58
created
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.
src/Language/AST/Node/InputArgumentsTrait.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 getArgumentsAsArray(): 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->arguments);
32 32
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/SchemaDefinitionNode.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 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
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/ObjectValueNode.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
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         };
Please login to merge, or discard this patch.