Passed
Pull Request — master (#159)
by Christoffer
02:37
created
src/SchemaBuilder/SchemaBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,27 +77,27 @@
 block discarded – undo
77 77
 
78 78
         $definitionBuilder = $this->definitionBuilderCreator->create($nodeMap, $resolverRegistry);
79 79
 
80
-        $types = array_map(function (TypeDefinitionNodeInterface $definition) use ($definitionBuilder) {
80
+        $types = array_map(function(TypeDefinitionNodeInterface $definition) use ($definitionBuilder) {
81 81
             return $definitionBuilder->buildType($definition);
82 82
         }, $typeDefinitions);
83 83
 
84
-        $directives = array_map(function (DirectiveDefinitionNode $definition) use ($definitionBuilder) {
84
+        $directives = array_map(function(DirectiveDefinitionNode $definition) use ($definitionBuilder) {
85 85
             return $definitionBuilder->buildDirective($definition);
86 86
         }, $directiveDefinitions);
87 87
 
88
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
88
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
89 89
             return $directive->getName() === 'skip';
90 90
         })) {
91 91
             $directives[] = GraphQLSkipDirective();
92 92
         }
93 93
 
94
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
94
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
95 95
             return $directive->getName() === 'include';
96 96
         })) {
97 97
             $directives[] = GraphQLIncludeDirective();
98 98
         }
99 99
 
100
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
100
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
101 101
             return $directive->getName() === 'deprecated';
102 102
         })) {
103 103
             $directives[] = GraphQLDeprecatedDirective();
Please login to merge, or discard this patch.
src/SchemaBuilder/DefinitionBuilder.php 1 patch
Spacing   +18 added lines, -18 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
         );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function buildTypes(array $nodes): array
