Completed
Pull Request — master (#118)
by Christoffer
03:27
created
src/Language/SchemaBuilder/DefinitionBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
         $builtInTypes = keyMap(
90 90
             array_merge(specifiedScalarTypes(), introspectionTypes()),
91
-            function (NamedTypeInterface $type) {
91
+            function(NamedTypeInterface $type) {
92 92
                 return $type->getName();
93 93
             }
94 94
         );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         return GraphQLDirective([
152 152
             'name'        => $node->getNameValue(),
153 153
             'description' => $node->getDescriptionValue(),
154
-            'locations'   => array_map(function (NameNode $node) {
154
+            'locations'   => array_map(function(NameNode $node) {
155 155
                 return $node->getValue();
156 156
             }, $node->getLocations()),
157 157
             'arguments'   => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
     {
199 199
         return keyValMap(
200 200
             $nodes,
201
-            function (InputValueDefinitionNode $value) {
201
+            function(InputValueDefinitionNode $value) {
202 202
                 return $value->getNameValue();
203 203
             },
204
-            function (InputValueDefinitionNode $value): array {
204
+            function(InputValueDefinitionNode $value): array {
205 205
                 $type = $this->buildWrappedType($value->getType());
206 206
                 return [
207 207
                     'type'         => $type,
@@ -250,11 +250,11 @@  discard block
 block discarded – undo
250 250
         return GraphQLObjectType([
251 251
             'name'        => $node->getNameValue(),
252 252
             'description' => $node->getDescriptionValue(),
253
-            'fields'      => function () use ($node) {
253
+            'fields'      => function() use ($node) {
254 254
                 return $this->buildFields($node);
255 255
             },
256
-            'interfaces'  => function () use ($node) {
257
-                return $node->hasInterfaces() ? array_map(function (NodeInterface $interface) {
256
+            'interfaces'  => function() use ($node) {
257
+                return $node->hasInterfaces() ? array_map(function(NodeInterface $interface) {
258 258
                     return $this->buildType($interface);
259 259
                 }, $node->getInterfaces()) : [];
260 260
             },
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 
272 272
         return $node->hasFields() ? keyValMap(
273 273
             $node->getFields(),
274
-            function ($value) {
274
+            function($value) {
275 275
                 /** @noinspection PhpUndefinedMethodInspection */
276 276
                 return $value->getNameValue();
277 277
             },
278
-            function ($value) use ($resolverMap) {
278
+            function($value) use ($resolverMap) {
279 279
                 return $this->buildField($value, $resolverMap);
280 280
             }
281 281
         ) : [];
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         return GraphQLInterfaceType([
291 291
             'name'        => $node->getNameValue(),
292 292
             'description' => $node->getDescriptionValue(),
293
-            'fields'      => function () use ($node): array {
293
+            'fields'      => function() use ($node): array {
294 294
                 return $this->buildFields($node);
295 295
             },
296 296
             'astNode'     => $node,
@@ -308,10 +308,10 @@  discard block
 block discarded – undo
308 308
             'description' => $node->getDescriptionValue(),
309 309
             'values'      => $node->hasValues() ? keyValMap(
310 310
                 $node->getValues(),
311
-                function (EnumValueDefinitionNode $value): string {
311
+                function(EnumValueDefinitionNode $value): string {
312 312
                     return $value->getNameValue();
313 313
                 },
314
-                function (EnumValueDefinitionNode $value): array {
314
+                function(EnumValueDefinitionNode $value): array {
315 315
                     return [
316 316
                         'description'       => $value->getDescriptionValue(),
317 317
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         return GraphQLUnionType([
333 333
             'name'        => $node->getNameValue(),
334 334
             'description' => $node->getDescriptionValue(),
335
-            'types'       => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) {
335
+            'types'       => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) {
336 336
                 return $this->buildType($type);
337 337
             }, $node->getTypes()) : [],
338 338
             'astNode'     => $node,
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
         return GraphQLScalarType([
349 349
             'name'        => $node->getNameValue(),
350 350
             'description' => $node->getDescriptionValue(),
351
-            'serialize'   => function ($value) {
351
+            'serialize'   => function($value) {
352 352
                 return $value;
353 353
             },
354 354
             'astNode'     => $node,
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
             'description' => $node->getDescriptionValue(),
367 367
             'fields'      => $node->hasFields() ? keyValMap(
368 368
                 $node->getFields(),
369
-                function (InputValueDefinitionNode $value): string {
369
+                function(InputValueDefinitionNode $value): string {
370 370
                     return $value->getNameValue();
371 371
                 },
372
-                function (InputValueDefinitionNode $value): array {
372
+                function(InputValueDefinitionNode $value): array {
373 373
                     $type = $this->buildWrappedType($value->getType());
374 374
                     return [
375 375
                         'type'         => $type,
Please login to merge, or discard this patch.
src/Error/GraphQLException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function getLocationsAsArray(): ?array
151 151
     {
152
-        return !empty($this->locations) ? array_map(function (SourceLocation $location) {
152
+        return !empty($this->locations) ? array_map(function(SourceLocation $location) {
153 153
             return $location->toArray();
154 154
         }, $this->locations) : null;
155 155
     }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     protected function resolvePositions(?array $positions)
216 216
     {
217 217
         if (null === $positions && !empty($this->nodes)) {
218
-            $positions = array_reduce($this->nodes, function (array $list, ?NodeInterface $node) {
218
+            $positions = array_reduce($this->nodes, function(array $list, ?NodeInterface $node) {
219 219
                 if (null !== $node) {
220 220
                     $location = $node->getLocation();
221 221
                     if (null !== $location) {
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
     protected function resolveLocations(?array $positions, ?Source $source)
244 244
     {
245 245
         if (null !== $positions && null !== $source) {
246
-            $locations = array_map(function ($position) use ($source) {
246
+            $locations = array_map(function($position) use ($source) {
247 247
                 return SourceLocation::fromSource($source, $position);
248 248
             }, $positions);
249 249
         } elseif (!empty($this->nodes)) {
250
-            $locations = array_reduce($this->nodes, function (array $list, NodeInterface $node) {
250
+            $locations = array_reduce($this->nodes, function(array $list, NodeInterface $node) {
251 251
                 $location = $node->getLocation();
252 252
                 if (null !== $location) {
253 253
                     $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart());
Please login to merge, or discard this patch.
src/SchemaValidator/Rule/RootTypesRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         /** @var OperationTypeDefinitionNode $operationTypeNode */
90 90
         $operationTypeNode = find(
91 91
             $node->getOperationTypes(),
92
-            function (OperationTypeDefinitionNode $operationType) use ($operation) {
92
+            function(OperationTypeDefinitionNode $operationType) use ($operation) {
93 93
                 return $operationType->getOperation() === $operation;
94 94
             }
95 95
         );
Please login to merge, or discard this patch.
src/SchemaValidator/assertValidSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     $errors = validateSchema($schema);
16 16
 
17 17
     if (!empty($errors)) {
18
-        $message = \implode("\n", array_map(function (ValidationException $error) {
18
+        $message = \implode("\n", array_map(function(ValidationException $error) {
19 19
             return $error->getMessage();
20 20
         }, $errors));
21 21
 
Please login to merge, or discard this patch.
src/Validation/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 
48 48
         $context = $this->contextBuilder->build($schema, $document, $typeInfo);
49 49
 
50
-        $visitors = \array_map(function (RuleInterface $rule) use ($context) {
50
+        $visitors = \array_map(function(RuleInterface $rule) use ($context) {
51 51
             return $rule->setContext($context);
52 52
         }, $rules);
53 53
 
Please login to merge, or discard this patch.
src/Type/Definition/ResolveTypeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function resolveType(...$args)
18 18
     {
19
-        if(isset($this->resolveTypeFunction)) {
19
+        if (isset($this->resolveTypeFunction)) {
20 20
             return \call_user_func_array($this->resolveTypeFunction, $args);
21 21
         }
22 22
 
Please login to merge, or discard this patch.
src/SchemaValidator/Rule/TypesRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             // Assert each interface field arg is implemented.
301 301
             foreach ($interfaceField->getArguments() as $interfaceArgument) {
302 302
                 $argumentName   = $interfaceArgument->getName();
303
-                $objectArgument = find($objectField->getArguments(), function (Argument $argument) use ($argumentName) {
303
+                $objectArgument = find($objectField->getArguments(), function(Argument $argument) use ($argumentName) {
304 304
                     return $argument->getName() === $argumentName;
305 305
                 });
306 306
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             foreach ($objectFields as $objectArgument) {
360 360
                 $argumentName      = $objectArgument->getName();
361 361
                 $interfaceArgument = find($interfaceField->getArguments(),
362
-                    function (Argument $argument) use ($argumentName) {
362
+                    function(Argument $argument) use ($argumentName) {
363 363
                         return $argument->getName() === $argumentName;
364 364
                     });
365 365
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
             return null;
694 694
         }
695 695
 
696
-        return \array_filter($node->getTypes(), function (NamedTypeNode $type) use ($memberTypeName) {
696
+        return \array_filter($node->getTypes(), function(NamedTypeNode $type) use ($memberTypeName) {
697 697
             return $type->getNameValue() === $memberTypeName;
698 698
         });
699 699
     }
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
             return null;
713 713
         }
714 714
 
715
-        return \array_filter($node->getValues(), function (NamedTypeNode $type) use ($valueName) {
715
+        return \array_filter($node->getValues(), function(NamedTypeNode $type) use ($valueName) {
716 716
             return $type->getNameValue() === $valueName;
717 717
         });
718 718
     }
Please login to merge, or discard this patch.