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