112 112
     {
113
-        return \array_map(function (NodeInterface $node) {
113
+        return \array_map(function(NodeInterface $node) {
114 114
             return $this->buildType($node);
115 115
         }, $nodes);
116 116
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         return GraphQLDirective([
147 147
             'name'        => $node->getNameValue(),
148 148
             'description' => $node->getDescriptionValue(),
149
-            'locations'   => \array_map(function (NameNode $node) {
149
+            'locations'   => \array_map(function(NameNode $node) {
150 150
                 return $node->getValue();
151 151
             }, $node->getLocations()),
152 152
             'args'        => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
     {
191 191
         return keyValueMap(
192 192
             $nodes,
193
-            function (InputValueDefinitionNode $value) {
193
+            function(InputValueDefinitionNode $value) {
194 194
                 return $value->getNameValue();
195 195
             },
196
-            function (InputValueDefinitionNode $value): array {
196
+            function(InputValueDefinitionNode $value): array {
197 197
                 $type         = $this->buildWrappedType($value->getType());
198 198
                 $defaultValue = $value->getDefaultValue();
199 199
                 return [
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
         return GraphQLObjectType([
246 246
             'name'        => $node->getNameValue(),
247 247
             'description' => $node->getDescriptionValue(),
248
-            'fields'      => function () use ($node) {
248
+            'fields'      => function() use ($node) {
249 249
                 return $this->buildFields($node);
250 250
             },
251
-            'interfaces'  => function () use ($node) {
252
-                return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) {
251
+            'interfaces'  => function() use ($node) {
252
+                return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) {
253 253
                     return $this->buildType($interface);
254 254
                 }, $node->getInterfaces()) : [];
255 255
             },
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
     {
266 266
         return $node->hasFields() ? keyValueMap(
267 267
             $node->getFields(),
268
-            function ($value) {
268
+            function($value) {
269 269
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
270 270
                 return $value->getNameValue();
271 271
             },
272
-            function ($value) use ($node) {
272
+            function($value) use ($node) {
273 273
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
274 274
                 return $this->buildField(
275 275
                     $value,
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         return GraphQLInterfaceType([
289 289
             'name'        => $node->getNameValue(),
290 290
             'description' => $node->getDescriptionValue(),
291
-            'fields'      => function () use ($node): array {
291
+            'fields'      => function() use ($node): array {
292 292
                 return $this->buildFields($node);
293 293
             },
294 294
             'astNode'     => $node,
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
             'description' => $node->getDescriptionValue(),
307 307
             'values'      => $node->hasValues() ? keyValueMap(
308 308
                 $node->getValues(),
309
-                function (EnumValueDefinitionNode $value): string {
309
+                function(EnumValueDefinitionNode $value): string {
310 310
                     return $value->getNameValue();
311 311
                 },
312
-                function (EnumValueDefinitionNode $value): array {
312
+                function(EnumValueDefinitionNode $value): array {
313 313
                     return [
314 314
                         'description'       => $value->getDescriptionValue(),
315 315
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         return GraphQLUnionType([
331 331
             'name'        => $node->getNameValue(),
332 332
             'description' => $node->getDescriptionValue(),
333
-            'types'       => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) {
333
+            'types'       => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) {
334 334
                 return $this->buildType($type);
335 335
             }, $node->getTypes()) : [],
336 336
             'astNode'     => $node,
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         return GraphQLScalarType([
347 347
             'name'        => $node->getNameValue(),
348 348
             'description' => $node->getDescriptionValue(),
349
-            'serialize'   => function ($value) {
349
+            'serialize'   => function($value) {
350 350
                 return $value;
351 351
             },
352 352
             'astNode'     => $node,
@@ -362,13 +362,13 @@  discard block
 block discarded – undo
362 362
         return GraphQLInputObjectType([
363 363
             'name'        => $node->getNameValue(),
364 364
             'description' => $node->getDescriptionValue(),
365
-            'fields'      => $node->hasFields() ? function () use ($node) {
365
+            'fields'      => $node->hasFields() ? function() use ($node) {
366 366
                 return keyValueMap(
367 367
                     $node->getFields(),
368
-                    function (InputValueDefinitionNode $value): string {
368
+                    function(InputValueDefinitionNode $value): string {
369 369
                         return $value->getNameValue();
370 370
                     },
371
-                    function (InputValueDefinitionNode $value): array {
371
+                    function(InputValueDefinitionNode $value): array {
372 372
                         $type         = $this->buildWrappedType($value->getType());
373 373
                         $defaultValue = $value->getDefaultValue();
374 374
                         return [
Please login to merge, or discard this patch.
src/SchemaExtension/SchemaExtender.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             return $schema;
171 171
         }
172 172
 
173
-        $resolveTypeFunction = function (NamedTypeNode $node) use ($schema): ?TypeInterface {
173
+        $resolveTypeFunction = function(NamedTypeNode $node) use ($schema): ?TypeInterface {
174 174
             $typeName     = $node->getNameValue();
175 175
             $existingType = $schema->getType($typeName);
176 176
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 ? $this->getExtendedType($existingSubscriptionType)
214 214
                 : null,
215 215
             'types'        => \array_merge(
216
-                \array_map(function ($type) {
216
+                \array_map(function($type) {
217 217
                     return $this->getExtendedType($type);
218 218
                 }, \array_values($schema->getTypeMap())),
219 219
                 $this->definitionBuilder->buildTypes(\array_values($typeDefinitionMap))
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
         return \array_merge(
239 239
             $existingDirectives,
240
-            \array_map(function (DirectiveDefinitionNode $node) {
240
+            \array_map(function(DirectiveDefinitionNode $node) {
241 241
                 return $this->definitionBuilder->buildDirective($node);
242 242
             }, $directiveDefinitions)
243 243
         );
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
         return GraphQLObjectType([
330 330
             'name'              => $typeName,
331 331
             'description'       => $type->getDescription(),
332
-            'interfaces'        => function () use ($type) {
332
+            'interfaces'        => function() use ($type) {
333 333
                 return $this->extendImplementedInterfaces($type);
334 334
             },
335
-            'fields'            => function () use ($type) {
335
+            'fields'            => function() use ($type) {
336 336
                 return $this->extendFieldMap($type);
337 337
             },
338 338
             'astNode'           => $type->getAstNode(),
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         return GraphQLInterfaceType([
360 360
             'name'              => $typeName,
361 361
             'description'       => $type->getDescription(),
362
-            'fields'            => function () use ($type) {
362
+            'fields'            => function() use ($type) {
363 363
                 return $this->extendFieldMap($type);
364 364
             },
365 365
             'astNode'           => $type->getAstNode(),
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         return GraphQLUnionType([
379 379
             'name'        => $type->getName(),
380 380
             'description' => $type->getDescription(),
381
-            'types'       => \array_map(function ($unionType) {
381
+            'types'       => \array_map(function($unionType) {
382 382
                 return $this->getExtendedType($unionType);
383 383
             }, $type->getTypes()),
384 384
             'astNode'     => $type->getAstNode(),
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
      */
394 394
     protected function extendImplementedInterfaces(ObjectType $type): array
395 395
     {
396
-        $interfaces = \array_map(function (InterfaceType $interface) {
396
+        $interfaces = \array_map(function(InterfaceType $interface) {
397 397
             return $this->getExtendedType($interface);
398 398
         }, $type->getInterfaces());
399 399
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                 'description'       => $field->getDescription(),
436 436
                 'deprecationReason' => $field->getDeprecationReason(),
437 437
                 'type'              => $this->extendFieldType($field->getType()),
438
-                'args'              => keyMap($field->getArguments(), function (Argument $argument) {
438
+                'args'              => keyMap($field->getArguments(), function(Argument $argument) {
439 439
                     return $argument->getName();
440 440
                 }),
441 441
                 'astNode'           => $field->getAstNode(),
Please login to merge, or discard this patch.