Passed
Pull Request — master (#116)
by Christoffer
04:29 queued 01:51
created
src/Language/SchemaBuilder/SchemaBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,27 +78,27 @@
 block discarded – undo
78 78
 
79 79
         $this->definitionBuilder->setTypeDefinitionMap($nodeMap);
80 80
 
81
-        $types = array_map(function (TypeDefinitionNodeInterface $definition) {
81
+        $types = array_map(function(TypeDefinitionNodeInterface $definition) {
82 82
             return $this->definitionBuilder->buildType($definition);
83 83
         }, $typeDefinitions);
84 84
 
85
-        $directives = array_map(function (DirectiveDefinitionNode $definition) {
85
+        $directives = array_map(function(DirectiveDefinitionNode $definition) {
86 86
             return $this->definitionBuilder->buildDirective($definition);
87 87
         }, $directiveDefinitions);
88 88
 
89
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
89
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
90 90
             return $directive->getName() === 'skip';
91 91
         })) {
92 92
             $directives[] = GraphQLSkipDirective();
93 93
         }
94 94
 
95
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
95
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
96 96
             return $directive->getName() === 'include';
97 97
         })) {
98 98
             $directives[] = GraphQLIncludeDirective();
99 99
         }
100 100
 
101
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
101
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
102 102
             return $directive->getName() === 'deprecated';
103 103
         })) {
104 104
             $directives[] = GraphQLDeprecatedDirective();
Please login to merge, or discard this patch.
src/Validation/Conflict/FindsConflictsTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -691,13 +691,13 @@
 block discarded – undo
691 691
 
692 692
         return new Conflict(
693 693
             $responseName,
694
-            array_map(function (Conflict $conflict) {
694
+            array_map(function(Conflict $conflict) {
695 695
                 return [$conflict->getResponseName(), $conflict->getReason()];
696 696
             }, $conflicts),
697
-            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
697
+            array_reduce($conflicts, function($allFields, Conflict $conflict) {
698 698
                 return array_merge($allFields, $conflict->getFieldsA());
699 699
             }, [$nodeA]),
700
-            array_reduce($conflicts, function ($allFields, Conflict $conflict) {
700
+            array_reduce($conflicts, function($allFields, Conflict $conflict) {
701 701
                 return array_merge($allFields, $conflict->getFieldsB());
702 702
             }, [$nodeB])
703 703
         );
Please login to merge, or discard this patch.
src/Validation/messages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@
 block discarded – undo
218 218
         return conflictReasonMessage([$reason]);
219 219
     }
220 220
 
221
-    return implode(' and ', array_map(function ($reason) {
221
+    return implode(' and ', array_map(function($reason) {
222 222
         [$responseName, $subreason] = $reason;
223 223
         return sprintf('subfields "%s" conflict because %s', $responseName, conflictReasonMessage($subreason));
224 224
     }, $reason));
Please login to merge, or discard this patch.
src/Type/Schema.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function getDirective(string $name): ?Directive
127 127
     {
128
-        return find($this->directives, function (Directive $directive) use ($name) {
128
+        return find($this->directives, function(Directive $directive) use ($name) {
129 129
             return $directive->getName() === $name;
130 130
         });
131 131
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 )
178 178
             );
179 179
 
180
-            $this->_possibleTypeMap[$abstractTypeName] = array_reduce($possibleTypes, function (array $map, TypeInterface $type) {
180
+            $this->_possibleTypeMap[$abstractTypeName] = array_reduce($possibleTypes, function(array $map, TypeInterface $type) {
181 181
                 $map[$type->getName()] = true;
182 182
                 return $map;
183 183
             }, []);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     if ($type instanceof ObjectType || $type instanceof InterfaceType) {
389 389
         foreach ($type->getFields() as $field) {
390 390
             if ($field->hasArguments()) {
391
-                $fieldArgTypes = array_map(function (Argument $argument) {
391
+                $fieldArgTypes = array_map(function(Argument $argument) {
392 392
                     return $argument->getType();
393 393
                 }, $field->getArguments());
394 394
 
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         return $map;
420 420
     }
421 421
 
422
-    return array_reduce($directive->getArguments(), function ($map, Argument $argument) {
422
+    return array_reduce($directive->getArguments(), function($map, Argument $argument) {
423 423
         return typeMapReducer($map, $argument->getType());
424 424
     }, $map);
425 425
 }
Please login to merge, or discard this patch.
src/Language/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
  */
147 147
 function locationsShorthandToArray(array $locations): array
148 148
 {
149
-    return array_map(function ($shorthand) {
149
+    return array_map(function($shorthand) {
150 150
         return locationShorthandToArray($shorthand);
151 151
     }, $locations);
152 152
 }
Please login to merge, or discard this patch.
src/Util/TypeComparator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
                 // If both types are abstract, then determine if there is any intersection
93 93
                 // between possible concrete types of each.
94 94
                 return arraySome($schema->getPossibleTypes($typeA),
95
-                    function (TypeInterface $type) use ($schema, $typeB) {
95
+                    function(TypeInterface $type) use ($schema, $typeB) {
96 96
                         return $schema->isPossibleType($typeB, $type);
97 97
                     });
98 98
             }
Please login to merge, or discard this patch.
src/Util/orList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     return $count === 1
20 20
         ? $selected[0]
21
-        : array_reduce($selected, function ($list, $item) use ($count, &$index) {
21
+        : array_reduce($selected, function($list, $item) use ($count, &$index) {
22 22
             $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') .
23 23
                 $item;
24 24
             $index++;
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  */
35 35
 function quotedOrList(array $items): string
36 36
 {
37
-    return orList(array_map(function ($item) {
37
+    return orList(array_map(function($item) {
38 38
         return '"' . $item . '"';
39 39
     }, $items));
40 40
 }
Please login to merge, or discard this patch.
src/Util/suggestionList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     $result = \array_keys($optionsByDistance);
27 27
 
28
-    \usort($result, function ($a, $b) use ($optionsByDistance) {
28
+    \usort($result, function($a, $b) use ($optionsByDistance) {
29 29
         return $optionsByDistance[$a] - $optionsByDistance[$b];
30 30
     });
31 31
 
Please login to merge, or discard this patch.
src/Validation/Rule/ValuesOfCorrectTypeRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         // Ensure every required field exists.
116 116
         $inputFields  = $type->getFields();
117
-        $fieldNodeMap = keyMap($node->getFields(), function (ObjectFieldNode $field) {
117
+        $fieldNodeMap = keyMap($node->getFields(), function(ObjectFieldNode $field) {
118 118
             return $field->getNameValue();
119 119
         });
120 120
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     protected function getEnumTypeSuggestion(NamedTypeInterface $type, ValueNodeInterface $node): ?string
262 262
     {
263 263
         if ($type instanceof EnumType) {
264
-            $suggestions = suggestionList(printNode($node), \array_map(function (EnumValue $value) {
264
+            $suggestions = suggestionList(printNode($node), \array_map(function(EnumValue $value) {
265 265
                 return $value->getName();
266 266
             }, $type->getValues()));
267 267
 
Please login to merge, or discard this patch.