@@ -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 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | /** |
363 | 363 | * @return TypeNodeInterface |
364 | 364 | */ |
365 | - $parseType = function (): TypeNodeInterface { |
|
365 | + $parseType = function(): TypeNodeInterface { |
|
366 | 366 | $this->expect(TokenKindEnum::COLON); |
367 | 367 | return $this->lexTypeReference(); |
368 | 368 | }; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | /** |
474 | 474 | * @return ArgumentNode |
475 | 475 | */ |
476 | - $parseFunction = function () use ($isConst): ArgumentNode { |
|
476 | + $parseFunction = function() use ($isConst) : ArgumentNode { |
|
477 | 477 | return $this->lexArgument($isConst); |
478 | 478 | }; |
479 | 479 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | /** |
501 | 501 | * @return NodeInterface|TypeNodeInterface|ValueNodeInterface |
502 | 502 | */ |
503 | - $parseValue = function () use ($isConst): NodeInterface { |
|
503 | + $parseValue = function() use ($isConst): NodeInterface { |
|
504 | 504 | $this->expect(TokenKindEnum::COLON); |
505 | 505 | return $this->lexValueLiteral($isConst); |
506 | 506 | }; |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | |
570 | 570 | $this->expectKeyword(KeywordEnum::FRAGMENT); |
571 | 571 | |
572 | - $parseTypeCondition = function () { |
|
572 | + $parseTypeCondition = function() { |
|
573 | 573 | $this->expectKeyword(KeywordEnum::ON); |
574 | 574 | return $this->lexNamedType(); |
575 | 575 | }; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | { |
700 | 700 | $start = $this->lexer->getToken(); |
701 | 701 | |
702 | - $parseFunction = function () use ($isConst) { |
|
702 | + $parseFunction = function() use ($isConst) { |
|
703 | 703 | return $this->lexValueLiteral($isConst); |
704 | 704 | }; |
705 | 705 | |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | * @param bool $isConst |
753 | 753 | * @return NodeInterface|TypeNodeInterface|ValueNodeInterface |
754 | 754 | */ |
755 | - $parseValue = function (bool $isConst): NodeInterface { |
|
755 | + $parseValue = function(bool $isConst): NodeInterface { |
|
756 | 756 | $this->expect(TokenKindEnum::COLON); |
757 | 757 | return $this->lexValueLiteral($isConst); |
758 | 758 | }; |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | */ |
1096 | 1096 | protected function lexArgumentsDefinition(): array |
1097 | 1097 | { |
1098 | - $parseFunction = function (): InputValueDefinitionNode { |
|
1098 | + $parseFunction = function(): InputValueDefinitionNode { |
|
1099 | 1099 | return $this->lexInputValueDefinition(); |
1100 | 1100 | }; |
1101 | 1101 | |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | */ |
1302 | 1302 | protected function lexInputFieldsDefinition(): array |
1303 | 1303 | { |
1304 | - $parseFunction = function (): InputValueDefinitionNode { |
|
1304 | + $parseFunction = function(): InputValueDefinitionNode { |
|
1305 | 1305 | return $this->lexInputValueDefinition(); |
1306 | 1306 | }; |
1307 | 1307 | |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | |
1606 | 1606 | $name = $this->lexName(); |
1607 | 1607 | |
1608 | - if (arraySome(DirectiveLocationEnum::values(), function ($value) use ($name) { |
|
1608 | + if (arraySome(DirectiveLocationEnum::values(), function($value) use ($name) { |
|
1609 | 1609 | return $name->getValue() === $value; |
1610 | 1610 | })) { |
1611 | 1611 | return $name; |