Completed
Pull Request — master (#15)
by Christoffer
06:33 queued 01:55
created
src/Language/AST/Schema/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/Util/helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function arraySome(array $array, callable $fn)
25 25
 {
26
-    return array_reduce($array, function ($result, $value) use ($fn) {
26
+    return array_reduce($array, function($result, $value) use ($fn) {
27 27
         return $result || $fn($value);
28 28
     });
29 29
 }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function keyMap(array $array, callable $keyFn): array
37 37
 {
38
-    return array_reduce($array, function ($map, $item) use ($keyFn) {
38
+    return array_reduce($array, function($map, $item) use ($keyFn) {
39 39
         $map[$keyFn($item)] = $item;
40 40
         return $map;
41 41
     }, []);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function keyValMap(array $array, callable $keyFn, callable $valFn): array
51 51
 {
52
-    return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) {
52
+    return array_reduce($array, function($map, $item) use ($keyFn, $valFn) {
53 53
         $map[$keyFn($item)] = $valFn($item);
54 54
         return $map;
55 55
     }, []);
Please login to merge, or discard this patch.
src/Language/AST/Schema/DefinitionBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         $builtInTypes = keyMap(
78 78
             array_merge(specifiedScalarTypes()/*, introspectionTypes()*/),
79
-            function (NamedTypeInterface $type) {
79
+            function(NamedTypeInterface $type) {
80 80
                 return $type->getName();
81 81
             }
82 82
         );
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         return GraphQLDirective([
130 130
             'name'        => $node->getNameValue(),
131 131
             'description' => $node->getDescriptionValue(),
132
-            'locations'   => array_map(function (NameNode $node) {
132
+            'locations'   => array_map(function(NameNode $node) {
133 133
                 return $node->getValue();
134 134
             }, $node->getLocations()),
135 135
             'arguments'   => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
     {
175 175
         return keyValMap(
176 176
             $nodes,
177
-            function (InputValueDefinitionNode $value) {
177
+            function(InputValueDefinitionNode $value) {
178 178
                 return $value->getNameValue();
179 179
             },
180
-            function (InputValueDefinitionNode $value): array {
180
+            function(InputValueDefinitionNode $value): array {
181 181
                 $type = $this->buildWrappedType($value->getType());
182 182
                 return [
183 183
                     'type'         => $type,
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
         return GraphQLObjectType([
227 227
             'name'        => $node->getNameValue(),
228 228
             'description' => $node->getDescriptionValue(),
229
-            'fields'      => function () use ($node) {
229
+            'fields'      => function() use ($node) {
230 230
                 return $this->buildFields($node);
231 231
             },
232
-            'interfaces'  => function () use ($node) {
233
-                return $node->hasInterfaces() ? array_map(function (InterfaceTypeDefinitionNode $interface) {
232
+            'interfaces'  => function() use ($node) {
233
+                return $node->hasInterfaces() ? array_map(function(InterfaceTypeDefinitionNode $interface) {
234 234
                     return $this->buildType($interface);
235 235
                 }, $node->getInterfaces()) : [];
236 236
             },
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
     {
246 246
         return $node->hasFields() ? keyValMap(
247 247
             $node->getFields(),
248
-            function ($value) {
248
+            function($value) {
249 249
                 return $value->getNameValue();
250 250
             },
251
-            function ($value) {
251
+            function($value) {
252 252
                 return $this->buildField($value);
253 253
             }
254 254
         ) : [];
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         return GraphQLInterfaceType([
264 264
             'name'        => $node->getNameValue(),
265 265
             'description' => $node->getDescriptionValue(),
266
-            'fields'      => function () use ($node): array {
266
+            'fields'      => function() use ($node): array {
267 267
                 return $this->buildFields($node);
268 268
             },
269 269
             'astNode'     => $node,
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
             'description' => $node->getDescriptionValue(),
282 282
             'values'      => $node->hasValues() ? keyValMap(
283 283
                 $node->getValues(),
284
-                function (EnumValueDefinitionNode $value): string {
284
+                function(EnumValueDefinitionNode $value): string {
285 285
                     return $value->getNameValue();
286 286
                 },
287
-                function (EnumValueDefinitionNode $value): array {
287
+                function(EnumValueDefinitionNode $value): array {
288 288
                     return [
289 289
                         'description'       => $value->getDescriptionValue(),
290 290
                         'deprecationReason' => getDeprecationReason($value),
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         return GraphQLUnionType([
302 302
             'name'        => $node->getNameValue(),
303 303
             'description' => $node->getDescriptionValue(),
304
-            'types'       => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) {
304
+            'types'       => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) {
305 305
                 return $this->buildType($type);
306 306
             }, $node->getTypes()) : [],
307 307
             'astNode'     => $node,
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         return GraphQLScalarType([
318 318
             'name'        => $node->getNameValue(),
319 319
             'description' => $node->getDescriptionValue(),
320
-            'serialize'   => function ($value) {
320
+            'serialize'   => function($value) {
321 321
                 return $value;
322 322
             },
323 323
             'astNode'     => $node,
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
             'description' => $node->getDescriptionValue(),
336 336
             'fields'      => $node->hasFields() ? keyValMap(
337 337
                 $node->getFields(),
338
-                function (InputValueDefinitionNode $value): string {
338
+                function(InputValueDefinitionNode $value): string {
339 339
                     return $value->getNameValue();
340 340
                 },
341
-                function (InputValueDefinitionNode $value): array {
341
+                function(InputValueDefinitionNode $value): array {
342 342
                     $type = $this->buildWrappedType($value->getType());
343 343
                     return [
344 344
                         'type'         => $type,
Please login to merge, or discard this patch.
src/Execution/values.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         return $coercedValues;
36 36
     }
37 37
 
38
-    $argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) {
38
+    $argumentNodeMap = keyMap($argumentNodes, function(ArgumentNode $value) {
39 39
         return $value->getNameValue();
40 40
     });
41 41
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 function getDirectiveValues(DirectiveInterface $directive, NodeInterface $node, array $variableValues = []): ?array
106 106
 {
107 107
     $directiveNode = $node->hasDirectives()
108
-        ? find($node->getDirectives(), function (NamedTypeNode $value) use ($directive) {
108
+        ? find($node->getDirectives(), function(NamedTypeNode $value) use ($directive) {
109 109
             return $value->getNameValue() === $directive->getName();
110 110
         }) : null;
111 111
 
Please login to merge, or discard this patch.
src/Util/valueFromAST.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
         $coercedObject = [];
102 102
 
103 103
         /** @var ObjectFieldNode[] $fieldNodes */
104
-        $fieldNodes = keyMap($node->getFields(), function (FieldNode $value) {
104
+        $fieldNodes = keyMap($node->getFields(), function(FieldNode $value) {
105 105
             return $value->getNameValue();
106 106
         });
107 107
 
Please login to merge, or discard this patch.
src/Language/AST/Node/EnumValuesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function getValuesAsArray(): array
34 34
     {
35
-        return array_map(function (SerializationInterface $node) {
35
+        return array_map(function(SerializationInterface $node) {
36 36
             return $node->toArray();
37 37
         }, $this->values);
38 38
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/TypesTrait.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 getTypesAsArray(): 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->types);
32 32
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/InterfacesTrait.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 getInterfacesAsArray(): 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->interfaces);
32 32
     }
Please login to merge, or discard this patch.
src/Language/AST/Node/VariableDefinitionsTrait.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 getVariableDefinitionsAsArray(): 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->variableDefinitions);
32 32
     }
Please login to merge, or discard this patch.