Passed
Pull Request — master (#215)
by Christoffer
03:40
created
src/Schema/DefinitionBuilder.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function buildTypes(array $nodes): array
110 110
     {
111
-        return \array_map(function (NodeInterface $node) {
111
+        return \array_map(function(NodeInterface $node) {
112 112
             return $this->buildType($node);
113 113
         }, $nodes);
114 114
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             $directive = newDirective([
150 150
                 'name'        => $node->getNameValue(),
151 151
                 'description' => $node->getDescriptionValue(),
152
-                'locations'   => \array_map(function (NameNode $node) {
152
+                'locations'   => \array_map(function(NameNode $node) {
153 153
                     return $node->getValue();
154 154
                 }, $node->getLocations()),
155 155
                 'args'        => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     {
221 221
         $typesMap = keyMap(
222 222
             \array_merge($customDirectives, specifiedScalarTypes(), introspectionTypes()),
223
-            function (NamedTypeInterface $type) {
223
+            function(NamedTypeInterface $type) {
224 224
                 return $type->getName();
225 225
             }
226 226
         );
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     {
239 239
         $directivesMap = keyMap(
240 240
             \array_merge($customDirectives, specifiedDirectives()),
241
-            function (Directive $directive) {
241
+            function(Directive $directive) {
242 242
                 return $directive->getName();
243 243
             }
244 244
         );
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
     {
258 258
         return keyValueMap(
259 259
             $nodes,
260
-            function (InputValueDefinitionNode $value) {
260
+            function(InputValueDefinitionNode $value) {
261 261
                 return $value->getNameValue();
262 262
             },
263
-            function (InputValueDefinitionNode $value): array {
263
+            function(InputValueDefinitionNode $value): array {
264 264
                 $type         = $this->buildWrappedType($value->getType());
265 265
                 $defaultValue = $value->getDefaultValue();
266 266
                 return [
@@ -312,14 +312,14 @@  discard block
 block discarded – undo
312 312
         return newObjectType([
313 313
             'name'        => $node->getNameValue(),
314 314
             'description' => $node->getDescriptionValue(),
315
-            'fields'      => $node->hasFields() ? function () use ($node) {
315
+            'fields'      => $node->hasFields() ? function() use ($node) {
316 316
                 return $this->buildFields($node);
317 317
             } : [],
318 318
             // Note: While this could make early assertions to get the correctly
319 319
             // typed values, that would throw immediately while type system
320 320
             // validation with validateSchema() will produce more actionable results.
321
-            'interfaces'  => function () use ($node) {
322
-                return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) {
321
+            'interfaces'  => function() use ($node) {
322
+                return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) {
323 323
                     return $this->buildType($interface);
324 324
                 }, $node->getInterfaces()) : [];
325 325
             },
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
     {
336 336
         return keyValueMap(
337 337
             $node->getFields(),
338
-            function ($value) {
338
+            function($value) {
339 339
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
340 340
                 return $value->getNameValue();
341 341
             },
342
-            function ($value) use ($node) {
342
+            function($value) use ($node) {
343 343
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
344 344
                 return $this->buildField($value,
345 345
                     $this->getFieldResolver($node->getNameValue(), $value->getNameValue()));
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         return newInterfaceType([
369 369
             'name'        => $node->getNameValue(),
370 370
             'description' => $node->getDescriptionValue(),
371
-            'fields'      => $node->hasFields() ? function () use ($node): array {
371
+            'fields'      => $node->hasFields() ? function() use ($node) : array {
372 372
                 return $this->buildFields($node);
373 373
             } : [],
374 374
             'resolveType' => $this->getTypeResolver($node->getNameValue()),
@@ -387,10 +387,10 @@  discard block
 block discarded – undo
387 387
             'description' => $node->getDescriptionValue(),
388 388
             'values'      => $node->hasValues() ? keyValueMap(
389 389
                 $node->getValues(),
390
-                function (EnumValueDefinitionNode $value): string {
390
+                function(EnumValueDefinitionNode $value): string {
391 391
                     return $value->getNameValue();
392 392
                 },
393
-                function (EnumValueDefinitionNode $value): array {
393
+                function(EnumValueDefinitionNode $value): array {
394 394
                     return [
395 395
                         'description'       => $value->getDescriptionValue(),
396 396
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         return newUnionType([
412 412
             'name'        => $node->getNameValue(),
413 413
             'description' => $node->getDescriptionValue(),
414
-            'types'       => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) {
414
+            'types'       => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) {
415 415
                 return $this->buildType($type);
416 416
             }, $node->getTypes()) : [],
417 417
             'resolveType' => $this->getTypeResolver($node->getNameValue()),
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         return newScalarType([
440 440
             'name'        => $node->getNameValue(),
441 441
             'description' => $node->getDescriptionValue(),
442
-            'serialize'   => function ($value) {
442
+            'serialize'   => function($value) {
443 443
                 return $value;
444 444
             },
445 445
             'astNode'     => $node,
@@ -455,13 +455,13 @@  discard block
 block discarded – undo
455 455
         return newInputObjectType([
456 456
             'name'        => $node->getNameValue(),
457 457
             'description' => $node->getDescriptionValue(),
458
-            'fields'      => $node->hasFields() ? function () use ($node) {
458
+            'fields'      => $node->hasFields() ? function() use ($node) {
459 459
                 return keyValueMap(
460 460
                     $node->getFields(),
461
-                    function (InputValueDefinitionNode $value): string {
461
+                    function(InputValueDefinitionNode $value): string {
462 462
                         return $value->getNameValue();
463 463
                     },
464
-                    function (InputValueDefinitionNode $value): array {
464
+                    function(InputValueDefinitionNode $value): array {
465 465
                         $type         = $this->buildWrappedType($value->getType());
466 466
                         $defaultValue = $value->getDefaultValue();
467 467
                         return [
Please login to merge, or discard this patch.