Passed
Pull Request — master (#190)
by Sebastian
02:38
created
src/Schema/Resolver/AbstractResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function getResolveMethod(string $fieldName): ?callable
14 14
     {
15
-        $resolveMethod = 'resolve'.\ucfirst($fieldName);
15
+        $resolveMethod = 'resolve' . \ucfirst($fieldName);
16 16
 
17 17
         if (\method_exists($this, $resolveMethod)) {
18 18
             return [$this, $resolveMethod];
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function getTypeResolver(): ?callable
28 28
     {
29
-        return function ($rootValue, $contextValues, ResolveInfo $info) {
29
+        return function($rootValue, $contextValues, ResolveInfo $info) {
30 30
             return $this->resolveType($rootValue, $contextValues, $info);
31 31
         };
32 32
     }
Please login to merge, or discard this patch.
src/Schema/Validation/Rule/TypesRule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
             foreach ($interfaceField->getArguments() as $interfaceArgument) {
471 471
                 $argumentName = $interfaceArgument->getName();
472 472
                 $objectArgument = find($objectField->getArguments(),
473
-                    function (Argument $argument) use ($argumentName) {
473
+                    function(Argument $argument) use ($argumentName) {
474 474
                         return $argument->getName() === $argumentName;
475 475
                     });
476 476
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
                     $argumentName = $objectArgument->getName();
534 534
                     $interfaceArgument = find(
535 535
                         $interfaceField->getArguments(),
536
-                        function (Argument $argument) use ($argumentName) {
536
+                        function(Argument $argument) use ($argumentName) {
537 537
                             return $argument->getName() === $argumentName;
538 538
                         }
539 539
                     );
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                         $this->context->reportError(
543 543
                             new SchemaValidationException(
544 544
                                 \sprintf(
545
-                                    'Object field argument %s.%s(%s:) is of required type %s '.
545
+                                    'Object field argument %s.%s(%s:) is of required type %s ' .
546 546
                                     'but is not also provided by the Interface field %s.%s.',
547 547
                                     $objectType->getName(),
548 548
                                     $fieldName,
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
         }
682 682
 
683 683
         return \array_filter($node->getTypes(),
684
-            function (NamedTypeNode $type) use ($memberTypeName) {
684
+            function(NamedTypeNode $type) use ($memberTypeName) {
685 685
                 return $type->getNameValue() === $memberTypeName;
686 686
             });
687 687
     }
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
         }
761 761
 
762 762
         return \array_filter($node->getValues(),
763
-            function (NameAwareInterface $type) use ($valueName) {
763
+            function(NameAwareInterface $type) use ($valueName) {
764 764
                 return $type->getNameValue() === $valueName;
765 765
             });
766 766
     }
Please login to merge, or discard this patch.
src/Schema/Validation/Rule/RootTypesRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         /** @var OperationTypeDefinitionNode $operationTypeNode */
99 99
         $operationTypeNode = find(
100 100
             $node->getOperationTypes(),
101
-            function (OperationTypeDefinitionNode $operationType) use (
101
+            function(OperationTypeDefinitionNode $operationType) use (
102 102
                 $operation
103 103
             ) {
104 104
                 return $operationType->getOperation() === $operation;
Please login to merge, or discard this patch.
src/Schema/Validation/SchemaValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
         if (!empty($errors)) {
23 23
             $message = \implode("\n",
24
-                \array_map(function (SchemaValidationException $error) {
24
+                \array_map(function(SchemaValidationException $error) {
25 25
                     return $error->getMessage();
26 26
                 }, $errors));
27 27
 
Please login to merge, or discard this patch.
src/Schema/Schema.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function getDirective(string $name): ?Directive
138 138
     {
139 139
         return find($this->directives,
140
-            function (Directive $directive) use ($name) {
140
+            function(Directive $directive) use ($name) {
141 141
                 return $directive->getName() === $name;
142 142
             });
143 143
     }
@@ -208,15 +208,15 @@  discard block
 block discarded – undo
208 208
             invariant(
209 209
                 \is_array($possibleTypes),
210 210
                 \sprintf(
211
-                    'Could not find possible implementing types for %s '.
212
-                    'in schema. Check that schema.types is defined and is an array of '.
211
+                    'Could not find possible implementing types for %s ' .
212
+                    'in schema. Check that schema.types is defined and is an array of ' .
213 213
                     'all possible types in the schema.',
214 214
                     $abstractTypeName
215 215
                 )
216 216
             );
217 217
 
218 218
             $this->possibleTypesMap[$abstractTypeName] = \array_reduce($possibleTypes,
219
-                function (array $map, TypeInterface $type) {
219
+                function(array $map, TypeInterface $type) {
220 220
                     /** @var NameAwareInterface $type */
221 221
                     $map[$type->getName()] = true;
222 222
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
         }
391 391
 
392 392
         return \array_reduce($directive->getArguments(),
393
-            function ($map, Argument $argument) {
393
+            function($map, Argument $argument) {
394 394
                 return $this->typeMapReducer($map, $argument->getType());
395 395
             }, $map);
396 396
     }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         if ($type instanceof ObjectType || $type instanceof InterfaceType) {
444 444
             foreach ($type->getFields() as $field) {
445 445
                 if ($field->hasArguments()) {
446
-                    $fieldArgTypes = \array_map(function (Argument $argument) {
446
+                    $fieldArgTypes = \array_map(function(Argument $argument) {
447 447
                         return $argument->getType();
448 448
                     }, $field->getArguments());
449 449
 
Please login to merge, or discard this patch.
src/Schema/Extension/ExtensionContext.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
         return newObjectType([
148 148
             'name' => $typeName,
149 149
             'description' => $type->getDescription(),
150
-            'interfaces' => function () use ($type) {
150
+            'interfaces' => function() use ($type) {
151 151
                 return $this->extendImplementedInterfaces($type);
152 152
             },
153
-            'fields' => function () use ($type) {
153
+            'fields' => function() use ($type) {
154 154
                 return $this->extendFieldMap($type);
155 155
             },
156 156
             'astNode' => $type->getAstNode(),
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $typeName = $type->getName();
187 187
 
188
-        $interfaces = \array_map(function (InterfaceType $interface) {
188
+        $interfaces = \array_map(function(InterfaceType $interface) {
189 189
             return $this->getExtendedType($interface);
190 190
         }, $type->getInterfaces());
191 191
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 'deprecationReason' => $field->getDeprecationReason(),
230 230
                 'type' => $this->extendFieldType($field->getType()),
231 231
                 'args' => keyMap($field->getArguments(),
232
-                    function (Argument $argument) {
232
+                    function(Argument $argument) {
233 233
                         return $argument->getName();
234 234
                     }),
235 235
                 'astNode' => $field->getAstNode(),
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     if (isset($oldFieldMap[$fieldName])) {
249 249
                         throw new ExtensionException(
250 250
                             \sprintf(
251
-                                'Field "%s.%s" already exists in the schema. '.
251
+                                'Field "%s.%s" already exists in the schema. ' .
252 252
                                 'It cannot also be defined in this type extension.',
253 253
                                 $typeName, $fieldName
254 254
                             ),
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         return newInterfaceType([
304 304
             'name' => $typeName,
305 305
             'description' => $type->getDescription(),
306
-            'fields' => function () use ($type) {
306
+            'fields' => function() use ($type) {
307 307
                 return $this->extendFieldMap($type);
308 308
             },
309 309
             'astNode' => $type->getAstNode(),
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         return newUnionType([
324 324
             'name' => $type->getName(),
325 325
             'description' => $type->getDescription(),
326
-            'types' => \array_map(function ($unionType) {
326
+            'types' => \array_map(function($unionType) {
327 327
                 return $this->getExtendedType($unionType);
328 328
             }, $type->getTypes()),
329 329
             'astNode' => $type->getAstNode(),
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function getExtendedTypes(): array
367 367
     {
368
-        $extendedTypes = \array_map(function ($type) {
368
+        $extendedTypes = \array_map(function($type) {
369 369
             return $this->getExtendedType($type);
370 370
         }, $this->info->getSchema()->getTypeMap());
371 371
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
         return \array_merge(
390 390
             $existingDirectives,
391
-            \array_map(function (DirectiveDefinitionNode $node) {
391
+            \array_map(function(DirectiveDefinitionNode $node) {
392 392
                 return $this->definitionBuilder->buildDirective($node);
393 393
             }, $this->info->getDirectiveDefinitions())
394 394
         );
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
         throw new ExtensionException(
428 428
             \sprintf(
429
-                'Unknown type: "%s". Ensure that this type exists '.
429
+                'Unknown type: "%s". Ensure that this type exists ' .
430 430
                 'either in the original schema, or is added in a type definition.',
431 431
                 $typeName
432 432
             ),
Please login to merge, or discard this patch.
src/Schema/Extension/SchemaExtender.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
                 if (null !== $existingType) {
117 117
                     throw new ExtensionException(
118 118
                         \sprintf(
119
-                            'Type "%s" already exists in the schema. It cannot also '.
119
+                            'Type "%s" already exists in the schema. It cannot also ' .
120 120
                             'be defined in this type definition.',
121 121
                             $typeName
122 122
                         ),
Please login to merge, or discard this patch.
src/Type/DirectivesProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function () {
26
+        $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function() {
27 27
             return newDirective([
28 28
                 'name' => 'include',
29 29
                 'description' =>
30
-                    'Directs the executor to include this field or fragment only when '.
30
+                    'Directs the executor to include this field or fragment only when ' .
31 31
                     'the `if` argument is true.',
32 32
                 'locations' => [
33 33
                     DirectiveLocationEnum::FIELD,
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
             ]);
44 44
         }, true/* $shared */);
45 45
 
46
-        $this->container->add(GraphQL::SKIP_DIRECTIVE, function () {
46
+        $this->container->add(GraphQL::SKIP_DIRECTIVE, function() {
47 47
             return newDirective([
48 48
                 'name' => 'skip',
49 49
                 'description' =>
50
-                    'Directs the executor to skip this field or fragment when the `if` '.
50
+                    'Directs the executor to skip this field or fragment when the `if` ' .
51 51
                     'argument is true.',
52 52
                 'locations' => [
53 53
                     DirectiveLocationEnum::FIELD,
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             ]);
64 64
         }, true/* $shared */);
65 65
 
66
-        $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function () {
66
+        $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function() {
67 67
             return newDirective([
68 68
                 'name' => 'deprecated',
69 69
                 'description' => 'Marks an element of a GraphQL schema as no longer supported.',
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
                     'reason' => [
76 76
                         'type' => String(),
77 77
                         'description' =>
78
-                            'Explains why this element was deprecated, usually also including a '.
79
-                            'suggestion for how to access supported similar data. Formatted '.
78
+                            'Explains why this element was deprecated, usually also including a ' .
79
+                            'suggestion for how to access supported similar data. Formatted ' .
80 80
                             'in [Markdown](https://daringfireball.net/projects/markdown/).',
81 81
                         'defaultValue' => DEFAULT_DEPRECATION_REASON,
82 82
                     ],
Please login to merge, or discard this patch.
src/Type/Definition/ScalarType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,8 @@
 block discarded – undo
96 96
         invariant(
97 97
             \is_callable($this->serializeFunction),
98 98
             \sprintf(
99
-                '%s must provide "serialize" function. If this custom Scalar '.
100
-                'is also used as an input type, ensure "parseValue" and "parseLiteral" '.
99
+                '%s must provide "serialize" function. If this custom Scalar ' .
100
+                'is also used as an input type, ensure "parseValue" and "parseLiteral" ' .
101 101
                 'functions are also provided.',
102 102
                 $this->getName()
103 103
             )
Please login to merge, or discard this patch.