@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | return newObjectType([ |
148 | 148 | 'name' => $typeName, |
149 | 149 | 'description' => $type->getDescription(), |
150 | - 'interfaces' => function () use ($type) { |
|
150 | + 'interfaces' => function() use ($type) { |
|
151 | 151 | return $this->extendImplementedInterfaces($type); |
152 | 152 | }, |
153 | - 'fields' => function () use ($type) { |
|
153 | + 'fields' => function() use ($type) { |
|
154 | 154 | return $this->extendFieldMap($type); |
155 | 155 | }, |
156 | 156 | 'astNode' => $type->getAstNode(), |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | $typeName = $type->getName(); |
187 | 187 | |
188 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
188 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
189 | 189 | return $this->getExtendedType($interface); |
190 | 190 | }, $type->getInterfaces()); |
191 | 191 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | 'deprecationReason' => $field->getDeprecationReason(), |
230 | 230 | 'type' => $this->extendFieldType($field->getType()), |
231 | 231 | 'args' => keyMap($field->getArguments(), |
232 | - function (Argument $argument) { |
|
232 | + function(Argument $argument) { |
|
233 | 233 | return $argument->getName(); |
234 | 234 | }), |
235 | 235 | 'astNode' => $field->getAstNode(), |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if (isset($oldFieldMap[$fieldName])) { |
249 | 249 | throw new ExtensionException( |
250 | 250 | \sprintf( |
251 | - 'Field "%s.%s" already exists in the schema. '. |
|
251 | + 'Field "%s.%s" already exists in the schema. ' . |
|
252 | 252 | 'It cannot also be defined in this type extension.', |
253 | 253 | $typeName, $fieldName |
254 | 254 | ), |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | return newInterfaceType([ |
304 | 304 | 'name' => $typeName, |
305 | 305 | 'description' => $type->getDescription(), |
306 | - 'fields' => function () use ($type) { |
|
306 | + 'fields' => function() use ($type) { |
|
307 | 307 | return $this->extendFieldMap($type); |
308 | 308 | }, |
309 | 309 | 'astNode' => $type->getAstNode(), |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | return newUnionType([ |
324 | 324 | 'name' => $type->getName(), |
325 | 325 | 'description' => $type->getDescription(), |
326 | - 'types' => \array_map(function ($unionType) { |
|
326 | + 'types' => \array_map(function($unionType) { |
|
327 | 327 | return $this->getExtendedType($unionType); |
328 | 328 | }, $type->getTypes()), |
329 | 329 | 'astNode' => $type->getAstNode(), |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function getExtendedTypes(): array |
367 | 367 | { |
368 | - $extendedTypes = \array_map(function ($type) { |
|
368 | + $extendedTypes = \array_map(function($type) { |
|
369 | 369 | return $this->getExtendedType($type); |
370 | 370 | }, $this->info->getSchema()->getTypeMap()); |
371 | 371 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | |
389 | 389 | return \array_merge( |
390 | 390 | $existingDirectives, |
391 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
391 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
392 | 392 | return $this->definitionBuilder->buildDirective($node); |
393 | 393 | }, $this->info->getDirectiveDefinitions()) |
394 | 394 | ); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | |
427 | 427 | throw new ExtensionException( |
428 | 428 | \sprintf( |
429 | - 'Unknown type: "%s". Ensure that this type exists '. |
|
429 | + 'Unknown type: "%s". Ensure that this type exists ' . |
|
430 | 430 | 'either in the original schema, or is added in a type definition.', |
431 | 431 | $typeName |
432 | 432 | ), |
@@ -116,7 +116,7 @@ |
||
116 | 116 | if (null !== $existingType) { |
117 | 117 | throw new ExtensionException( |
118 | 118 | \sprintf( |
119 | - 'Type "%s" already exists in the schema. It cannot also '. |
|
119 | + 'Type "%s" already exists in the schema. It cannot also ' . |
|
120 | 120 | 'be defined in this type definition.', |
121 | 121 | $typeName |
122 | 122 | ), |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function register() |
25 | 25 | { |
26 | - $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function () { |
|
26 | + $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function() { |
|
27 | 27 | return newDirective([ |
28 | 28 | 'name' => 'include', |
29 | 29 | 'description' => |
30 | - 'Directs the executor to include this field or fragment only when '. |
|
30 | + 'Directs the executor to include this field or fragment only when ' . |
|
31 | 31 | 'the `if` argument is true.', |
32 | 32 | 'locations' => [ |
33 | 33 | DirectiveLocationEnum::FIELD, |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | ]); |
44 | 44 | }, true/* $shared */); |
45 | 45 | |
46 | - $this->container->add(GraphQL::SKIP_DIRECTIVE, function () { |
|
46 | + $this->container->add(GraphQL::SKIP_DIRECTIVE, function() { |
|
47 | 47 | return newDirective([ |
48 | 48 | 'name' => 'skip', |
49 | 49 | 'description' => |
50 | - 'Directs the executor to skip this field or fragment when the `if` '. |
|
50 | + 'Directs the executor to skip this field or fragment when the `if` ' . |
|
51 | 51 | 'argument is true.', |
52 | 52 | 'locations' => [ |
53 | 53 | DirectiveLocationEnum::FIELD, |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ]); |
64 | 64 | }, true/* $shared */); |
65 | 65 | |
66 | - $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function () { |
|
66 | + $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function() { |
|
67 | 67 | return newDirective([ |
68 | 68 | 'name' => 'deprecated', |
69 | 69 | 'description' => 'Marks an element of a GraphQL schema as no longer supported.', |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | 'reason' => [ |
76 | 76 | 'type' => String(), |
77 | 77 | 'description' => |
78 | - 'Explains why this element was deprecated, usually also including a '. |
|
79 | - 'suggestion for how to access supported similar data. Formatted '. |
|
78 | + 'Explains why this element was deprecated, usually also including a ' . |
|
79 | + 'suggestion for how to access supported similar data. Formatted ' . |
|
80 | 80 | 'in [Markdown](https://daringfireball.net/projects/markdown/).', |
81 | 81 | 'defaultValue' => DEFAULT_DEPRECATION_REASON, |
82 | 82 | ], |
@@ -96,8 +96,8 @@ |
||
96 | 96 | invariant( |
97 | 97 | \is_callable($this->serializeFunction), |
98 | 98 | \sprintf( |
99 | - '%s must provide "serialize" function. If this custom Scalar '. |
|
100 | - 'is also used as an input type, ensure "parseValue" and "parseLiteral" '. |
|
99 | + '%s must provide "serialize" function. If this custom Scalar ' . |
|
100 | + 'is also used as an input type, ensure "parseValue" and "parseLiteral" ' . |
|
101 | 101 | 'functions are also provided.', |
102 | 102 | $this->getName() |
103 | 103 | ) |
@@ -46,6 +46,6 @@ |
||
46 | 46 | */ |
47 | 47 | public function __toString(): string |
48 | 48 | { |
49 | - return (string)$this->getOfType().'!'; |
|
49 | + return (string)$this->getOfType() . '!'; |
|
50 | 50 | } |
51 | 51 | } |
@@ -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); |