Completed
Pull Request — master (#258)
by Sam
05:12
created
src/Schema/utils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
 function printLines(array $lines): string
75 75
 {
76 76
     // Don't print empty lines
77
-    $lines = \array_filter($lines, function (string $line) {
77
+    $lines = \array_filter($lines, function(string $line) {
78 78
         return $line !== '';
79 79
     });
80 80
     
Please login to merge, or discard this patch.
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 (TypeInterface $type): bool {
52
+            function(TypeInterface $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 (TypeInterface $type): bool {
72
+            function(TypeInterface $type): bool {
73 73
                 return isIntrospectionType($type);
74 74
             }
75 75
         );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         $types = \array_filter(\array_values($schema->getTypeMap()), $filter);
137 137
 
138
-        \usort($types, function (NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
138
+        \usort($types, function(NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
139 139
             return \strcasecmp($typeA->getName(), $typeB->getName());
140 140
         });
141 141
 
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
         $description = $this->printDescription($type);
262 262
         $name        = $type->getName();
263 263
         $implements  = $type->hasInterfaces()
264
-            ? ' implements ' . printArray(' & ', \array_map(function (InterfaceType $interface) {
264
+            ? ' implements ' . printArray(' & ', \array_map(function(InterfaceType $interface) {
265 265
                 return $interface->getName();
266 266
             }, $type->getInterfaces()))
267 267
             : '';
268
-        $fields      = $this->printFields($type->getFields());
268
+        $fields = $this->printFields($type->getFields());
269 269
 
270 270
         return printLines([
271 271
             $description,
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
     protected function printEnumValues(array $values): string
331 331
     {
332
-        return printLines(\array_map(function (EnumValue $value): string {
332
+        return printLines(\array_map(function(EnumValue $value): string {
333 333
             $description = $this->printDescription($value, '  ');
334 334
             $name        = $value->getName();
335 335
             $deprecated  = $this->printDeprecated($value);
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     protected function printInputObjectType(InputObjectType $type): string
351 351
     {
352 352
         $description = $this->printDescription($type);
353
-        $fields      = \array_map(function (InputField $field): string {
353
+        $fields      = \array_map(function(InputField $field): string {
354 354
             $description = $this->printDescription($field, '  ');
355 355
             $inputValue  = $this->printInputValue($field);
356 356
             return printLines([
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      */
389 389
     protected function printFields(array $fields): string
390 390
     {
391
-        return printLines(\array_map(function (Field $field): string {
391
+        return printLines(\array_map(function(Field $field): string {
392 392
             $description = $this->printDescription($field);
393 393
             $name        = $field->getName();
394 394
             $arguments   = $this->printArguments($field->getArguments());
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
         }
409 409
 
410 410
         // If every arg does not have a description, print them on one line.
411
-        if (arrayEvery($arguments, function (Argument $argument): bool {
411
+        if (arrayEvery($arguments, function(Argument $argument): bool {
412 412
             return !$argument->hasDescription();
413 413
         })) {
414
-            return printInputFields(\array_map(function (Argument $argument) {
414
+            return printInputFields(\array_map(function(Argument $argument) {
415 415
                 return $this->printInputValue($argument);
416 416
             }, $arguments));
417 417
         }
418 418
 
419
-        $args = \array_map(function (Argument $argument) use ($indentation) {
419
+        $args = \array_map(function(Argument $argument) use ($indentation) {
420 420
             $description = $this->printDescription($argument);
421 421
             $inputValue  = $this->printInputValue($argument);
422 422
             return printLines([
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
      */
542 542
     protected function printMany(array $definitions): array
543 543
     {
544
-        return \array_map(function ($definition) {
544
+        return \array_map(function($definition) {
545 545
             return $this->print($definition);
546 546
         }, $definitions);
547 547
     }
Please login to merge, or discard this patch.