@@ -29,14 +29,14 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function register() |
| 31 | 31 | { |
| 32 | - $this->container->add(NodeBuilderInterface::class, function () { |
|
| 32 | + $this->container->add(NodeBuilderInterface::class, function() { |
|
| 33 | 33 | return new NodeBuilder(SupportedBuilders::get()); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | 36 | $this->container->add(ParserInterface::class, Parser::class, true/* $shared */) |
| 37 | 37 | ->withArgument(NodeBuilderInterface::class); |
| 38 | 38 | |
| 39 | - $this->container->add(LexerInterface::class, function () { |
|
| 39 | + $this->container->add(LexerInterface::class, function() { |
|
| 40 | 40 | return new Lexer(SupportedReaders::get()); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function register() |
| 29 | 29 | { |
| 30 | - $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function () { |
|
| 30 | + $this->container->add(GraphQL::INCLUDE_DIRECTIVE, function() { |
|
| 31 | 31 | return GraphQLDirective([ |
| 32 | 32 | 'name' => 'include', |
| 33 | 33 | 'description' => |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ]); |
| 48 | 48 | }, true/* $shared */); |
| 49 | 49 | |
| 50 | - $this->container->add(GraphQL::SKIP_DIRECTIVE, function () { |
|
| 50 | + $this->container->add(GraphQL::SKIP_DIRECTIVE, function() { |
|
| 51 | 51 | return GraphQLDirective([ |
| 52 | 52 | 'name' => 'skip', |
| 53 | 53 | 'description' => |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ]); |
| 68 | 68 | }, true/* $shared */); |
| 69 | 69 | |
| 70 | - $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function () { |
|
| 70 | + $this->container->add(GraphQL::DEPRECATED_DIRECTIVE, function() { |
|
| 71 | 71 | return GraphQLDirective([ |
| 72 | 72 | 'name' => 'deprecated', |
| 73 | 73 | 'description' => 'Marks an element of a GraphQL schema as no longer supported.', |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | return (bool)$value; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $this->container->add(GraphQL::BOOLEAN, function () { |
|
| 51 | + $this->container->add(GraphQL::BOOLEAN, function() { |
|
| 52 | 52 | return GraphQLScalarType([ |
| 53 | 53 | 'name' => TypeNameEnum::BOOLEAN, |
| 54 | 54 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
| 55 | - 'serialize' => function ($value) { |
|
| 55 | + 'serialize' => function($value) { |
|
| 56 | 56 | return coerceBoolean($value); |
| 57 | 57 | }, |
| 58 | - 'parseValue' => function ($value) { |
|
| 58 | + 'parseValue' => function($value) { |
|
| 59 | 59 | return coerceBoolean($value); |
| 60 | 60 | }, |
| 61 | 61 | |
| 62 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 62 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 63 | 63 | /** @var BooleanValueNode $astNode */ |
| 64 | 64 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
| 65 | 65 | }, |
@@ -84,20 +84,20 @@ discard block |
||
| 84 | 84 | throw new \TypeError(sprintf('Float cannot represent non numeric value: %s', $value)); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $this->container->add(GraphQL::FLOAT, function () { |
|
| 87 | + $this->container->add(GraphQL::FLOAT, function() { |
|
| 88 | 88 | return GraphQLScalarType([ |
| 89 | 89 | 'name' => TypeNameEnum::FLOAT, |
| 90 | 90 | 'description' => |
| 91 | 91 | 'The `Float` scalar type represents signed double-precision fractional ' . |
| 92 | 92 | 'values as specified by ' . |
| 93 | 93 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
| 94 | - 'serialize' => function ($value) { |
|
| 94 | + 'serialize' => function($value) { |
|
| 95 | 95 | return coerceFloat($value); |
| 96 | 96 | }, |
| 97 | - 'parseValue' => function ($value) { |
|
| 97 | + 'parseValue' => function($value) { |
|
| 98 | 98 | return coerceFloat($value); |
| 99 | 99 | }, |
| 100 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 100 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 101 | 101 | /** @var FloatValueNode $astNode */ |
| 102 | 102 | return $astNode->getKind() === NodeKindEnum::FLOAT || $astNode->getKind() === NodeKindEnum::INT |
| 103 | 103 | ? $astNode->getValue() |
@@ -135,19 +135,19 @@ discard block |
||
| 135 | 135 | return $intValue; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $this->container->add(GraphQL::INT, function () { |
|
| 138 | + $this->container->add(GraphQL::INT, function() { |
|
| 139 | 139 | return GraphQLScalarType([ |
| 140 | 140 | 'name' => TypeNameEnum::INT, |
| 141 | 141 | 'description' => |
| 142 | 142 | 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
| 143 | 143 | 'values. Int can represent values between -(2^31) and 2^31 - 1.', |
| 144 | - 'serialize' => function ($value) { |
|
| 144 | + 'serialize' => function($value) { |
|
| 145 | 145 | return coerceInt($value); |
| 146 | 146 | }, |
| 147 | - 'parseValue' => function ($value) { |
|
| 147 | + 'parseValue' => function($value) { |
|
| 148 | 148 | return coerceInt($value); |
| 149 | 149 | }, |
| 150 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 150 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 151 | 151 | /** @var IntValueNode $astNode */ |
| 152 | 152 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
| 153 | 153 | }, |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | return (string)$value; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $this->container->add(GraphQL::ID, function () { |
|
| 183 | + $this->container->add(GraphQL::ID, function() { |
|
| 184 | 184 | return GraphQLScalarType([ |
| 185 | 185 | 'name' => TypeNameEnum::ID, |
| 186 | 186 | 'description' => |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | 'response as a String; however, it is not intended to be human-readable. ' . |
| 190 | 190 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
| 191 | 191 | '(such as `4`) input value will be accepted as an ID.', |
| 192 | - 'serialize' => function ($value) { |
|
| 192 | + 'serialize' => function($value) { |
|
| 193 | 193 | return coerceString($value); |
| 194 | 194 | }, |
| 195 | - 'parseValue' => function ($value) { |
|
| 195 | + 'parseValue' => function($value) { |
|
| 196 | 196 | return coerceString($value); |
| 197 | 197 | }, |
| 198 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 198 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 199 | 199 | /** @var StringValueNode $astNode */ |
| 200 | 200 | return $astNode->getKind() === NodeKindEnum::STRING || $astNode->getKind() === NodeKindEnum::INT |
| 201 | 201 | ? $astNode->getValue() |
@@ -204,20 +204,20 @@ discard block |
||
| 204 | 204 | ]); |
| 205 | 205 | }, true/* $shared */); |
| 206 | 206 | |
| 207 | - $this->container->add(GraphQL::STRING, function () { |
|
| 207 | + $this->container->add(GraphQL::STRING, function() { |
|
| 208 | 208 | return GraphQLScalarType([ |
| 209 | 209 | 'name' => TypeNameEnum::STRING, |
| 210 | 210 | 'description' => |
| 211 | 211 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
| 212 | 212 | 'character sequences. The String type is most often used by GraphQL to ' . |
| 213 | 213 | 'represent free-form human-readable text.', |
| 214 | - 'serialize' => function ($value) { |
|
| 214 | + 'serialize' => function($value) { |
|
| 215 | 215 | return coerceString($value); |
| 216 | 216 | }, |
| 217 | - 'parseValue' => function ($value) { |
|
| 217 | + 'parseValue' => function($value) { |
|
| 218 | 218 | return coerceString($value); |
| 219 | 219 | }, |
| 220 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
| 220 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
| 221 | 221 | /** @var StringValueNode $astNode */ |
| 222 | 222 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
| 223 | 223 | }, |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $this->container->add(DefinitionBuilderInterface::class, DefinitionBuilder::class, true/* $shared */) |
| 30 | 30 | ->withArguments([ |
| 31 | - function (NamedTypeNode $node) { |
|
| 31 | + function(NamedTypeNode $node) { |
|
| 32 | 32 | throw new \Exception(sprintf('Type "%s" not found in document.', $node->getNameValue())); |
| 33 | 33 | }, |
| 34 | 34 | CacheInterface::class, |