Passed
Pull Request — master (#132)
by Christoffer
02:47
created
src/SchemaBuilder/DefinitionBuilder.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         $builtInTypes = keyMap(
99 99
             \array_merge(specifiedScalarTypes(), introspectionTypes()),
100
-            function (NamedTypeInterface $type) {
100
+            function(NamedTypeInterface $type) {
101 101
                 return $type->getName();
102 102
             }
103 103
         );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         return GraphQLDirective([
160 160
             'name'        => $node->getNameValue(),
161 161
             'description' => $node->getDescriptionValue(),
162
-            'locations'   => \array_map(function (NameNode $node) {
162
+            'locations'   => \array_map(function(NameNode $node) {
163 163
                 return $node->getValue();
164 164
             }, $node->getLocations()),
165 165
             'args'        => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -208,10 +208,10 @@  discard block
 block discarded – undo
208 208
     {
209 209
         return keyValueMap(
210 210
             $nodes,
211
-            function (InputValueDefinitionNode $value) {
211
+            function(InputValueDefinitionNode $value) {
212 212
                 return $value->getNameValue();
213 213
             },
214
-            function (InputValueDefinitionNode $value): array {
214
+            function(InputValueDefinitionNode $value): array {
215 215
                 $type         = $this->buildWrappedType($value->getType());
216 216
                 $defaultValue = $value->getDefaultValue();
217 217
                 return [
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
         return GraphQLObjectType([
264 264
             'name'        => $node->getNameValue(),
265 265
             'description' => $node->getDescriptionValue(),
266
-            'fields'      => function () use ($node) {
266
+            'fields'      => function() use ($node) {
267 267
                 return $this->buildFields($node);
268 268
             },
269
-            'interfaces'  => function () use ($node) {
270
-                return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) {
269
+            'interfaces'  => function() use ($node) {
270
+                return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) {
271 271
                     return $this->buildType($interface);
272 272
                 }, $node->getInterfaces()) : [];
273 273
             },
@@ -284,11 +284,11 @@  discard block
 block discarded – undo
284 284
 
285 285
         return $node->hasFields() ? keyValueMap(
286 286
             $node->getFields(),
287
-            function ($value) {
287
+            function($value) {
288 288
                 /** @noinspection PhpUndefinedMethodInspection */
289 289
                 return $value->getNameValue();
290 290
             },
291
-            function ($value) use ($resolverMap) {
291
+            function($value) use ($resolverMap) {
292 292
                 return $this->buildField($value, $resolverMap);
293 293
             }
294 294
         ) : [];
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         return GraphQLInterfaceType([
304 304
             'name'        => $node->getNameValue(),
305 305
             'description' => $node->getDescriptionValue(),
306
-            'fields'      => function () use ($node): array {
306
+            'fields'      => function() use ($node): array {
307 307
                 return $this->buildFields($node);
308 308
             },
309 309
             'astNode'     => $node,
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
             'description' => $node->getDescriptionValue(),
322 322
             'values'      => $node->hasValues() ? keyValueMap(
323 323
                 $node->getValues(),
324
-                function (EnumValueDefinitionNode $value): string {
324
+                function(EnumValueDefinitionNode $value): string {
325 325
                     return $value->getNameValue();
326 326
                 },
327
-                function (EnumValueDefinitionNode $value): array {
327
+                function(EnumValueDefinitionNode $value): array {
328 328
                     return [
329 329
                         'description'       => $value->getDescriptionValue(),
330 330
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         return GraphQLUnionType([
346 346
             'name'        => $node->getNameValue(),
347 347
             'description' => $node->getDescriptionValue(),
348
-            'types'       => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) {
348
+            'types'       => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) {
349 349
                 return $this->buildType($type);
350 350
             }, $node->getTypes()) : [],
351 351
             'astNode'     => $node,
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         return GraphQLScalarType([
362 362
             'name'        => $node->getNameValue(),
363 363
             'description' => $node->getDescriptionValue(),
364
-            'serialize'   => function ($value) {
364
+            'serialize'   => function($value) {
365 365
                 return $value;
366 366
             },
367 367
             'astNode'     => $node,
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
         return GraphQLInputObjectType([
378 378
             'name'        => $node->getNameValue(),
379 379
             'description' => $node->getDescriptionValue(),
380
-            'fields'      => $node->hasFields() ? function () use ($node) {
380
+            'fields'      => $node->hasFields() ? function() use ($node) {
381 381
                 return keyValueMap(
382 382
                     $node->getFields(),
383
-                    function (InputValueDefinitionNode $value): string {
383
+                    function(InputValueDefinitionNode $value): string {
384 384
                         return $value->getNameValue();
385 385
                     },
386
-                    function (InputValueDefinitionNode $value): array {
386
+                    function(InputValueDefinitionNode $value): array {
387 387
                         $type = $this->buildWrappedType($value->getType());
388 388
                         return [
389 389
                             'type'         => $type,
Please login to merge, or discard this patch.