Completed
Pull Request — master (#151)
by Christoffer
04:08 queued 01:35
created
src/SchemaBuilder/DefinitionBuilder.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         $builtInTypes = keyMap(
97 97
             \array_merge(specifiedScalarTypes(), introspectionTypes()),
98
-            function (NamedTypeInterface $type) {
98
+            function(NamedTypeInterface $type) {
99 99
                 return $type->getName();
100 100
             }
101 101
         );
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         return GraphQLDirective([
158 158
             'name'        => $node->getNameValue(),
159 159
             'description' => $node->getDescriptionValue(),
160
-            'locations'   => \array_map(function (NameNode $node) {
160
+            'locations'   => \array_map(function(NameNode $node) {
161 161
                 return $node->getValue();
162 162
             }, $node->getLocations()),
163 163
             'args'        => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
     {
207 207
         return keyValueMap(
208 208
             $nodes,
209
-            function (InputValueDefinitionNode $value) {
209
+            function(InputValueDefinitionNode $value) {
210 210
                 return $value->getNameValue();
211 211
             },
212
-            function (InputValueDefinitionNode $value): array {
212
+            function(InputValueDefinitionNode $value): array {
213 213
                 $type         = $this->buildWrappedType($value->getType());
214 214
                 $defaultValue = $value->getDefaultValue();
215 215
                 return [
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
         return GraphQLObjectType([
262 262
             'name'        => $node->getNameValue(),
263 263
             'description' => $node->getDescriptionValue(),
264
-            'fields'      => function () use ($node) {
264
+            'fields'      => function() use ($node) {
265 265
                 return $this->buildFields($node);
266 266
             },
267
-            'interfaces'  => function () use ($node) {
268
-                return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) {
267
+            'interfaces'  => function() use ($node) {
268
+                return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) {
269 269
                     return $this->buildType($interface);
270 270
                 }, $node->getInterfaces()) : [];
271 271
             },
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 
284 284
         return $node->hasFields() ? keyValueMap(
285 285
             $node->getFields(),
286
-            function ($value) {
286
+            function($value) {
287 287
                 /** @noinspection PhpUndefinedMethodInspection */
288 288
                 return $value->getNameValue();
289 289
             },
290
-            function ($value) use ($resolverMap) {
290
+            function($value) use ($resolverMap) {
291 291
                 return $this->buildField($value, $resolverMap);
292 292
             }
293 293
         ) : [];
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         return GraphQLInterfaceType([
303 303
             'name'        => $node->getNameValue(),
304 304
             'description' => $node->getDescriptionValue(),
305
-            'fields'      => function () use ($node): array {
305
+            'fields'      => function() use ($node): array {
306 306
                 return $this->buildFields($node);
307 307
             },
308 308
             'astNode'     => $node,
@@ -320,10 +320,10 @@  discard block
 block discarded – undo
320 320
             'description' => $node->getDescriptionValue(),
321 321
             'values'      => $node->hasValues() ? keyValueMap(
322 322
                 $node->getValues(),
323
-                function (EnumValueDefinitionNode $value): string {
323
+                function(EnumValueDefinitionNode $value): string {
324 324
                     return $value->getNameValue();
325 325
                 },
326
-                function (EnumValueDefinitionNode $value): array {
326
+                function(EnumValueDefinitionNode $value): array {
327 327
                     return [
328 328
                         'description'       => $value->getDescriptionValue(),
329 329
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         return GraphQLUnionType([
345 345
             'name'        => $node->getNameValue(),
346 346
             'description' => $node->getDescriptionValue(),
347
-            'types'       => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) {
347
+            'types'       => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) {
348 348
                 return $this->buildType($type);
349 349
             }, $node->getTypes()) : [],
350 350
             'astNode'     => $node,
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
         return GraphQLScalarType([
361 361
             'name'        => $node->getNameValue(),
362 362
             'description' => $node->getDescriptionValue(),
363
-            'serialize'   => function ($value) {
363
+            'serialize'   => function($value) {
364 364
                 return $value;
365 365
             },
366 366
             'astNode'     => $node,
@@ -376,13 +376,13 @@  discard block
 block discarded – undo
376 376
         return GraphQLInputObjectType([
377 377
             'name'        => $node->getNameValue(),
378 378
             'description' => $node->getDescriptionValue(),
379
-            'fields'      => $node->hasFields() ? function () use ($node) {
379
+            'fields'      => $node->hasFields() ? function() use ($node) {
380 380
                 return keyValueMap(
381 381
                     $node->getFields(),
382
-                    function (InputValueDefinitionNode $value): string {
382
+                    function(InputValueDefinitionNode $value): string {
383 383
                         return $value->getNameValue();
384 384
                     },
385
-                    function (InputValueDefinitionNode $value): array {
385
+                    function(InputValueDefinitionNode $value): array {
386 386
                         $type         = $this->buildWrappedType($value->getType());
387 387
                         $defaultValue = $value->getDefaultValue();
388 388
                         return [
Please login to merge, or discard this patch.
src/SchemaValidator/SchemaValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $errors = $this->validate($schema);
51 51
 
52 52
         if (!empty($errors)) {
53
-            $message = \implode("\n", \array_map(function (SchemaValidationException $error) {
53
+            $message = \implode("\n", \array_map(function(SchemaValidationException $error) {
54 54
                 return $error->getMessage();
55 55
             }, $errors));
56 56
 
Please login to merge, or discard this patch.