Completed
Pull Request — master (#258)
by Sam
06:26
created
src/Language/Node/ArgumentsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function getArgumentsAST(): array
32 32
     {
33
-        return \array_map(function (ArgumentNode $node) {
33
+        return \array_map(function(ArgumentNode $node) {
34 34
             return $node->toAST();
35 35
         }, $this->getArguments());
36 36
     }
Please login to merge, or discard this patch.
src/Type/ScalarTypesProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function register()
35 35
     {
36
-        $this->container->add(GraphQL::BOOLEAN, function (BooleanCoercer $coercer) {
36
+        $this->container->add(GraphQL::BOOLEAN, function(BooleanCoercer $coercer) {
37 37
             return newScalarType([
38 38
                 'name'         => TypeNameEnum::BOOLEAN,
39 39
                 'description'  => 'The `Boolean` scalar type represents `true` or `false`.',
40
-                'serialize'    => function ($value) use ($coercer) {
40
+                'serialize'    => function($value) use ($coercer) {
41 41
                     return $coercer->coerce($value);
42 42
                 },
43
-                'parseValue'   => function ($value) use ($coercer) {
43
+                'parseValue'   => function($value) use ($coercer) {
44 44
                     return $coercer->coerce($value);
45 45
                 },
46
-                'parseLiteral' => function (NodeInterface $node) {
46
+                'parseLiteral' => function(NodeInterface $node) {
47 47
                     if ($node instanceof BooleanValueNode) {
48 48
                         return $node->getValue();
49 49
                     }
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
         }, true/* $shared */)
54 54
             ->withArgument(BooleanCoercer::class);
55 55
 
56
-        $this->container->add(GraphQL::FLOAT, function (FloatCoercer $coercer) {
56
+        $this->container->add(GraphQL::FLOAT, function(FloatCoercer $coercer) {
57 57
             return newScalarType([
58 58
                 'name'         => TypeNameEnum::FLOAT,
59 59
                 'description'  =>
60 60
                     'The `Float` scalar type represents signed double-precision fractional ' .
61 61
                     'values as specified by ' .
62 62
                     '[IEEE 754](https://en.wikipedia.org/wiki/IEEE_754).',
63
-                'serialize'    => function ($value) use ($coercer) {
63
+                'serialize'    => function($value) use ($coercer) {
64 64
                     return $coercer->coerce($value);
65 65
                 },
66
-                'parseValue'   => function ($value) use ($coercer) {
66
+                'parseValue'   => function($value) use ($coercer) {
67 67
                     return $coercer->coerce($value);
68 68
                 },
69
-                'parseLiteral' => function (NodeInterface $node) {
69
+                'parseLiteral' => function(NodeInterface $node) {
70 70
                     if ($node instanceof FloatValueNode || $node instanceof IntValueNode) {
71 71
                         return $node->getValue();
72 72
                     }
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
         }, true/* $shared */)
77 77
             ->withArgument(FloatCoercer::class);
78 78
 
79
-        $this->container->add(GraphQL::INT, function (IntCoercer $coercer) {
79
+        $this->container->add(GraphQL::INT, function(IntCoercer $coercer) {
80 80
             return newScalarType([
81 81
                 'name'         => TypeNameEnum::INT,
82 82
                 'description'  =>
83 83
                     'The `Int` scalar type represents non-fractional signed whole numeric ' .
84 84
                     'values. Int can represent values between -(2^31) and 2^31 - 1.',
85
-                'serialize'    => function ($value) use ($coercer) {
85
+                'serialize'    => function($value) use ($coercer) {
86 86
                     return $coercer->coerce($value);
87 87
                 },
88
-                'parseValue'   => function ($value) use ($coercer) {
88
+                'parseValue'   => function($value) use ($coercer) {
89 89
                     return $coercer->coerce($value);
90 90
                 },
91
-                'parseLiteral' => function (NodeInterface $node) {
91
+                'parseLiteral' => function(NodeInterface $node) {
92 92
                     if ($node instanceof IntValueNode) {
93 93
                         $value = (int)$node->getValue();
94 94
                         if ((string)$node->getValue() === (string)$value &&
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }, true/* $shared */)
103 103
             ->withArgument(IntCoercer::class);
104 104
 
105
-        $this->container->add(GraphQL::ID, function (StringCoercer $coercer) {
105
+        $this->container->add(GraphQL::ID, function(StringCoercer $coercer) {
106 106
             return newScalarType([
107 107
                 'name'         => TypeNameEnum::ID,
108 108
                 'description'  =>
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
                     'response as a String; however, it is not intended to be human-readable. ' .
112 112
                     'When expected as an input type, any string (such as `"4"`) or integer ' .
113 113
                     '(such as `4`) input value will be accepted as an ID.',
114
-                'serialize'    => function ($value) use ($coercer) {
114
+                'serialize'    => function($value) use ($coercer) {
115 115
                     return $coercer->coerce($value);
116 116
                 },
117
-                'parseValue'   => function ($value) use ($coercer) {
117
+                'parseValue'   => function($value) use ($coercer) {
118 118
                     return $coercer->coerce($value);
119 119
                 },
120
-                'parseLiteral' => function (NodeInterface $node) {
120
+                'parseLiteral' => function(NodeInterface $node) {
121 121
                     if ($node instanceof StringValueNode || $node instanceof IntValueNode) {
122 122
                         return $node->getValue();
123 123
                     }
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
         }, true/* $shared */)
128 128
             ->withArgument(StringCoercer::class);
129 129
 
130
-        $this->container->add(GraphQL::STRING, function (StringCoercer $coercer) {
130
+        $this->container->add(GraphQL::STRING, function(StringCoercer $coercer) {
131 131
             return newScalarType([
132 132
                 'name'         => TypeNameEnum::STRING,
133 133
                 'description'  =>
134 134
                     'The `String` scalar type represents textual data, represented as UTF-8 ' .
135 135
                     'character sequences. The String type is most often used by GraphQL to ' .
136 136
                     'represent free-form human-readable text.',
137
-                'serialize'    => function ($value) use ($coercer) {
137
+                'serialize'    => function($value) use ($coercer) {
138 138
                     return $coercer->coerce($value);
139 139
                 },
140
-                'parseValue'   => function ($value) use ($coercer) {
140
+                'parseValue'   => function($value) use ($coercer) {
141 141
                     return $coercer->coerce($value);
142 142
                 },
143
-                'parseLiteral' => function (NodeInterface $node) {
143
+                'parseLiteral' => function(NodeInterface $node) {
144 144
                     if ($node instanceof StringValueNode) {
145 145
                         return $node->getValue();
146 146
                     }
Please login to merge, or discard this patch.
src/Language/Parser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         /**
315 315
          * @return TypeNodeInterface
316 316
          */
317
-        $parseType = function (): TypeNodeInterface {
317
+        $parseType = function(): TypeNodeInterface {
318 318
             $this->expect(TokenKindEnum::COLON);
319 319
             return $this->lexType();
320 320
         };
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
         /**
426 426
          * @return ArgumentNode
427 427
          */
428
-        $parseFunction = function () use ($isConst): ArgumentNode {
428
+        $parseFunction = function() use ($isConst) : ArgumentNode {
429 429
             return $this->lexArgument($isConst);
430 430
         };
431 431
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         /**
453 453
          * @return NodeInterface|TypeNodeInterface|ValueNodeInterface
454 454
          */
455
-        $parseValue = function () use ($isConst): NodeInterface {
455
+        $parseValue = function() use ($isConst): NodeInterface {
456 456
             $this->expect(TokenKindEnum::COLON);
457 457
             return $this->lexValue($isConst);
458 458
         };
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 
522 522
         $this->expectKeyword(KeywordEnum::FRAGMENT);
523 523
 
524
-        $parseTypeCondition = function () {
524
+        $parseTypeCondition = function() {
525 525
             $this->expectKeyword(KeywordEnum::ON);
526 526
             return $this->lexNamedType();
527 527
         };
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
     {
652 652
         $start = $this->lexer->getToken();
653 653
 
654
-        $parseFunction = function () use ($isConst) {
654
+        $parseFunction = function() use ($isConst) {
655 655
             return $this->lexValue($isConst);
656 656
         };
657 657
 
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
          * @param bool $isConst
705 705
          * @return NodeInterface|TypeNodeInterface|ValueNodeInterface
706 706
          */
707
-        $parseValue = function (bool $isConst): NodeInterface {
707
+        $parseValue = function(bool $isConst): NodeInterface {
708 708
             $this->expect(TokenKindEnum::COLON);
709 709
             return $this->lexValue($isConst);
710 710
         };
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
      */
1048 1048
     protected function lexArgumentsDefinition(): array
1049 1049
     {
1050
-        $parseFunction = function (): InputValueDefinitionNode {
1050
+        $parseFunction = function(): InputValueDefinitionNode {
1051 1051
             return $this->lexInputValueDefinition();
1052 1052
         };
1053 1053
 
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
      */
1254 1254
     protected function lexInputFieldsDefinition(): array
1255 1255
     {
1256
-        $parseFunction = function (): InputValueDefinitionNode {
1256
+        $parseFunction = function(): InputValueDefinitionNode {
1257 1257
             return $this->lexInputValueDefinition();
1258 1258
         };
1259 1259
 
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
 
1558 1558
         $name = $this->lexName();
1559 1559
 
1560
-        if (arraySome(DirectiveLocationEnum::values(), function ($value) use ($name) {
1560
+        if (arraySome(DirectiveLocationEnum::values(), function($value) use ($name) {
1561 1561
             return $name->getValue() === $value;
1562 1562
         })) {
1563 1563
             return $name;
Please login to merge, or discard this patch.
src/Execution/ExecutionResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $array = [];
67 67
 
68 68
         if (!empty($this->errors)) {
69
-            $array['errors'] = \array_map(function (GraphQLException $error) {
69
+            $array['errors'] = \array_map(function(GraphQLException $error) {
70 70
                 return $error->toArray();
71 71
             }, $this->errors);
72 72
         }
Please login to merge, or discard this patch.
src/Util/TypeInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
         ?TypeInterface $initialType = null
78 78
     ) {
79 79
         $this->schema                     = $schema;
80
-        $this->getFieldDefinitionFunction = $getFieldDefinitionFunction ?? function (
80
+        $this->getFieldDefinitionFunction = $getFieldDefinitionFunction ?? function(
81 81
                 Schema $schema,
82 82
                 TypeInterface $parentType,
83 83
                 FieldNode $fieldNode
Please login to merge, or discard this patch.
src/Type/IntrospectionProvider.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     protected function registerIntrospectionTypes()
59 59
     {
60
-        $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function () {
60
+        $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function() {
61 61
             return newObjectType([
62 62
                 'name'            => GraphQL::SCHEMA_INTROSPECTION,
63 63
                 'isIntrospection' => true,
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
                     'A GraphQL Schema defines the capabilities of a GraphQL server. It ' .
66 66
                     'exposes all available types and directives on the server, as well as ' .
67 67
                     'the entry points for query, mutation, and subscription operations.',
68
-                'fields'          => function () {
68
+                'fields'          => function() {
69 69
                     return [
70 70
                         'types'            => [
71 71
                             'description' => 'A list of all types supported by this server.',
72 72
                             'type'        => newNonNull(newList(newNonNull(__Type()))),
73
-                            'resolve'     => function (Schema $schema): array {
73
+                            'resolve'     => function(Schema $schema): array {
74 74
                                 return array_values($schema->getTypeMap());
75 75
                             },
76 76
                         ],
77 77
                         'queryType'        => [
78 78
                             'description' => 'The type that query operations will be rooted at.',
79 79
                             'type'        => newNonNull(__Type()),
80
-                            'resolve'     => function (Schema $schema): ?TypeInterface {
80
+                            'resolve'     => function(Schema $schema): ?TypeInterface {
81 81
                                 return $schema->getQueryType();
82 82
                             },
83 83
                         ],
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                                 'If this server supports mutation, the type that ' .
87 87
                                 'mutation operations will be rooted at.',
88 88
                             'type'        => __Type(),
89
-                            'resolve'     => function (Schema $schema): ?TypeInterface {
89
+                            'resolve'     => function(Schema $schema): ?TypeInterface {
90 90
                                 return $schema->getMutationType();
91 91
                             },
92 92
                         ],
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
                                 'If this server support subscription, the type that ' .
96 96
                                 'subscription operations will be rooted at.',
97 97
                             'type'        => __Type(),
98
-                            'resolve'     => function (Schema $schema): ?TypeInterface {
98
+                            'resolve'     => function(Schema $schema): ?TypeInterface {
99 99
                                 return $schema->getSubscriptionType();
100 100
                             },
101 101
                         ],
102 102
                         'directives'       => [
103 103
                             'description' => 'A list of all directives supported by this server.',
104 104
                             'type'        => newNonNull(newList(newNonNull(__Directive()))),
105
-                            'resolve'     => function (Schema $schema): array {
105
+                            'resolve'     => function(Schema $schema): array {
106 106
                                 return $schema->getDirectives();
107 107
                             },
108 108
                         ],
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             ]);
112 112
         }, true/* $shared */);
113 113
 
114
-        $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function () {
114
+        $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function() {
115 115
             return newObjectType([
116 116
                 'name'            => GraphQL::DIRECTIVE_INTROSPECTION,
117 117
                 'isIntrospection' => true,
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     'execution behavior in ways field arguments will not suffice, such as ' .
123 123
                     'conditionally including or skipping a field. Directives provide this by ' .
124 124
                     'describing additional information to the executor.',
125
-                'fields'          => function () {
125
+                'fields'          => function() {
126 126
                     return [
127 127
                         'name'        => ['type' => newNonNull(String())],
128 128
                         'description' => ['type' => String()],
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                         ],
132 132
                         'args'        => [
133 133
                             'type'    => newNonNull(newList(newNonNull(__InputValue()))),
134
-                            'resolve' => function (Directive $directive): array {
134
+                            'resolve' => function(Directive $directive): array {
135 135
                                 return $directive->getArguments() ?: [];
136 136
                             },
137 137
                         ],
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             ]);
141 141
         }, true/* $shared */);
142 142
 
143
-        $this->container->add(GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, function () {
143
+        $this->container->add(GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, function() {
144 144
             return newEnumType([
145 145
                 'name'            => GraphQL::DIRECTIVE_LOCATION_INTROSPECTION,
146 146
                 'isIntrospection' => true,
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             ]);
207 207
         }, true/* $shared */);
208 208
 
209
-        $this->container->add(GraphQL::TYPE_INTROSPECTION, function () {
209
+        $this->container->add(GraphQL::TYPE_INTROSPECTION, function() {
210 210
             return newObjectType([
211 211
                 'name'            => GraphQL::TYPE_INTROSPECTION,
212 212
                 'isIntrospection' => true,
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
                     'Object and Interface types provide the fields they describe. Abstract ' .
220 220
                     'types, Union and Interface, provide the Object types possible ' .
221 221
                     'at runtime. List and NonNull types compose other types.',
222
-                'fields'          => function () {
222
+                'fields'          => function() {
223 223
                     return [
224 224
                         'kind'          => [
225 225
                             'type'    => newNonNull(__TypeKind()),
226
-                            'resolve' => function (TypeInterface $type) {
226
+                            'resolve' => function(TypeInterface $type) {
227 227
                                 if ($type instanceof ScalarType) {
228 228
                                     return TypeKindEnum::SCALAR;
229 229
                                 }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                             'args'    => [
260 260
                                 'includeDeprecated' => ['type' => Boolean(), 'defaultValue' => false],
261 261
                             ],
262
-                            'resolve' => function (TypeInterface $type, array $args):
262
+                            'resolve' => function(TypeInterface $type, array $args):
263 263
                             ?array {
264 264
                                 ['includeDeprecated' => $includeDeprecated] = $args;
265 265
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                                     $fields = array_values($type->getFields());
268 268
 
269 269
                                     if (!$includeDeprecated) {
270
-                                        $fields = array_filter($fields, function (Field $field) {
270
+                                        $fields = array_filter($fields, function(Field $field) {
271 271
                                             return !$field->isDeprecated();
272 272
                                         });
273 273
                                     }
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
                         ],
281 281
                         'interfaces'    => [
282 282
                             'type'    => newList(newNonNull(__Type())),
283
-                            'resolve' => function (TypeInterface $type): ?array {
283
+                            'resolve' => function(TypeInterface $type): ?array {
284 284
                                 return $type instanceof ObjectType ? $type->getInterfaces() : null;
285 285
                             },
286 286
                         ],
287 287
                         'possibleTypes' => [
288 288
                             'type'    => newList(newNonNull(__Type())),
289
-                            'resolve' => function (
289
+                            'resolve' => function(
290 290
                                 TypeInterface $type,
291 291
                                 array $args,
292 292
                                 array $context,
@@ -304,14 +304,14 @@  discard block
 block discarded – undo
304 304
                             'args'    => [
305 305
                                 'includeDeprecated' => ['type' => Boolean(), 'defaultValue' => false],
306 306
                             ],
307
-                            'resolve' => function (TypeInterface $type, array $args): ?array {
307
+                            'resolve' => function(TypeInterface $type, array $args): ?array {
308 308
                                 ['includeDeprecated' => $includeDeprecated] = $args;
309 309
 
310 310
                                 if ($type instanceof EnumType) {
311 311
                                     $values = array_values($type->getValues());
312 312
 
313 313
                                     if (!$includeDeprecated) {
314
-                                        $values = array_filter($values, function (Field $field) {
314
+                                        $values = array_filter($values, function(Field $field) {
315 315
                                             return !$field->isDeprecated();
316 316
                                         });
317 317
                                     }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                         ],
325 325
                         'inputFields'   => [
326 326
                             'type'    => newList(newNonNull(__InputValue())),
327
-                            'resolve' => function (TypeInterface $type): ?array {
327
+                            'resolve' => function(TypeInterface $type): ?array {
328 328
                                 return $type instanceof InputObjectType ? $type->getFields() : null;
329 329
                             },
330 330
                         ],
@@ -334,20 +334,20 @@  discard block
 block discarded – undo
334 334
             ]);
335 335
         }, true/* $shared */);
336 336
 
337
-        $this->container->add(GraphQL::FIELD_INTROSPECTION, function () {
337
+        $this->container->add(GraphQL::FIELD_INTROSPECTION, function() {
338 338
             return newObjectType([
339 339
                 'name'            => GraphQL::FIELD_INTROSPECTION,
340 340
                 'isIntrospection' => true,
341 341
                 'description'     =>
342 342
                     'Object and Interface types are described by a list of Fields, each of ' .
343 343
                     'which has a name, potentially a list of arguments, and a return type.',
344
-                'fields'          => function () {
344
+                'fields'          => function() {
345 345
                     return [
346 346
                         'name'              => ['type' => newNonNull(String())],
347 347
                         'description'       => ['type' => String()],
348 348
                         'args'              => [
349 349
                             'type'    => newNonNull(newList(newNonNull(__InputValue()))),
350
-                            'resolve' => function (ArgumentsAwareInterface $directive): array {
350
+                            'resolve' => function(ArgumentsAwareInterface $directive): array {
351 351
                                 return $directive->getArguments() ?? [];
352 352
                             },
353 353
                         ],
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             ]);
360 360
         }, true/* $shared */);
361 361
 
362
-        $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function () {
362
+        $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function() {
363 363
             return newObjectType([
364 364
                 'name'            => GraphQL::INPUT_VALUE_INTROSPECTION,
365 365
                 'isIntrospection' => true,
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     'Arguments provided to Fields or Directives and the input fields of an ' .
368 368
                     'InputObject are represented as Input Values which describe their type ' .
369 369
                     'and optionally a default value.',
370
-                'fields'          => function () {
370
+                'fields'          => function() {
371 371
                     return [
372 372
                         'name'         => ['type' => newNonNull(String())],
373 373
                         'description'  => ['type' => String()],
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                             'description' =>
378 378
                                 'A GraphQL-formatted string representing the default value for this ' .
379 379
                                 'input value.',
380
-                            'resolve'     => function ($inputValue) {
380
+                            'resolve'     => function($inputValue) {
381 381
                                 // TODO: Implement this when we have support for printing AST.
382 382
                                 return null;
383 383
                             }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             ]);
388 388
         }, true/* $shared */);
389 389
 
390
-        $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function () {
390
+        $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function() {
391 391
             return newObjectType([
392 392
                 'name'            => GraphQL::ENUM_VALUE_INTROSPECTION,
393 393
                 'isIntrospection' => true,
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                     'One possible value for a given Enum. Enum values are unique values, not ' .
396 396
                     'a placeholder for a string or numeric value. However an Enum value is ' .
397 397
                     'returned in a JSON response as a string.',
398
-                'fields'          => function () {
398
+                'fields'          => function() {
399 399
                     return [
400 400
                         'name'              => ['type' => newNonNull(String())],
401 401
                         'description'       => ['type' => String()],
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             ]);
407 407
         }, true/* $shared */);
408 408
 
409
-        $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function () {
409
+        $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function() {
410 410
             return newEnumType([
411 411
                 'name'            => GraphQL::TYPE_KIND_INTROSPECTION,
412 412
                 'isIntrospection' => true,
@@ -446,25 +446,25 @@  discard block
 block discarded – undo
446 446
      */
447 447
     protected function registerMetaFields()
448 448
     {
449
-        $this->container->add(GraphQL::SCHEMA_META_FIELD_DEFINITION, function ($__Schema) {
449
+        $this->container->add(GraphQL::SCHEMA_META_FIELD_DEFINITION, function($__Schema) {
450 450
             return newField([
451 451
                 'name'        => '__schema',
452 452
                 'description' => 'Access the current type schema of this server.',
453 453
                 'type'        => newNonNull($__Schema),
454
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): Schema {
454
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): Schema {
455 455
                     return $info->getSchema();
456 456
                 },
457 457
             ]);
458 458
         })
459 459
             ->withArgument(GraphQL::SCHEMA_INTROSPECTION);
460 460
 
461
-        $this->container->add(GraphQL::TYPE_META_FIELD_DEFINITION, function ($__Type) {
461
+        $this->container->add(GraphQL::TYPE_META_FIELD_DEFINITION, function($__Type) {
462 462
             return newField([
463 463
                 'name'        => '__type',
464 464
                 'description' => 'Request the type information of a single type.',
465 465
                 'type'        => $__Type,
466 466
                 'args'        => ['name' => ['type' => newNonNull(String())]],
467
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): TypeInterface {
467
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): TypeInterface {
468 468
                     ['name' => $name] = $args;
469 469
                     return $info->getSchema()->getType($name);
470 470
                 },
@@ -472,12 +472,12 @@  discard block
 block discarded – undo
472 472
         })
473 473
             ->withArgument(GraphQL::TYPE_INTROSPECTION);
474 474
 
475
-        $this->container->add(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function () {
475
+        $this->container->add(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function() {
476 476
             return newField([
477 477
                 'name'        => '__typename',
478 478
                 'description' => 'The name of the current Object type at runtime.',
479 479
                 'type'        => newNonNull(String()),
480
-                'resolve'     => function ($source, $args, $context, ResolveInfo $info): string {
480
+                'resolve'     => function($source, $args, $context, ResolveInfo $info): string {
481 481
                     return $info->getParentType()->getName();
482 482
                 },
483 483
             ]);
Please login to merge, or discard this patch.
src/Schema/utils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
 function printLines(array $lines): string
75 75
 {
76 76
     // Don't print empty lines
77
-    $lines = \array_filter($lines, function (string $line) {
77
+    $lines = \array_filter($lines, function(string $line) {
78 78
         return $line !== '';
79 79
     });
80 80
     
Please login to merge, or discard this patch.
src/Schema/DefinitionPrinter.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
         return $this->printFilteredSchema(
48 48
             $schema,
49
-            function (Directive $directive): bool {
49
+            function(Directive $directive): bool {
50 50
                 return !isSpecifiedDirective($directive);
51 51
             },
52
-            function (TypeInterface $type): bool {
52
+            function(TypeInterface $type): bool {
53 53
                 return !isSpecifiedScalarType($type) && !isIntrospectionType($type);
54 54
             }
55 55
         );
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 
67 67
         return $this->printFilteredSchema(
68 68
             $schema,
69
-            function (Directive $directive): bool {
69
+            function(Directive $directive): bool {
70 70
                 return isSpecifiedDirective($directive);
71 71
             },
72
-            function (TypeInterface $type): bool {
72
+            function(TypeInterface $type): bool {
73 73
                 return isIntrospectionType($type);
74 74
             }
75 75
         );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         $types = \array_filter(\array_values($schema->getTypeMap()), $filter);
137 137
 
138
-        \usort($types, function (NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
138
+        \usort($types, function(NamedTypeInterface $typeA, NamedTypeInterface $typeB) {
139 139
             return \strcasecmp($typeA->getName(), $typeB->getName());
140 140
         });
141 141
 
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
         $description = $this->printDescription($type);
262 262
         $name        = $type->getName();
263 263
         $implements  = $type->hasInterfaces()
264
-            ? ' implements ' . printArray(' & ', \array_map(function (InterfaceType $interface) {
264
+            ? ' implements ' . printArray(' & ', \array_map(function(InterfaceType $interface) {
265 265
                 return $interface->getName();
266 266
             }, $type->getInterfaces()))
267 267
             : '';
268
-        $fields      = $this->printFields($type->getFields());
268
+        $fields = $this->printFields($type->getFields());
269 269
 
270 270
         return printLines([
271 271
             $description,
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
     protected function printEnumValues(array $values): string
331 331
     {
332
-        return printLines(\array_map(function (EnumValue $value): string {
332
+        return printLines(\array_map(function(EnumValue $value): string {
333 333
             $description = $this->printDescription($value, '  ');
334 334
             $name        = $value->getName();
335 335
             $deprecated  = $this->printDeprecated($value);
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     protected function printInputObjectType(InputObjectType $type): string
351 351
     {
352 352
         $description = $this->printDescription($type);
353
-        $fields      = \array_map(function (InputField $field): string {
353
+        $fields      = \array_map(function(InputField $field): string {
354 354
             $description = $this->printDescription($field, '  ');
355 355
             $inputValue  = $this->printInputValue($field);
356 356
             return printLines([
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      */
389 389
     protected function printFields(array $fields): string
390 390
     {
391
-        return printLines(\array_map(function (Field $field): string {
391
+        return printLines(\array_map(function(Field $field): string {
392 392
             $description = $this->printDescription($field);
393 393
             $name        = $field->getName();
394 394
             $arguments   = $this->printArguments($field->getArguments());
@@ -408,15 +408,15 @@  discard block
 block discarded – undo
408 408
         }
409 409
 
410 410
         // If every arg does not have a description, print them on one line.
411
-        if (arrayEvery($arguments, function (Argument $argument): bool {
411
+        if (arrayEvery($arguments, function(Argument $argument): bool {
412 412
             return !$argument->hasDescription();
413 413
         })) {
414
-            return printInputFields(\array_map(function (Argument $argument) {
414
+            return printInputFields(\array_map(function(Argument $argument) {
415 415
                 return $this->printInputValue($argument);
416 416
             }, $arguments));
417 417
         }
418 418
 
419
-        $args = \array_map(function (Argument $argument) use ($indentation) {
419
+        $args = \array_map(function(Argument $argument) use ($indentation) {
420 420
             $description = $this->printDescription($argument);
421 421
             $inputValue  = $this->printInputValue($argument);
422 422
             return printLines([
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
      */
542 542
     protected function printMany(array $definitions): array
543 543
     {
544
-        return \array_map(function ($definition) {
544
+        return \array_map(function($definition) {
545 545
             return $this->print($definition);
546 546
         }, $definitions);
547 547
     }
Please login to merge, or discard this patch.