Passed
Pull Request — master (#347)
by Christoffer
06:07
created
src/Schema/DefinitionPrinter.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
         return $this->printFilteredSchema(
48 48
             $schema,
49
-            function (Directive $directive): bool {
49
+            function(Directive $directive): bool {
50 50
                 return !isSpecifiedDirective($directive);
51 51
             },
52
-            function (NamedTypeInterface $type): bool {
52
+            function(NamedTypeInterface $type): bool {
53 53
                 return !isSpecifiedScalarType($type) && !isIntrospectionType($type);
54 54
             }
55 55
         );
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 
67 67
         return $this->printFilteredSchema(
68 68
             $schema,
69
-            function (Directive $directive): bool {
69
+            function(Directive $directive): bool {
70 70
                 return isSpecifiedDirective($directive);
71 71
             },
72
-            function (NamedTypeInterface $type): bool {
72
+            function(NamedTypeInterface $type): bool {
73 73
                 return isIntrospectionType($type);
74 74
             }
75 75
         );
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $types = \array_filter(\array_values($schema->getTypeMap()), $filter);
142 142
 
143
-        \usort($types, function (NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
143
+        \usort($types, function(NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
144 144
             return \strcasecmp($typeA->getName(), $typeB->getName());
145 145
         });
146 146
 
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
         $description = $this->printDescription($type);
284 284
         $name        = $type->getName();
285 285
         $implements  = $type->hasInterfaces()
286
-            ? ' implements ' . printArray(' & ', \array_map(function (InterfaceType $interface) {
286
+            ? ' implements ' . printArray(' & ', \array_map(function(InterfaceType $interface) {
287 287
                 return $interface->getName();
288 288
             }, $type->getInterfaces()))
289 289
             : '';
290
-        $fields      = $this->printFields($type->getFields());
290
+        $fields = $this->printFields($type->getFields());
291 291
 
292 292
         return printLines([
293 293
             $description,
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
     protected function printEnumValues(array $values): string
353 353
     {
354
-        return printLines(\array_map(function (EnumValue $value): string {
354
+        return printLines(\array_map(function(EnumValue $value): string {
355 355
             $description = $this->printDescription($value, '  ');
356 356
             $name        = $value->getName();
357 357
             $deprecated  = $this->printDeprecated($value);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
     protected function printInputObjectType(InputObjectType $type): string
373 373
     {
374 374
         $description = $this->printDescription($type);
375
-        $fields      = \array_map(function (InputField $field): string {
375
+        $fields      = \array_map(function(InputField $field): string {
376 376
             $description = $this->printDescription($field, '  ');
377 377
             $inputValue  = $this->printInputValue($field);
378 378
             return printLines([
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      */
417 417
     protected function printFields(array $fields): string
418 418
     {
419
-        return printLines(\array_map(function (Field $field): string {
419
+        return printLines(\array_map(function(Field $field): string {
420 420
             $description = $this->printDescription($field, '  ');
421 421
             $name        = $field->getName();
422 422
             $arguments   = $this->printArguments($field->getArguments());
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
         }
442 442
 
443 443
         // If every arg does not have a description, print them on one line.
444
-        if (arrayEvery($arguments, function (Argument $argument): bool {
444
+        if (arrayEvery($arguments, function(Argument $argument): bool {
445 445
             return !$argument->hasDescription();
446 446
         })) {
447
-            return printInputFields(\array_map(function (Argument $argument) {
447
+            return printInputFields(\array_map(function(Argument $argument) {
448 448
                 return $this->printInputValue($argument);
449 449
             }, $arguments));
450 450
         }
451 451
 
452
-        $args = \array_map(function (Argument $argument) use ($indentation) {
452
+        $args = \array_map(function(Argument $argument) use ($indentation) {
453 453
             $description = $this->printDescription($argument, '  ');
454 454
             $inputValue  = $this->printInputValue($argument);
455 455
             return printLines([
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
      */
590 590
     protected function printMany(array $definitions): array
591 591
     {
592
-        return \array_map(function ($definition) {
592
+        return \array_map(function($definition) {
593 593
             return $this->print($definition);
594 594
         }, $definitions);
595 595
     }
Please login to merge, or discard this patch.
src/Schema/utils.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     $rawLines = \explode("\n", $description);
13 13
 
14
-    return \array_merge(...\array_map(function (string $line) use ($maxLength) {
14
+    return \array_merge(...\array_map(function(string $line) use ($maxLength) {
15 15
         if (\strlen($line) < ($maxLength + 5)) {
16 16
             return [$line];
17 17
         }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         return [$line];
35 35
     }
36 36
 
37
-    $endPos     = $maxLength - 40;
37
+    $endPos = $maxLength - 40;
38 38
     return \array_map('trim', \preg_split(
39 39
         "/((?: |^).{15,{$endPos}}(?= |$))/",
40 40
         $line,
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 function printLines(array $lines): string
74 74
 {
75 75
     // Don't print empty lines
76
-    $lines = \array_filter($lines, function (string $line) {
76
+    $lines = \array_filter($lines, function(string $line) {
77 77
         return $line !== '';
78 78
     });
79 79
 
Please login to merge, or discard this patch.