Passed
Push — master ( abc3c7...fc38ef )
by Christoffer
02:42
created
src/Language/ASTBuilder/ValueLiteralASTBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
     {
177 177
         $start = $lexer->getToken();
178 178
 
179
-        $parseValue = function (LexerInterface $lexer, bool $isConst) {
179
+        $parseValue = function(LexerInterface $lexer, bool $isConst) {
180 180
             $this->expect($lexer, TokenKindEnum::COLON);
181 181
 
182 182
             return $this->parseValueLiteral($lexer, $isConst);
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
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             // Assert each interface field arg is implemented.
317 317
             foreach ($interfaceField->getArguments() as $interfaceArgument) {
318 318
                 $argumentName   = $interfaceArgument->getName();
319
-                $objectArgument = find($objectField->getArguments(), function (Argument $argument) use ($argumentName) {
319
+                $objectArgument = find($objectField->getArguments(), function(Argument $argument) use ($argumentName) {
320 320
                     return $argument->getName() === $argumentName;
321 321
                 });
322 322
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                     $argumentName      = $objectArgument->getName();
376 376
                     $interfaceArgument = find(
377 377
                         $interfaceField->getArguments(),
378
-                        function (Argument $argument) use ($argumentName) {
378
+                        function(Argument $argument) use ($argumentName) {
379 379
                             return $argument->getName() === $argumentName;
380 380
                         }
381 381
                     );
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
             return null;
715 715
         }
716 716
 
717
-        return \array_filter($node->getTypes(), function (NamedTypeNode $type) use ($memberTypeName) {
717
+        return \array_filter($node->getTypes(), function(NamedTypeNode $type) use ($memberTypeName) {
718 718
             return $type->getNameValue() === $memberTypeName;
719 719
         });
720 720
     }
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
             return null;
734 734
         }
735 735
 
736
-        return \array_filter($node->getValues(), function (NameAwareInterface $type) use ($valueName) {
736
+        return \array_filter($node->getValues(), function(NameAwareInterface $type) use ($valueName) {
737 737
             return $type->getNameValue() === $valueName;
738 738
         });
739 739
     }
Please login to merge, or discard this patch.
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/SchemaBuilder/SchemaBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,27 +74,27 @@
 block discarded – undo
74 74
 
75 75
         $definitionBuilder = $this->definitionBuilderCreator->create($nodeMap, $resolverMap);
76 76
 
77
-        $types = array_map(function (TypeDefinitionNodeInterface $definition) use ($definitionBuilder) {
77
+        $types = array_map(function(TypeDefinitionNodeInterface $definition) use ($definitionBuilder) {
78 78
             return $definitionBuilder->buildType($definition);
79 79
         }, $typeDefinitions);
80 80
 
81
-        $directives = array_map(function (DirectiveDefinitionNode $definition) use ($definitionBuilder) {
81
+        $directives = array_map(function(DirectiveDefinitionNode $definition) use ($definitionBuilder) {
82 82
             return $definitionBuilder->buildDirective($definition);
83 83
         }, $directiveDefinitions);
84 84
 
85
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
85
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
86 86
             return $directive->getName() === 'skip';
87 87
         })) {
88 88
             $directives[] = GraphQLSkipDirective();
89 89
         }
90 90
 
91
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
91
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
92 92
             return $directive->getName() === 'include';
93 93
         })) {
94 94
             $directives[] = GraphQLIncludeDirective();
95 95
         }
96 96
 
97
-        if (!arraySome($directives, function (DirectiveInterface $directive) {
97
+        if (!arraySome($directives, function(DirectiveInterface $directive) {
98 98
             return $directive->getName() === 'deprecated';
99 99
         })) {
100 100
             $directives[] = GraphQLDeprecatedDirective();
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.
src/Validation/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
         $context = $this->contextCreator->create($schema, $document, $typeInfo);
57 57
 
58
-        $visitors = \array_map(function (RuleInterface $rule) use ($context) {
58
+        $visitors = \array_map(function(RuleInterface $rule) use ($context) {
59 59
             return $rule->setContext($context);
60 60
         }, $rules);
61 61
 
Please login to merge, or discard this patch.
src/Execution/ExecutionStrategy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if ($isContainsPromise) {
252 252
             $keys    = array_keys($finalResults);
253 253
             $promise = \React\Promise\all(array_values($finalResults));
254
-            $promise->then(function ($values) use ($keys, &$finalResults) {
254
+            $promise->then(function($values) use ($keys, &$finalResults) {
255 255
                 foreach ($values as $i => $value) {
256 256
                     $finalResults[$keys[$i]] = $value;
257 257
                 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
         $promise = new \React\Promise\FulfilledPromise([]);
287 287
 
288
-        $resolve = function ($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) {
288
+        $resolve = function($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) {
289 289
             $fieldPath   = $path;
290 290
             $fieldPath[] = $fieldName;
291 291
             try {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
             if ($this->isPromise($result)) {
298 298
                 /** @var ExtendedPromiseInterface $result */
299
-                return $result->then(function ($resolvedResult) use ($fieldName, $results) {
299
+                return $result->then(function($resolvedResult) use ($fieldName, $results) {
300 300
                     $results[$fieldName] = $resolvedResult;
301 301
                     return $results;
302 302
                 });
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         };
309 309
 
310 310
         foreach ($fields as $fieldName => $fieldNodes) {
311
-            $promise = $promise->then(function ($resolvedResults) use (
311
+            $promise = $promise->then(function($resolvedResults) use (
312 312
                 $resolve,
313 313
                 $fieldName,
314 314
                 $path,
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             });
321 321
         }
322 322
 
323
-        $promise->then(function ($resolvedResults) use (&$finalResults) {
323
+        $promise->then(function($resolvedResults) use (&$finalResults) {
324 324
             $finalResults = $resolvedResults ?? [];
325 325
         });
326 326
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
             if ($this->isPromise($completed)) {
505 505
                 $context = $this->context;
506 506
                 /** @var ExtendedPromiseInterface $completed */
507
-                return $completed->then(null, function ($error) use ($context, $fieldNodes, $path) {
507
+                return $completed->then(null, function($error) use ($context, $fieldNodes, $path) {
508 508
                     //@TODO Handle $error better
509 509
                     if ($error instanceof \Exception) {
510 510
                         $context->addError($this->buildLocatedError($error, $fieldNodes, $path));
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
     ) {
580 580
         if ($this->isPromise($result)) {
581 581
             /** @var ExtendedPromiseInterface $result */
582
-            return $result->then(function (&$value) use ($returnType, $fieldNodes, $info, $path) {
582
+            return $result->then(function(&$value) use ($returnType, $fieldNodes, $info, $path) {
583 583
                 return $this->completeValue($returnType, $fieldNodes, $info, $path, $value);
584 584
             });
585 585
         }
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
         if ($this->isPromise($runtimeType)) {
669 669
             /** @var ExtendedPromiseInterface $runtimeType */
670
-            return $runtimeType->then(function ($resolvedRuntimeType) use (
670
+            return $runtimeType->then(function($resolvedRuntimeType) use (
671 671
                 $returnType,
672 672
                 $fieldNodes,
673 673
                 $info,
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
         if (!empty($promisedIsTypeOfResults)) {
794 794
             return \React\Promise\all($promisedIsTypeOfResults)
795
-                ->then(function ($isTypeOfResults) use ($possibleTypes) {
795
+                ->then(function($isTypeOfResults) use ($possibleTypes) {
796 796
                     foreach ($isTypeOfResults as $index => $result) {
797 797
                         if ($result) {
798 798
                             return $possibleTypes[$index];
Please login to merge, or discard this patch.
src/Language/utils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
  */
147 147
 function locationsShorthandToArray(array $locations): array
148 148
 {
149
-    return array_map(function ($shorthand) {
149
+    return array_map(function($shorthand) {
150 150
         return locationShorthandToArray($shorthand);
151 151
     }, $locations);
152 152
 }
Please login to merge, or discard this patch.
src/Execution/ValuesHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             return $coercedValues;
63 63
         }
64 64
 
65
-        $argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) {
65
+        $argumentNodeMap = keyMap($argumentNodes, function(ArgumentNode $value) {
66 66
             return $value->getNameValue();
67 67
         });
68 68
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         array $variableValues = []
134 134
     ): ?array {
135 135
         $directiveNode = $node->hasDirectives()
136
-            ? find($node->getDirectives(), function (NameAwareInterface $value) use ($directive) {
136
+            ? find($node->getDirectives(), function(NameAwareInterface $value) use ($directive) {
137 137
                 return $value->getNameValue() === $directive->getName();
138 138
             }) : null;
139 139
 
Please login to merge, or discard this patch.