@@ -24,6 +24,6 @@ |
||
24 | 24 | */ |
25 | 25 | public function __toString(): string |
26 | 26 | { |
27 | - return '['.(string)$this->getOfType().']'; |
|
27 | + return '[' . (string)$this->getOfType() . ']'; |
|
28 | 28 | } |
29 | 29 | } |
@@ -58,20 +58,20 @@ discard block |
||
58 | 58 | */ |
59 | 59 | protected function registerIntrospectionTypes() |
60 | 60 | { |
61 | - $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function () { |
|
61 | + $this->container->add(GraphQL::SCHEMA_INTROSPECTION, function() { |
|
62 | 62 | return newObjectType([ |
63 | 63 | 'name' => GraphQL::SCHEMA_INTROSPECTION, |
64 | 64 | 'isIntrospection' => true, |
65 | 65 | 'description' => |
66 | - 'A GraphQL Schema defines the capabilities of a GraphQL server. It '. |
|
67 | - 'exposes all available types and directives on the server, as well as '. |
|
66 | + 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' . |
|
67 | + 'exposes all available types and directives on the server, as well as ' . |
|
68 | 68 | 'the entry points for query, mutation, and subscription operations.', |
69 | - 'fields' => function () { |
|
69 | + 'fields' => function() { |
|
70 | 70 | return [ |
71 | 71 | 'types' => [ |
72 | 72 | 'description' => 'A list of all types supported by this server.', |
73 | 73 | 'type' => newNonNull(newList(newNonNull(__Type()))), |
74 | - 'resolve' => function (SchemaInterface $schema |
|
74 | + 'resolve' => function(SchemaInterface $schema |
|
75 | 75 | ): array { |
76 | 76 | return array_values($schema->getTypeMap()); |
77 | 77 | }, |
@@ -79,27 +79,27 @@ discard block |
||
79 | 79 | 'queryType' => [ |
80 | 80 | 'description' => 'The type that query operations will be rooted at.', |
81 | 81 | 'type' => newNonNull(__Type()), |
82 | - 'resolve' => function (SchemaInterface $schema |
|
82 | + 'resolve' => function(SchemaInterface $schema |
|
83 | 83 | ): ?TypeInterface { |
84 | 84 | return $schema->getQueryType(); |
85 | 85 | }, |
86 | 86 | ], |
87 | 87 | 'mutationType' => [ |
88 | 88 | 'description' => |
89 | - 'If this server supports mutation, the type that '. |
|
89 | + 'If this server supports mutation, the type that ' . |
|
90 | 90 | 'mutation operations will be rooted at.', |
91 | 91 | 'type' => __Type(), |
92 | - 'resolve' => function (SchemaInterface $schema |
|
92 | + 'resolve' => function(SchemaInterface $schema |
|
93 | 93 | ): ?TypeInterface { |
94 | 94 | return $schema->getMutationType(); |
95 | 95 | }, |
96 | 96 | ], |
97 | 97 | 'subscriptionType' => [ |
98 | 98 | 'description' => |
99 | - 'If this server support subscription, the type that '. |
|
99 | + 'If this server support subscription, the type that ' . |
|
100 | 100 | 'subscription operations will be rooted at.', |
101 | 101 | 'type' => __Type(), |
102 | - 'resolve' => function (SchemaInterface $schema |
|
102 | + 'resolve' => function(SchemaInterface $schema |
|
103 | 103 | ): ?TypeInterface { |
104 | 104 | return $schema->getSubscriptionType(); |
105 | 105 | }, |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'directives' => [ |
108 | 108 | 'description' => 'A list of all directives supported by this server.', |
109 | 109 | 'type' => newNonNull(newList(newNonNull(__Directive()))), |
110 | - 'resolve' => function (SchemaInterface $schema |
|
110 | + 'resolve' => function(SchemaInterface $schema |
|
111 | 111 | ): array { |
112 | 112 | return $schema->getDirectives(); |
113 | 113 | }, |
@@ -117,18 +117,18 @@ discard block |
||
117 | 117 | ]); |
118 | 118 | }, true/* $shared */); |
119 | 119 | |
120 | - $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function () { |
|
120 | + $this->container->add(GraphQL::DIRECTIVE_INTROSPECTION, function() { |
|
121 | 121 | return newObjectType([ |
122 | 122 | 'name' => GraphQL::DIRECTIVE_INTROSPECTION, |
123 | 123 | 'isIntrospection' => true, |
124 | 124 | 'description' => |
125 | - 'A Directive provides a way to describe alternate runtime execution and '. |
|
126 | - 'type validation behavior in a GraphQL document.'. |
|
127 | - "\n\nIn some cases, you need to provide options to alter GraphQL's ". |
|
128 | - 'execution behavior in ways field arguments will not suffice, such as '. |
|
129 | - 'conditionally including or skipping a field. Directives provide this by '. |
|
125 | + 'A Directive provides a way to describe alternate runtime execution and ' . |
|
126 | + 'type validation behavior in a GraphQL document.' . |
|
127 | + "\n\nIn some cases, you need to provide options to alter GraphQL's " . |
|
128 | + 'execution behavior in ways field arguments will not suffice, such as ' . |
|
129 | + 'conditionally including or skipping a field. Directives provide this by ' . |
|
130 | 130 | 'describing additional information to the executor.', |
131 | - 'fields' => function () { |
|
131 | + 'fields' => function() { |
|
132 | 132 | return [ |
133 | 133 | 'name' => ['type' => newNonNull(String())], |
134 | 134 | 'description' => ['type' => String()], |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ], |
138 | 138 | 'args' => [ |
139 | 139 | 'type' => newNonNull(newList(newNonNull(__InputValue()))), |
140 | - 'resolve' => function (DirectiveInterface $directive |
|
140 | + 'resolve' => function(DirectiveInterface $directive |
|
141 | 141 | ): array { |
142 | 142 | return $directive->getArguments() ?: []; |
143 | 143 | }, |
@@ -148,12 +148,12 @@ discard block |
||
148 | 148 | }, true/* $shared */); |
149 | 149 | |
150 | 150 | $this->container->add(GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, |
151 | - function () { |
|
151 | + function() { |
|
152 | 152 | return newEnumType([ |
153 | 153 | 'name' => GraphQL::DIRECTIVE_LOCATION_INTROSPECTION, |
154 | 154 | 'isIntrospection' => true, |
155 | 155 | 'description' => |
156 | - 'A Directive can be adjacent to many parts of the GraphQL language, a '. |
|
156 | + 'A Directive can be adjacent to many parts of the GraphQL language, a ' . |
|
157 | 157 | '__DirectiveLocation describes one such possible adjacencies.', |
158 | 158 | 'values' => [ |
159 | 159 | DirectiveLocationEnum::QUERY => [ |
@@ -214,24 +214,24 @@ discard block |
||
214 | 214 | ]); |
215 | 215 | }, true/* $shared */); |
216 | 216 | |
217 | - $this->container->add(GraphQL::TYPE_INTROSPECTION, function () { |
|
217 | + $this->container->add(GraphQL::TYPE_INTROSPECTION, function() { |
|
218 | 218 | return newObjectType([ |
219 | 219 | 'name' => GraphQL::TYPE_INTROSPECTION, |
220 | 220 | 'isIntrospection' => true, |
221 | 221 | 'description' => |
222 | - 'The fundamental unit of any GraphQL Schema is the type. There are '. |
|
223 | - 'many kinds of types in GraphQL as represented by the `__TypeKind` enum.'. |
|
224 | - '\n\nDepending on the kind of a type, certain fields describe '. |
|
225 | - 'information about that type. Scalar types provide no information '. |
|
226 | - 'beyond a name and description, while Enum types provide their values. '. |
|
227 | - 'Object and Interface types provide the fields they describe. Abstract '. |
|
228 | - 'types, Union and Interface, provide the Object types possible '. |
|
222 | + 'The fundamental unit of any GraphQL Schema is the type. There are ' . |
|
223 | + 'many kinds of types in GraphQL as represented by the `__TypeKind` enum.' . |
|
224 | + '\n\nDepending on the kind of a type, certain fields describe ' . |
|
225 | + 'information about that type. Scalar types provide no information ' . |
|
226 | + 'beyond a name and description, while Enum types provide their values. ' . |
|
227 | + 'Object and Interface types provide the fields they describe. Abstract ' . |
|
228 | + 'types, Union and Interface, provide the Object types possible ' . |
|
229 | 229 | 'at runtime. List and NonNull types compose other types.', |
230 | - 'fields' => function () { |
|
230 | + 'fields' => function() { |
|
231 | 231 | return [ |
232 | 232 | 'kind' => [ |
233 | 233 | 'type' => newNonNull(__TypeKind()), |
234 | - 'resolve' => function (TypeInterface $type) { |
|
234 | + 'resolve' => function(TypeInterface $type) { |
|
235 | 235 | if ($type instanceof ScalarType) { |
236 | 236 | return TypeKindEnum::SCALAR; |
237 | 237 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | 'defaultValue' => false, |
272 | 272 | ], |
273 | 273 | ], |
274 | - 'resolve' => function ( |
|
274 | + 'resolve' => function( |
|
275 | 275 | TypeInterface $type, |
276 | 276 | array $args |
277 | 277 | ): |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | if (!$includeDeprecated) { |
285 | 285 | $fields = array_filter($fields, |
286 | - function (Field $field) { |
|
286 | + function(Field $field) { |
|
287 | 287 | return !$field->getIsDeprecated(); |
288 | 288 | }); |
289 | 289 | } |
@@ -296,14 +296,14 @@ discard block |
||
296 | 296 | ], |
297 | 297 | 'interfaces' => [ |
298 | 298 | 'type' => newList(newNonNull(__Type())), |
299 | - 'resolve' => function (TypeInterface $type |
|
299 | + 'resolve' => function(TypeInterface $type |
|
300 | 300 | ): ?array { |
301 | 301 | return $type instanceof ObjectType ? $type->getInterfaces() : null; |
302 | 302 | }, |
303 | 303 | ], |
304 | 304 | 'possibleTypes' => [ |
305 | 305 | 'type' => newList(newNonNull(__Type())), |
306 | - 'resolve' => function ( |
|
306 | + 'resolve' => function( |
|
307 | 307 | TypeInterface $type, |
308 | 308 | array $args, |
309 | 309 | array $context, |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | 'defaultValue' => false, |
326 | 326 | ], |
327 | 327 | ], |
328 | - 'resolve' => function ( |
|
328 | + 'resolve' => function( |
|
329 | 329 | TypeInterface $type, |
330 | 330 | array $args |
331 | 331 | ): ?array { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | if (!$includeDeprecated) { |
338 | 338 | $values = array_filter($values, |
339 | - function (Field $field) { |
|
339 | + function(Field $field) { |
|
340 | 340 | return !$field->getIsDeprecated(); |
341 | 341 | }); |
342 | 342 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | ], |
350 | 350 | 'inputFields' => [ |
351 | 351 | 'type' => newList(newNonNull(__InputValue())), |
352 | - 'resolve' => function (TypeInterface $type |
|
352 | + 'resolve' => function(TypeInterface $type |
|
353 | 353 | ): ?array { |
354 | 354 | return $type instanceof InputObjectType ? $type->getFields() : null; |
355 | 355 | }, |
@@ -360,20 +360,20 @@ discard block |
||
360 | 360 | ]); |
361 | 361 | }, true/* $shared */); |
362 | 362 | |
363 | - $this->container->add(GraphQL::FIELD_INTROSPECTION, function () { |
|
363 | + $this->container->add(GraphQL::FIELD_INTROSPECTION, function() { |
|
364 | 364 | return newObjectType([ |
365 | 365 | 'name' => GraphQL::FIELD_INTROSPECTION, |
366 | 366 | 'isIntrospection' => true, |
367 | 367 | 'description' => |
368 | - 'Object and Interface types are described by a list of Fields, each of '. |
|
368 | + 'Object and Interface types are described by a list of Fields, each of ' . |
|
369 | 369 | 'which has a name, potentially a list of arguments, and a return type.', |
370 | - 'fields' => function () { |
|
370 | + 'fields' => function() { |
|
371 | 371 | return [ |
372 | 372 | 'name' => ['type' => newNonNull(String())], |
373 | 373 | 'description' => ['type' => String()], |
374 | 374 | 'args' => [ |
375 | 375 | 'type' => newNonNull(newList(newNonNull(__InputValue()))), |
376 | - 'resolve' => function ( |
|
376 | + 'resolve' => function( |
|
377 | 377 | ArgumentsAwareInterface $directive |
378 | 378 | ): array { |
379 | 379 | return $directive->getArguments() ?? []; |
@@ -387,15 +387,15 @@ discard block |
||
387 | 387 | ]); |
388 | 388 | }, true/* $shared */); |
389 | 389 | |
390 | - $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function () { |
|
390 | + $this->container->add(GraphQL::INPUT_VALUE_INTROSPECTION, function() { |
|
391 | 391 | return newObjectType([ |
392 | 392 | 'name' => GraphQL::INPUT_VALUE_INTROSPECTION, |
393 | 393 | 'isIntrospection' => true, |
394 | 394 | 'description' => |
395 | - 'Arguments provided to Fields or Directives and the input fields of an '. |
|
396 | - 'InputObject are represented as Input Values which describe their type '. |
|
395 | + 'Arguments provided to Fields or Directives and the input fields of an ' . |
|
396 | + 'InputObject are represented as Input Values which describe their type ' . |
|
397 | 397 | 'and optionally a default value.', |
398 | - 'fields' => function () { |
|
398 | + 'fields' => function() { |
|
399 | 399 | return [ |
400 | 400 | 'name' => ['type' => newNonNull(String())], |
401 | 401 | 'description' => ['type' => String()], |
@@ -403,9 +403,9 @@ discard block |
||
403 | 403 | 'defaultValue' => [ |
404 | 404 | 'type' => String(), |
405 | 405 | 'description' => |
406 | - 'A GraphQL-formatted string representing the default value for this '. |
|
406 | + 'A GraphQL-formatted string representing the default value for this ' . |
|
407 | 407 | 'input value.', |
408 | - 'resolve' => function ($inputValue) { |
|
408 | + 'resolve' => function($inputValue) { |
|
409 | 409 | // TODO: Implement this when we have support for printing AST. |
410 | 410 | return null; |
411 | 411 | }, |
@@ -415,15 +415,15 @@ discard block |
||
415 | 415 | ]); |
416 | 416 | }, true/* $shared */); |
417 | 417 | |
418 | - $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function () { |
|
418 | + $this->container->add(GraphQL::ENUM_VALUE_INTROSPECTION, function() { |
|
419 | 419 | return newObjectType([ |
420 | 420 | 'name' => GraphQL::ENUM_VALUE_INTROSPECTION, |
421 | 421 | 'isIntrospection' => true, |
422 | 422 | 'description' => |
423 | - 'One possible value for a given Enum. Enum values are unique values, not '. |
|
424 | - 'a placeholder for a string or numeric value. However an Enum value is '. |
|
423 | + 'One possible value for a given Enum. Enum values are unique values, not ' . |
|
424 | + 'a placeholder for a string or numeric value. However an Enum value is ' . |
|
425 | 425 | 'returned in a JSON response as a string.', |
426 | - 'fields' => function () { |
|
426 | + 'fields' => function() { |
|
427 | 427 | return [ |
428 | 428 | 'name' => ['type' => newNonNull(String())], |
429 | 429 | 'description' => ['type' => String()], |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | ]); |
435 | 435 | }, true/* $shared */); |
436 | 436 | |
437 | - $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function () { |
|
437 | + $this->container->add(GraphQL::TYPE_KIND_INTROSPECTION, function() { |
|
438 | 438 | return newEnumType([ |
439 | 439 | 'name' => GraphQL::TYPE_KIND_INTROSPECTION, |
440 | 440 | 'isIntrospection' => true, |
@@ -475,12 +475,12 @@ discard block |
||
475 | 475 | protected function registerMetaFields() |
476 | 476 | { |
477 | 477 | $this->container->add(GraphQL::SCHEMA_META_FIELD_DEFINITION, |
478 | - function ($__Schema) { |
|
478 | + function($__Schema) { |
|
479 | 479 | return new Field([ |
480 | 480 | 'name' => '__schema', |
481 | 481 | 'type' => newNonNull($__Schema), |
482 | 482 | 'description' => 'Access the current type schema of this server.', |
483 | - 'resolve' => function ( |
|
483 | + 'resolve' => function( |
|
484 | 484 | $source, |
485 | 485 | $args, |
486 | 486 | $context, |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | ->withArgument(GraphQL::SCHEMA_INTROSPECTION); |
494 | 494 | |
495 | 495 | $this->container->add(GraphQL::TYPE_META_FIELD_DEFINITION, |
496 | - function ($__Type) { |
|
496 | + function($__Type) { |
|
497 | 497 | return new Field([ |
498 | 498 | 'name' => '__type', |
499 | 499 | 'type' => $__Type, |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | 'args' => [ |
502 | 502 | 'name' => ['type' => newNonNull(String())], |
503 | 503 | ], |
504 | - 'resolve' => function ( |
|
504 | + 'resolve' => function( |
|
505 | 505 | $source, |
506 | 506 | $args, |
507 | 507 | $context, |
@@ -517,12 +517,12 @@ discard block |
||
517 | 517 | ->withArgument(GraphQL::TYPE_INTROSPECTION); |
518 | 518 | |
519 | 519 | $this->container->add(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, |
520 | - function () { |
|
520 | + function() { |
|
521 | 521 | return new Field([ |
522 | 522 | 'name' => '__typename', |
523 | 523 | 'type' => newNonNull(String()), |
524 | 524 | 'description' => 'The name of the current Object type at runtime.', |
525 | - 'resolve' => function ( |
|
525 | + 'resolve' => function( |
|
526 | 526 | $source, |
527 | 527 | $args, |
528 | 528 | $context, |
@@ -35,17 +35,17 @@ discard block |
||
35 | 35 | public function register() |
36 | 36 | { |
37 | 37 | $this->container->add(GraphQL::BOOLEAN, |
38 | - function (BooleanCoercer $coercer) { |
|
38 | + function(BooleanCoercer $coercer) { |
|
39 | 39 | return newScalarType([ |
40 | 40 | 'name' => TypeNameEnum::BOOLEAN, |
41 | 41 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
42 | - 'serialize' => function ($value) use ($coercer) { |
|
42 | + 'serialize' => function($value) use ($coercer) { |
|
43 | 43 | return $coercer->coerce($value); |
44 | 44 | }, |
45 | - 'parseValue' => function ($value) use ($coercer) { |
|
45 | + 'parseValue' => function($value) use ($coercer) { |
|
46 | 46 | return $coercer->coerce($value); |
47 | 47 | }, |
48 | - 'parseLiteral' => function (NodeInterface $node) { |
|
48 | + 'parseLiteral' => function(NodeInterface $node) { |
|
49 | 49 | if ($node instanceof BooleanValueNode) { |
50 | 50 | return $node->getValue(); |
51 | 51 | } |
@@ -56,20 +56,20 @@ discard block |
||
56 | 56 | }, true/* $shared */) |
57 | 57 | ->withArgument(BooleanCoercer::class); |
58 | 58 | |
59 | - $this->container->add(GraphQL::FLOAT, function (FloatCoercer $coercer) { |
|
59 | + $this->container->add(GraphQL::FLOAT, function(FloatCoercer $coercer) { |
|
60 | 60 | return newScalarType([ |
61 | 61 | 'name' => TypeNameEnum::FLOAT, |
62 | 62 | 'description' => |
63 | - 'The `Float` scalar type represents signed double-precision fractional '. |
|
64 | - 'values as specified by '. |
|
63 | + 'The `Float` scalar type represents signed double-precision fractional ' . |
|
64 | + 'values as specified by ' . |
|
65 | 65 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
66 | - 'serialize' => function ($value) use ($coercer) { |
|
66 | + 'serialize' => function($value) use ($coercer) { |
|
67 | 67 | return $coercer->coerce($value); |
68 | 68 | }, |
69 | - 'parseValue' => function ($value) use ($coercer) { |
|
69 | + 'parseValue' => function($value) use ($coercer) { |
|
70 | 70 | return $coercer->coerce($value); |
71 | 71 | }, |
72 | - 'parseLiteral' => function (NodeInterface $node) { |
|
72 | + 'parseLiteral' => function(NodeInterface $node) { |
|
73 | 73 | if ($node instanceof FloatValueNode || $node instanceof IntValueNode) { |
74 | 74 | return $node->getValue(); |
75 | 75 | } |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | }, true/* $shared */) |
81 | 81 | ->withArgument(FloatCoercer::class); |
82 | 82 | |
83 | - $this->container->add(GraphQL::INT, function (IntCoercer $coercer) { |
|
83 | + $this->container->add(GraphQL::INT, function(IntCoercer $coercer) { |
|
84 | 84 | return newScalarType([ |
85 | 85 | 'name' => TypeNameEnum::INT, |
86 | 86 | 'description' => |
87 | - 'The `Int` scalar type represents non-fractional signed whole numeric '. |
|
87 | + 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
|
88 | 88 | 'values. Int can represent values between -(2^31) and 2^31 - 1.', |
89 | - 'serialize' => function ($value) use ($coercer) { |
|
89 | + 'serialize' => function($value) use ($coercer) { |
|
90 | 90 | return $coercer->coerce($value); |
91 | 91 | }, |
92 | - 'parseValue' => function ($value) use ($coercer) { |
|
92 | + 'parseValue' => function($value) use ($coercer) { |
|
93 | 93 | return $coercer->coerce($value); |
94 | 94 | }, |
95 | - 'parseLiteral' => function (NodeInterface $node) { |
|
95 | + 'parseLiteral' => function(NodeInterface $node) { |
|
96 | 96 | if ($node instanceof IntValueNode) { |
97 | 97 | $value = (int)$node->getValue(); |
98 | 98 | if ((string)$node->getValue() === (string)$value && |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | }, true/* $shared */) |
108 | 108 | ->withArgument(IntCoercer::class); |
109 | 109 | |
110 | - $this->container->add(GraphQL::ID, function (StringCoercer $coercer) { |
|
110 | + $this->container->add(GraphQL::ID, function(StringCoercer $coercer) { |
|
111 | 111 | return newScalarType([ |
112 | 112 | 'name' => TypeNameEnum::ID, |
113 | 113 | 'description' => |
114 | - 'The `ID` scalar type represents a unique identifier, often used to '. |
|
115 | - 'refetch an object or as key for a cache. The ID type appears in a JSON '. |
|
116 | - 'response as a String; however, it is not intended to be human-readable. '. |
|
117 | - 'When expected as an input type, any string (such as `"4"`) or integer '. |
|
114 | + 'The `ID` scalar type represents a unique identifier, often used to ' . |
|
115 | + 'refetch an object or as key for a cache. The ID type appears in a JSON ' . |
|
116 | + 'response as a String; however, it is not intended to be human-readable. ' . |
|
117 | + 'When expected as an input type, any string (such as `"4"`) or integer ' . |
|
118 | 118 | '(such as `4`) input value will be accepted as an ID.', |
119 | - 'serialize' => function ($value) use ($coercer) { |
|
119 | + 'serialize' => function($value) use ($coercer) { |
|
120 | 120 | return $coercer->coerce($value); |
121 | 121 | }, |
122 | - 'parseValue' => function ($value) use ($coercer) { |
|
122 | + 'parseValue' => function($value) use ($coercer) { |
|
123 | 123 | return $coercer->coerce($value); |
124 | 124 | }, |
125 | - 'parseLiteral' => function (NodeInterface $node) { |
|
125 | + 'parseLiteral' => function(NodeInterface $node) { |
|
126 | 126 | if ($node instanceof StringValueNode || $node instanceof IntValueNode) { |
127 | 127 | return $node->getValue(); |
128 | 128 | } |
@@ -134,20 +134,20 @@ discard block |
||
134 | 134 | ->withArgument(StringCoercer::class); |
135 | 135 | |
136 | 136 | $this->container->add(GraphQL::STRING, |
137 | - function (StringCoercer $coercer) { |
|
137 | + function(StringCoercer $coercer) { |
|
138 | 138 | return newScalarType([ |
139 | 139 | 'name' => TypeNameEnum::STRING, |
140 | 140 | 'description' => |
141 | - 'The `String` scalar type represents textual data, represented as UTF-8 '. |
|
142 | - 'character sequences. The String type is most often used by GraphQL to '. |
|
141 | + 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
|
142 | + 'character sequences. The String type is most often used by GraphQL to ' . |
|
143 | 143 | 'represent free-form human-readable text.', |
144 | - 'serialize' => function ($value) use ($coercer) { |
|
144 | + 'serialize' => function($value) use ($coercer) { |
|
145 | 145 | return $coercer->coerce($value); |
146 | 146 | }, |
147 | - 'parseValue' => function ($value) use ($coercer) { |
|
147 | + 'parseValue' => function($value) use ($coercer) { |
|
148 | 148 | return $coercer->coerce($value); |
149 | 149 | }, |
150 | - 'parseLiteral' => function (NodeInterface $node) { |
|
150 | + 'parseLiteral' => function(NodeInterface $node) { |
|
151 | 151 | if ($node instanceof StringValueNode) { |
152 | 152 | return $node->getValue(); |
153 | 153 | } |
@@ -190,7 +190,7 @@ |
||
190 | 190 | continue; |
191 | 191 | } |
192 | 192 | |
193 | - $setter = 'set'.ucfirst($name); |
|
193 | + $setter = 'set' . ucfirst($name); |
|
194 | 194 | |
195 | 195 | if (method_exists($newNode, $setter)) { |
196 | 196 | $newNode->{$setter}($newNodeOrNodes); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function enterNode(NodeInterface $node): ?NodeInterface |
56 | 56 | { |
57 | - $enterMethod = 'enter'.$node->getKind(); |
|
57 | + $enterMethod = 'enter' . $node->getKind(); |
|
58 | 58 | |
59 | 59 | return $this->{$enterMethod}($node); |
60 | 60 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function leaveNode(NodeInterface $node): ?NodeInterface |
66 | 66 | { |
67 | - $leaveMethod = 'leave'.$node->getKind(); |
|
67 | + $leaveMethod = 'leave' . $node->getKind(); |
|
68 | 68 | |
69 | 69 | return $this->{$leaveMethod}($node); |
70 | 70 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | $this->expectKeyword($lexer, KeywordEnum::FRAGMENT); |
300 | 300 | |
301 | - $buildTypeCondition = function (LexerInterface $lexer) { |
|
301 | + $buildTypeCondition = function(LexerInterface $lexer) { |
|
302 | 302 | $this->expectKeyword($lexer, 'on'); |
303 | 303 | |
304 | 304 | return $this->buildNamedType($lexer); |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | */ |
671 | 671 | protected function buildInputFieldsDefinition(LexerInterface $lexer): ?array |
672 | 672 | { |
673 | - $buildFunction = function (LexerInterface $lexer): array { |
|
673 | + $buildFunction = function(LexerInterface $lexer): array { |
|
674 | 674 | return $this->buildInputValueDefinition($lexer); |
675 | 675 | }; |
676 | 676 | |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | ): array { |
912 | 912 | $start = $lexer->getToken(); |
913 | 913 | |
914 | - $buildValue = function (LexerInterface $lexer, bool $isConst) { |
|
914 | + $buildValue = function(LexerInterface $lexer, bool $isConst) { |
|
915 | 915 | $this->expect($lexer, TokenKindEnum::COLON); |
916 | 916 | |
917 | 917 | return $this->buildValueLiteral($lexer, $isConst); |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | */ |
986 | 986 | protected function buildArgumentsDefinition(LexerInterface $lexer): ?array |
987 | 987 | { |
988 | - $buildFunction = function (LexerInterface $lexer): array { |
|
988 | + $buildFunction = function(LexerInterface $lexer): array { |
|
989 | 989 | return $this->buildInputValueDefinition($lexer); |
990 | 990 | }; |
991 | 991 | |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | * @return mixed |
1272 | 1272 | * @throws SyntaxErrorException |
1273 | 1273 | */ |
1274 | - $buildValue = function (LexerInterface $lexer) { |
|
1274 | + $buildValue = function(LexerInterface $lexer) { |
|
1275 | 1275 | $this->expect($lexer, TokenKindEnum::COLON); |
1276 | 1276 | |
1277 | 1277 | return $this->buildValueLiteral($lexer); |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | * @return mixed |
1302 | 1302 | * @throws SyntaxErrorException |
1303 | 1303 | */ |
1304 | - $buildValue = function (LexerInterface $lexer) { |
|
1304 | + $buildValue = function(LexerInterface $lexer) { |
|
1305 | 1305 | $this->expect($lexer, TokenKindEnum::COLON); |
1306 | 1306 | |
1307 | 1307 | return $this->buildValueLiteral($lexer); |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | * @return mixed |
1505 | 1505 | * @throws SyntaxErrorException |
1506 | 1506 | */ |
1507 | - $buildType = function (LexerInterface $lexer) { |
|
1507 | + $buildType = function(LexerInterface $lexer) { |
|
1508 | 1508 | $this->expect($lexer, TokenKindEnum::COLON); |
1509 | 1509 | |
1510 | 1510 | return $this->buildTypeReference($lexer); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | if ($this->isEscapedTripleQuote($body, $code, $pos)) { |
68 | - $rawValue .= sliceString($body, $chunkStart, $pos).'"""'; |
|
68 | + $rawValue .= sliceString($body, $chunkStart, $pos) . '"""'; |
|
69 | 69 | $pos += 4; |
70 | 70 | $chunkStart = $pos; |
71 | 71 | } else { |
@@ -29,6 +29,6 @@ |
||
29 | 29 | */ |
30 | 30 | public function __toString(): string |
31 | 31 | { |
32 | - return (string)$this->getType().'!'; |
|
32 | + return (string)$this->getType() . '!'; |
|
33 | 33 | } |
34 | 34 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function getValuesAsArray(): array |
36 | 36 | { |
37 | - return array_map(function (SerializationInterface $node) { |
|
37 | + return array_map(function(SerializationInterface $node) { |
|
38 | 38 | return $node->toArray(); |
39 | 39 | }, $this->values); |
40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function __toString(): string |
46 | 46 | { |
47 | - return json_encode(array_map(function (ValueNodeInterface $node) { |
|
47 | + return json_encode(array_map(function(ValueNodeInterface $node) { |
|
48 | 48 | return $node->getValue(); |
49 | 49 | }, $this->getValues())); |
50 | 50 | } |