GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch phpcs (e30b7a)
by Šimon
02:35
created
src/Utils/BuildSchema.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $defintionBuilder = new ASTDefinitionBuilder(
103 103
             $this->nodeMap,
104 104
             $this->options,
105
-            function($typeName) { throw new Error('Type "'. $typeName . '" not found in document.'); },
105
+            function($typeName) { throw new Error('Type "' . $typeName . '" not found in document.'); },
106 106
             $this->typeConfigDecorator
107 107
         );
108 108
 
@@ -111,21 +111,21 @@  discard block
 block discarded – undo
111 111
         }, $directiveDefs);
112 112
 
113 113
         // If specified directives were not explicitly declared, add them.
114
-        $skip = array_reduce($directives, function ($hasSkip, $directive) {
114
+        $skip = array_reduce($directives, function($hasSkip, $directive) {
115 115
             return $hasSkip || $directive->name == 'skip';
116 116
         });
117 117
         if (!$skip) {
118 118
             $directives[] = Directive::skipDirective();
119 119
         }
120 120
 
121
-        $include = array_reduce($directives, function ($hasInclude, $directive) {
121
+        $include = array_reduce($directives, function($hasInclude, $directive) {
122 122
             return $hasInclude || $directive->name == 'include';
123 123
         });
124 124
         if (!$include) {
125 125
             $directives[] = Directive::includeDirective();
126 126
         }
127 127
 
128
-        $deprecated = array_reduce($directives, function ($hasDeprecated, $directive) {
128
+        $deprecated = array_reduce($directives, function($hasDeprecated, $directive) {
129 129
             return $hasDeprecated || $directive->name == 'deprecated';
130 130
         });
131 131
         if (!$deprecated) {
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
             'subscription' => isset($operationTypes['subscription'])
147 147
                 ? $defintionBuilder->buildType($operationTypes['subscription'])
148 148
                 : null,
149
-            'typeLoader' => function ($name) use ($defintionBuilder) {
149
+            'typeLoader' => function($name) use ($defintionBuilder) {
150 150
                 return $defintionBuilder->buildType($name);
151 151
             },
152 152
             'directives' => $directives,
153 153
             'astNode' => $schemaDef,
154
-            'types' => function () use ($defintionBuilder) {
154
+            'types' => function() use ($defintionBuilder) {
155 155
                 $types = [];
156 156
                 foreach ($this->nodeMap as $name => $def) {
157 157
                     $types[] = $defintionBuilder->buildType($def->name->value);
Please login to merge, or discard this patch.
src/Utils/Utils.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
     {
461 461
         return function() use ($fn, &$errors) {
462 462
             // Catch custom errors (to report them in query results)
463
-            set_error_handler(function ($severity, $message, $file, $line) use (&$errors) {
463
+            set_error_handler(function($severity, $message, $file, $line) use (&$errors) {
464 464
                 $errors[] = new \ErrorException($message, 0, $severity, $file, $line);
465 465
             });
466 466
 
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 
499 499
         return array_reduce(
500 500
             range(1, $selectedLength - 1),
501
-            function ($list, $index) use ($selected, $selectedLength) {
502
-                return $list.
501
+            function($list, $index) use ($selected, $selectedLength) {
502
+                return $list .
503 503
                     ($selectedLength > 2 ? ', ' : ' ') .
504 504
                     ($index === $selectedLength - 1 ? 'or ' : '') .
505 505
                     $selected[$index];
Please login to merge, or discard this patch.
src/Utils/Value.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
     private static function printPath(array $path = null) {
243 243
         $pathStr = '';
244 244
         $currentPath = $path;
245
-        while($currentPath) {
245
+        while ($currentPath) {
246 246
             $pathStr =
247 247
                 (is_string($currentPath['key'])
248 248
                     ? '.' . $currentPath['key']
Please login to merge, or discard this patch.
src/Server/Helper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;
55 55
 
56 56
             if (stripos($contentType, 'application/graphql') !== false) {
57
-                $rawBody =  $readRawBodyFn ? $readRawBodyFn() : $this->readRawBody();
57
+                $rawBody = $readRawBodyFn ? $readRawBodyFn() : $this->readRawBody();
58 58
                 $bodyParams = ['query' => $rawBody ?: ''];
59 59
             } else if (stripos($contentType, 'application/json') !== false) {
60 60
                 $rawBody = $readRawBodyFn ? $readRawBodyFn() : $this->readRawBody();
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             );
271 271
         }
272 272
 
273
-        $applyErrorHandling = function (ExecutionResult $result) use ($config) {
273
+        $applyErrorHandling = function(ExecutionResult $result) use ($config) {
274 274
             if ($config->getErrorsHandler()) {
275 275
                 $result->setErrorsHandler($config->getErrorsHandler());
276 276
             }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
     private function resolveHttpStatus($result)
436 436
     {
437 437
         if (is_array($result) && isset($result[0])) {
438
-            Utils::each($result, function ($executionResult, $index) {
438
+            Utils::each($result, function($executionResult, $index) {
439 439
                 if (!$executionResult instanceof ExecutionResult) {
440 440
                     throw new InvariantViolation(sprintf(
441 441
                         "Expecting every entry of batched query result to be instance of %s but entry at position %d is %s",
Please login to merge, or discard this patch.
src/Type/Introspection.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -331,48 +331,48 @@
 block discarded – undo
331 331
                         'description' => 'Location adjacent to an inline fragment.'
332 332
                     ],
333 333
                     'SCHEMA' => [
334
-                      'value' => DirectiveLocation::SCHEMA,
335
-                      'description' =>  'Location adjacent to a schema definition.'
334
+                        'value' => DirectiveLocation::SCHEMA,
335
+                        'description' =>  'Location adjacent to a schema definition.'
336 336
                     ],
337 337
                     'SCALAR' => [
338
-                      'value' => DirectiveLocation::SCALAR,
339
-                      'description' =>  'Location adjacent to a scalar definition.'
338
+                        'value' => DirectiveLocation::SCALAR,
339
+                        'description' =>  'Location adjacent to a scalar definition.'
340 340
                     ],
341 341
                     'OBJECT' => [
342
-                      'value' => DirectiveLocation::OBJECT,
343
-                      'description' =>  'Location adjacent to an object type definition.'
342
+                        'value' => DirectiveLocation::OBJECT,
343
+                        'description' =>  'Location adjacent to an object type definition.'
344 344
                     ],
345 345
                     'FIELD_DEFINITION' => [
346
-                      'value' => DirectiveLocation::FIELD_DEFINITION,
347
-                      'description' =>  'Location adjacent to a field definition.'
346
+                        'value' => DirectiveLocation::FIELD_DEFINITION,
347
+                        'description' =>  'Location adjacent to a field definition.'
348 348
                     ],
349 349
                     'ARGUMENT_DEFINITION' => [
350
-                      'value' => DirectiveLocation::ARGUMENT_DEFINITION,
351
-                      'description' =>  'Location adjacent to an argument definition.'
350
+                        'value' => DirectiveLocation::ARGUMENT_DEFINITION,
351
+                        'description' =>  'Location adjacent to an argument definition.'
352 352
                     ],
353 353
                     'INTERFACE' => [
354
-                      'value' => DirectiveLocation::IFACE,
355
-                      'description' =>  'Location adjacent to an interface definition.'
354
+                        'value' => DirectiveLocation::IFACE,
355
+                        'description' =>  'Location adjacent to an interface definition.'
356 356
                     ],
357 357
                     'UNION' => [
358
-                      'value' => DirectiveLocation::UNION,
359
-                      'description' =>  'Location adjacent to a union definition.'
358
+                        'value' => DirectiveLocation::UNION,
359
+                        'description' =>  'Location adjacent to a union definition.'
360 360
                     ],
361 361
                     'ENUM' => [
362
-                      'value' => DirectiveLocation::ENUM,
363
-                      'description' =>  'Location adjacent to an enum definition.'
362
+                        'value' => DirectiveLocation::ENUM,
363
+                        'description' =>  'Location adjacent to an enum definition.'
364 364
                     ],
365 365
                     'ENUM_VALUE' => [
366
-                      'value' => DirectiveLocation::ENUM_VALUE,
367
-                      'description' =>  'Location adjacent to an enum value definition.'
366
+                        'value' => DirectiveLocation::ENUM_VALUE,
367
+                        'description' =>  'Location adjacent to an enum value definition.'
368 368
                     ],
369 369
                     'INPUT_OBJECT' => [
370
-                      'value' => DirectiveLocation::INPUT_OBJECT,
371
-                      'description' =>  'Location adjacent to an input object type definition.'
370
+                        'value' => DirectiveLocation::INPUT_OBJECT,
371
+                        'description' =>  'Location adjacent to an input object type definition.'
372 372
                     ],
373 373
                     'INPUT_FIELD_DEFINITION' => [
374
-                      'value' => DirectiveLocation::INPUT_FIELD_DEFINITION,
375
-                      'description' =>  'Location adjacent to an input object field definition.'
374
+                        'value' => DirectiveLocation::INPUT_FIELD_DEFINITION,
375
+                        'description' =>  'Location adjacent to an input object field definition.'
376 376
                     ]
377 377
 
378 378
                 ]
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         if (is_bool($options)) {
51 51
             trigger_error(
52
-                'Calling Introspection::getIntrospectionQuery(boolean) is deprecated. '.
52
+                'Calling Introspection::getIntrospectionQuery(boolean) is deprecated. ' .
53 53
                 'Please use Introspection::getIntrospectionQuery(["descriptions" => boolean]).',
54 54
                 E_USER_DEPRECATED
55 55
             );
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
                     'types' => [
193 193
                         'description' => 'A list of all types supported by this server.',
194 194
                         'type' => new NonNull(new ListOfType(new NonNull(self::_type()))),
195
-                        'resolve' => function (Schema $schema) {
195
+                        'resolve' => function(Schema $schema) {
196 196
                             return array_values($schema->getTypeMap());
197 197
                         }
198 198
                     ],
199 199
                     'queryType' => [
200 200
                         'description' => 'The type that query operations will be rooted at.',
201 201
                         'type' => new NonNull(self::_type()),
202
-                        'resolve' => function (Schema $schema) {
202
+                        'resolve' => function(Schema $schema) {
203 203
                             return $schema->getQueryType();
204 204
                         }
205 205
                     ],
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
                             'If this server supports mutation, the type that ' .
209 209
                             'mutation operations will be rooted at.',
210 210
                         'type' => self::_type(),
211
-                        'resolve' => function (Schema $schema) {
211
+                        'resolve' => function(Schema $schema) {
212 212
                             return $schema->getMutationType();
213 213
                         }
214 214
                     ],
215 215
                     'subscriptionType' => [
216 216
                         'description' => 'If this server support subscription, the type that subscription operations will be rooted at.',
217 217
                         'type'        => self::_type(),
218
-                        'resolve'     => function (Schema $schema) {
218
+                        'resolve'     => function(Schema $schema) {
219 219
                             return $schema->getSubscriptionType();
220 220
                         },
221 221
                     ],
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                     ],
255 255
                     'args' => [
256 256
                         'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))),
257
-                        'resolve' => function (Directive $directive) {
257
+                        'resolve' => function(Directive $directive) {
258 258
                             return $directive->args ?: [];
259 259
                         }
260 260
                     ],
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                 'description' =>
391 391
                     'The fundamental unit of any GraphQL Schema is the type. There are ' .
392 392
                     'many kinds of types in GraphQL as represented by the `__TypeKind` enum.' .
393
-                    "\n\n".
393
+                    "\n\n" .
394 394
                     'Depending on the kind of a type, certain fields describe ' .
395 395
                     'information about that type. Scalar types provide no information ' .
396 396
                     'beyond a name and description, while Enum types provide their values. ' .
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                     return [
402 402
                         'kind' => [
403 403
                             'type' => Type::nonNull(self::_typeKind()),
404
-                            'resolve' => function (Type $type) {
404
+                            'resolve' => function(Type $type) {
405 405
                                 switch (true) {
406 406
                                     case $type instanceof ListOfType:
407 407
                                         return TypeKind::LIST_KIND;
@@ -431,12 +431,12 @@  discard block
 block discarded – undo
431 431
                             'args' => [
432 432
                                 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false]
433 433
                             ],
434
-                            'resolve' => function (Type $type, $args) {
434
+                            'resolve' => function(Type $type, $args) {
435 435
                                 if ($type instanceof ObjectType || $type instanceof InterfaceType) {
436 436
                                     $fields = $type->getFields();
437 437
 
438 438
                                     if (empty($args['includeDeprecated'])) {
439
-                                        $fields = array_filter($fields, function (FieldDefinition $field) {
439
+                                        $fields = array_filter($fields, function(FieldDefinition $field) {
440 440
                                             return !$field->deprecationReason;
441 441
                                         });
442 442
                                     }
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
                         ],
448 448
                         'interfaces' => [
449 449
                             'type' => Type::listOf(Type::nonNull(self::_type())),
450
-                            'resolve' => function ($type) {
450
+                            'resolve' => function($type) {
451 451
                                 if ($type instanceof ObjectType) {
452 452
                                     return $type->getInterfaces();
453 453
                                 }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
                         ],
457 457
                         'possibleTypes' => [
458 458
                             'type' => Type::listOf(Type::nonNull(self::_type())),
459
-                            'resolve' => function ($type, $args, $context, ResolveInfo $info) {
459
+                            'resolve' => function($type, $args, $context, ResolveInfo $info) {
460 460
                                 if ($type instanceof InterfaceType || $type instanceof UnionType) {
461 461
                                     return $info->schema->getPossibleTypes($type);
462 462
                                 }
@@ -468,12 +468,12 @@  discard block
 block discarded – undo
468 468
                             'args' => [
469 469
                                 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false]
470 470
                             ],
471
-                            'resolve' => function ($type, $args) {
471
+                            'resolve' => function($type, $args) {
472 472
                                 if ($type instanceof EnumType) {
473 473
                                     $values = array_values($type->getValues());
474 474
 
475 475
                                     if (empty($args['includeDeprecated'])) {
476
-                                        $values = array_filter($values, function ($value) {
476
+                                        $values = array_filter($values, function($value) {
477 477
                                             return !$value->deprecationReason;
478 478
                                         });
479 479
                                     }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
                         ],
486 486
                         'inputFields' => [
487 487
                             'type' => Type::listOf(Type::nonNull(self::_inputValue())),
488
-                            'resolve' => function ($type) {
488
+                            'resolve' => function($type) {
489 489
                                 if ($type instanceof InputObjectType) {
490 490
                                     return array_values($type->getFields());
491 491
                                 }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                         ],
495 495
                         'ofType' => [
496 496
                             'type' => self::_type(),
497
-                            'resolve' => function ($type) {
497
+                            'resolve' => function($type) {
498 498
                                 if ($type instanceof WrappingType) {
499 499
                                     return $type->getWrappedType();
500 500
                                 }
@@ -524,19 +524,19 @@  discard block
 block discarded – undo
524 524
                         'description' => ['type' => Type::string()],
525 525
                         'args' => [
526 526
                             'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))),
527
-                            'resolve' => function (FieldDefinition $field) {
527
+                            'resolve' => function(FieldDefinition $field) {
528 528
                                 return empty($field->args) ? [] : $field->args;
529 529
                             }
530 530
                         ],
531 531
                         'type' => [
532 532
                             'type' => Type::nonNull(self::_type()),
533
-                            'resolve' => function (FieldDefinition $field) {
533
+                            'resolve' => function(FieldDefinition $field) {
534 534
                                 return $field->getType();
535 535
                             }
536 536
                         ],
537 537
                         'isDeprecated' => [
538 538
                             'type' => Type::nonNull(Type::boolean()),
539
-                            'resolve' => function (FieldDefinition $field) {
539
+                            'resolve' => function(FieldDefinition $field) {
540 540
                                 return !!$field->deprecationReason;
541 541
                             }
542 542
                         ],
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                         'description' => ['type' => Type::string()],
567 567
                         'type' => [
568 568
                             'type' => Type::nonNull(self::_type()),
569
-                            'resolve' => function ($value) {
569
+                            'resolve' => function($value) {
570 570
                                 return method_exists($value, 'getType') ? $value->getType() : $value->type;
571 571
                             }
572 572
                         ],
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                             'type' => Type::string(),
575 575
                             'description' =>
576 576
                                 'A GraphQL-formatted string representing the default value for this input value.',
577
-                            'resolve' => function ($inputValue) {
577
+                            'resolve' => function($inputValue) {
578 578
                                 /** @var FieldArgument|InputObjectField $inputValue */
579 579
                                 return !$inputValue->defaultValueExists()
580 580
                                     ? null
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                     'description' => ['type' => Type::string()],
604 604
                     'isDeprecated' => [
605 605
                         'type' => Type::nonNull(Type::boolean()),
606
-                        'resolve' => function ($enumValue) {
606
+                        'resolve' => function($enumValue) {
607 607
                             return !!$enumValue->deprecationReason;
608 608
                         }
609 609
                     ],
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
                 'type' => Type::nonNull(self::_schema()),
671 671
                 'description' => 'Access the current type schema of this server.',
672 672
                 'args' => [],
673
-                'resolve' => function (
673
+                'resolve' => function(
674 674
                     $source,
675 675
                     $args,
676 676
                     $context,
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
                 'args' => [
694 694
                     ['name' => 'name', 'type' => Type::nonNull(Type::string())]
695 695
                 ],
696
-                'resolve' => function ($source, $args, $context, ResolveInfo $info) {
696
+                'resolve' => function($source, $args, $context, ResolveInfo $info) {
697 697
                     return $info->schema->getType($args['name']);
698 698
                 }
699 699
             ]);
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
                 'type' => Type::nonNull(Type::string()),
710 710
                 'description' => 'The name of the current Object type at runtime.',
711 711
                 'args' => [],
712
-                'resolve' => function (
712
+                'resolve' => function(
713 713
                     $source,
714 714
                     $args,
715 715
                     $context,
Please login to merge, or discard this patch.
src/Type/SchemaValidationContext.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         if ($astNode instanceof SchemaDefinitionNode) {
99 99
             $operationTypeNode = null;
100 100
 
101
-            foreach($astNode->operationTypes as $operationType) {
101
+            foreach ($astNode->operationTypes as $operationType) {
102 102
                 if ($operationType->operation === $operation) {
103 103
                     $operationTypeNode = $operationType;
104 104
                     break;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function validateDirectives()
113 113
     {
114 114
         $directives = $this->schema->getDirectives();
115
-        foreach($directives as $directive) {
115
+        foreach ($directives as $directive) {
116 116
             // Ensure all directives are in fact GraphQL directives.
117 117
             if (!$directive instanceof Directive) {
118 118
                 $this->reportError(
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function validateTypes()
172 172
     {
173 173
         $typeMap = $this->schema->getTypeMap();
174
-        foreach($typeMap as $typeName => $type) {
174
+        foreach ($typeMap as $typeName => $type) {
175 175
             // Ensure all provided types are in fact GraphQL type.
176 176
             if (!$type instanceof NamedType) {
177 177
                 $this->reportError(
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
             // Ensure the arguments are valid
246 246
             $argNames = [];
247
-            foreach($field->args as $arg) {
247
+            foreach ($field->args as $arg) {
248 248
                 $argName = $arg->name;
249 249
 
250 250
                 // Ensure they are named correctly.
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                 if (!Type::isInputType($arg->getType())) {
264 264
                     $this->reportError(
265 265
                         "The type of {$type->name}.{$fieldName}({$argName}:) must be Input " .
266
-                        'Type but got: '. Utils::printSafe($arg->getType()) . '.',
266
+                        'Type but got: ' . Utils::printSafe($arg->getType()) . '.',
267 267
                         $this->getFieldArgTypeNode($type, $fieldName, $argName)
268 268
                     );
269 269
                 }
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
     private function validateObjectInterfaces(ObjectType $object) {
275 275
         $implementedTypeNames = [];
276
-        foreach($object->getInterfaces() as $iface) {
276
+        foreach ($object->getInterfaces() as $iface) {
277 277
             if (isset($implementedTypeNames[$iface->name])) {
278 278
                 $this->reportError(
279 279
                     "Type {$object->name} can only implement {$iface->name} once.",
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         if (!$iface instanceof InterfaceType) {
296 296
             $this->reportError(
297 297
                 "Type {$object->name} must only implement Interface types, " .
298
-                "it cannot implement ". Utils::printSafe($iface) . ".",
298
+                "it cannot implement " . Utils::printSafe($iface) . ".",
299 299
                 $this->getImplementsInterfaceNode($object, $iface)
300 300
             );
301 301
             return;
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                 )
331 331
             ) {
332 332
                 $this->reportError(
333
-                    "Interface field {$iface->name}.{$fieldName} expects type ".
333
+                    "Interface field {$iface->name}.{$fieldName} expects type " .
334 334
                     "{$ifaceField->getType()} but {$object->name}.{$fieldName} " .
335 335
                     "is type " . Utils::printSafe($objectField->getType()) . ".",
336 336
                     [
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
             }
342 342
 
343 343
             // Assert each interface field arg is implemented.
344
-            foreach($ifaceField->args as $ifaceArg) {
344
+            foreach ($ifaceField->args as $ifaceArg) {
345 345
                 $argName = $ifaceArg->name;
346 346
                 $objectArg = null;
347 347
 
348
-                foreach($objectField->args as $arg) {
348
+                foreach ($objectField->args as $arg) {
349 349
                     if ($arg->name === $argName) {
350 350
                         $objectArg = $arg;
351 351
                         break;
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 // TODO: change to contravariant?
371 371
                 if (!TypeComparators::isEqualType($ifaceArg->getType(), $objectArg->getType())) {
372 372
                     $this->reportError(
373
-                        "Interface field argument {$iface->name}.{$fieldName}({$argName}:) ".
373
+                        "Interface field argument {$iface->name}.{$fieldName}({$argName}:) " .
374 374
                         "expects type " . Utils::printSafe($ifaceArg->getType()) . " but " .
375 375
                         "{$object->name}.{$fieldName}({$argName}:) is type " .
376 376
                         Utils::printSafe($objectArg->getType()) . ".",
@@ -385,11 +385,11 @@  discard block
 block discarded – undo
385 385
             }
386 386
 
387 387
             // Assert additional arguments must not be required.
388
-            foreach($objectField->args as $objectArg) {
388
+            foreach ($objectField->args as $objectArg) {
389 389
                 $argName = $objectArg->name;
390 390
                 $ifaceArg = null;
391 391
 
392
-                foreach($ifaceField->args as $arg) {
392
+                foreach ($ifaceField->args as $arg) {
393 393
                     if ($arg->name === $argName) {
394 394
                         $ifaceArg = $arg;
395 395
                         break;
@@ -424,10 +424,10 @@  discard block
 block discarded – undo
424 424
 
425 425
         $includedTypeNames = [];
426 426
 
427
-        foreach($memberTypes as $memberType) {
427
+        foreach ($memberTypes as $memberType) {
428 428
             if (isset($includedTypeNames[$memberType->name])) {
429 429
                 $this->reportError(
430
-                    "Union type {$union->name} can only include type ".
430
+                    "Union type {$union->name} can only include type " .
431 431
                     "{$memberType->name} once.",
432 432
                     $this->getUnionMemberTypeNodes($union, $memberType->name)
433 433
                 );
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             $includedTypeNames[$memberType->name] = true;
437 437
             if (!$memberType instanceof ObjectType) {
438 438
                 $this->reportError(
439
-                    "Union type {$union->name} can only include Object types, ".
439
+                    "Union type {$union->name} can only include Object types, " .
440 440
                     "it cannot include " . Utils::printSafe($memberType) . ".",
441 441
                     $this->getUnionMemberTypeNodes($union, Utils::printSafe($memberType))
442 442
                 );
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             );
456 456
         }
457 457
 
458
-        foreach($enumValues as $enumValue) {
458
+        foreach ($enumValues as $enumValue) {
459 459
             $valueName = $enumValue->name;
460 460
 
461 461
             // Ensure no duplicates
@@ -541,9 +541,9 @@  discard block
 block discarded – undo
541 541
         $implementsNodes = [];
542 542
         $astNodes = $this->getAllObjectOrInterfaceNodes($type);
543 543
 
544
-        foreach($astNodes as $astNode) {
544
+        foreach ($astNodes as $astNode) {
545 545
             if ($astNode && $astNode->interfaces) {
546
-                foreach($astNode->interfaces as $node) {
546
+                foreach ($astNode->interfaces as $node) {
547 547
                     if ($node->name->value === $iface->name) {
548 548
                         $implementsNodes[] = $node;
549 549
                     }
@@ -574,9 +574,9 @@  discard block
 block discarded – undo
574 574
     {
575 575
         $fieldNodes = [];
576 576
         $astNodes = $this->getAllObjectOrInterfaceNodes($type);
577
-        foreach($astNodes as $astNode) {
577
+        foreach ($astNodes as $astNode) {
578 578
             if ($astNode && $astNode->fields) {
579
-                foreach($astNode->fields as $node) {
579
+                foreach ($astNode->fields as $node) {
580 580
                     if ($node->name->value === $fieldName) {
581 581
                         $fieldNodes[] = $node;
582 582
                     }
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
         $argNodes = [];
652 652
         $directiveNode = $directive->astNode;
653 653
         if ($directiveNode && $directiveNode->arguments) {
654
-            foreach($directiveNode->arguments as $node) {
654
+            foreach ($directiveNode->arguments as $node) {
655 655
                 if ($node->name->value === $argName) {
656 656
                     $argNodes[] = $node;
657 657
                 }
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
         if ($union->astNode && $union->astNode->types) {
683 683
             return array_filter(
684 684
                 $union->astNode->types,
685
-                function (NamedTypeNode $value) use ($typeName) {
685
+                function(NamedTypeNode $value) use ($typeName) {
686 686
                     return $value->name->value === $typeName;
687 687
                 }
688 688
             );
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         if ($enum->astNode && $enum->astNode->values) {
702 702
             return array_filter(
703 703
                 iterator_to_array($enum->astNode->values),
704
-                function (EnumValueDefinitionNode $value) use ($valueName) {
704
+                function(EnumValueDefinitionNode $value) use ($valueName) {
705 705
                     return $value->name->value === $valueName;
706 706
                 }
707 707
             );
Please login to merge, or discard this patch.
src/Type/Schema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 if (isset($this->resolvedTypes[$type->name])) {
125 125
                     Utils::invariant(
126 126
                         $type === $this->resolvedTypes[$type->name],
127
-                        "Schema must contain unique named types but contains multiple types named \"$type\" ".
127
+                        "Schema must contain unique named types but contains multiple types named \"$type\" " .
128 128
                         "(see http://webonyx.github.io/graphql-php/type-system/#type-registry)."
129 129
                     );
130 130
                 }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         $internalTypes = Type::getInternalTypes() + Introspection::getTypes();
444 444
         foreach ($this->getTypeMap() as $name => $type) {
445 445
             if (isset($internalTypes[$name])) {
446
-                continue ;
446
+                continue;
447 447
             }
448 448
 
449 449
             $type->assertValid();
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             if ($this->config->typeLoader) {
453 453
                 Utils::invariant(
454 454
                     $this->loadType($name) === $type,
455
-                    "Type loader returns different instance for {$name} than field/argument definitions. ".
455
+                    "Type loader returns different instance for {$name} than field/argument definitions. " .
456 456
                     'Make sure you always return the same instance for the same type name.'
457 457
                 );
458 458
             }
Please login to merge, or discard this patch.
src/Validator/Rules/NoUnusedFragments.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
                         if (empty($fragmentNameUsed[$fragName])) {
48 48
                             $context->reportError(new Error(
49 49
                                 self::unusedFragMessage($fragName),
50
-                                [ $fragmentDef ]
50
+                                [$fragmentDef]
51 51
                             ));
52 52
                         }
53 53
                     }
Please login to merge, or discard this patch.
src/Validator/Rules/ExecutableDefinitions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function getVisitor(ValidationContext $context)
27 27
     {
28 28
         return [
29
-            NodeKind::DOCUMENT => function (DocumentNode $node) use ($context) {
29
+            NodeKind::DOCUMENT => function(DocumentNode $node) use ($context) {
30 30
                 /** @var Node $definition */
31 31
                 foreach ($node->definitions as $definition) {
32 32
                     if (
Please login to merge, or discard this patch.