@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getDirectivesAST(): array |
32 | 32 | { |
33 | - return \array_map(function (DirectiveNode $directive) { |
|
33 | + return \array_map(function(DirectiveNode $directive) { |
|
34 | 34 | return $directive->toAST(); |
35 | 35 | }, $this->directives); |
36 | 36 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function getSelectionsAST(): array |
39 | 39 | { |
40 | - return \array_map(function (SelectionNodeInterface $node) { |
|
40 | + return \array_map(function(SelectionNodeInterface $node) { |
|
41 | 41 | return $node->toAST(); |
42 | 42 | }, $this->selections); |
43 | 43 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getTypesAST(): array |
32 | 32 | { |
33 | - return \array_map(function (NamedTypeNode $node) { |
|
33 | + return \array_map(function(NamedTypeNode $node) { |
|
34 | 34 | return $node->toAST(); |
35 | 35 | }, $this->types); |
36 | 36 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getValuesAST(): array |
32 | 32 | { |
33 | - return \array_map(function (EnumValueDefinitionNode $node) { |
|
33 | + return \array_map(function(EnumValueDefinitionNode $node) { |
|
34 | 34 | return $node->toAST(); |
35 | 35 | }, $this->values); |
36 | 36 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getValuesAST(): array |
39 | 39 | { |
40 | - return \array_map(function (ValueNodeInterface $node) { |
|
40 | + return \array_map(function(ValueNodeInterface $node) { |
|
41 | 41 | return $node->toAST(); |
42 | 42 | }, $this->values); |
43 | 43 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function __toString(): string |
71 | 71 | { |
72 | - return \json_encode(\array_map(function (ValueAwareInterface $node) { |
|
72 | + return \json_encode(\array_map(function(ValueAwareInterface $node) { |
|
73 | 73 | return $node->getValue(); |
74 | 74 | }, $this->getValues())); |
75 | 75 | } |
@@ -30,7 +30,7 @@ |
||
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 | } |
@@ -33,17 +33,17 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -314,7 +314,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -66,7 +66,7 @@ |
||
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 | } |