@@ -129,7 +129,7 @@ |
||
129 | 129 | { |
130 | 130 | return arraySome( |
131 | 131 | specifiedDirectives(), |
132 | - function (DirectiveInterface $specifiedDirective) use ($directive) { |
|
132 | + function(DirectiveInterface $specifiedDirective) use ($directive) { |
|
133 | 133 | return $specifiedDirective->getName() === $directive->getName(); |
134 | 134 | } |
135 | 135 | ); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | ) |
176 | 176 | ); |
177 | 177 | |
178 | - $this->_possibleTypeMap = array_reduce($possibleTypes, function (array $map, TypeInterface $type) { |
|
178 | + $this->_possibleTypeMap = array_reduce($possibleTypes, function(array $map, TypeInterface $type) { |
|
179 | 179 | $map[$type->getName()] = true; |
180 | 180 | return $map; |
181 | 181 | }); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
364 | 364 | foreach ($type->getFields() as $field) { |
365 | 365 | if ($field->hasArgs()) { |
366 | - $fieldArgTypes = array_map(function (Argument $argument) { |
|
366 | + $fieldArgTypes = array_map(function(Argument $argument) { |
|
367 | 367 | return $argument->getType(); |
368 | 368 | }, $field->getArgs()); |
369 | 369 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | return $map; |
395 | 395 | } |
396 | 396 | |
397 | - return array_reduce($directive->getArgs(), function ($map, Argument $argument) { |
|
397 | + return array_reduce($directive->getArgs(), function($map, Argument $argument) { |
|
398 | 398 | return typeMapReducer($map, $argument->getType()); |
399 | 399 | }, $map); |
400 | 400 | } |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | $instance = GraphQLScalarType([ |
38 | 38 | 'name' => TypeNameEnum::BOOLEAN, |
39 | 39 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
40 | - 'serialize' => function ($value) { |
|
40 | + 'serialize' => function($value) { |
|
41 | 41 | return coerceBoolean($value); |
42 | 42 | }, |
43 | - 'parseValue' => function ($value) { |
|
43 | + 'parseValue' => function($value) { |
|
44 | 44 | return coerceBoolean($value); |
45 | 45 | }, |
46 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
46 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
47 | 47 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
48 | 48 | }, |
49 | 49 | ]); |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | 'The `Float` scalar type represents signed double-precision fractional ' . |
85 | 85 | 'values as specified by ' . |
86 | 86 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
87 | - 'serialize' => function ($value) { |
|
87 | + 'serialize' => function($value) { |
|
88 | 88 | return coerceFloat($value); |
89 | 89 | }, |
90 | - 'parseValue' => function ($value) { |
|
90 | + 'parseValue' => function($value) { |
|
91 | 91 | return coerceFloat($value); |
92 | 92 | }, |
93 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
93 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
94 | 94 | return in_array($astNode->getKind(), [NodeKindEnum::FLOAT, NodeKindEnum::INT]) ? $astNode->getValue() : null; |
95 | 95 | }, |
96 | 96 | ]); |
@@ -141,13 +141,13 @@ discard block |
||
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 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
152 | 152 | }, |
153 | 153 | ]); |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | 'response as a String; however, it is not intended to be human-readable. ' . |
199 | 199 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
200 | 200 | '(such as `4`) input value will be accepted as an ID.', |
201 | - 'serialize' => function ($value) { |
|
201 | + 'serialize' => function($value) { |
|
202 | 202 | return coerceString($value); |
203 | 203 | }, |
204 | - 'parseValue' => function ($value) { |
|
204 | + 'parseValue' => function($value) { |
|
205 | 205 | return coerceString($value); |
206 | 206 | }, |
207 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
207 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
208 | 208 | return in_array($astNode->getKind(), [NodeKindEnum::STRING, NodeKindEnum::INT]) ? $astNode->getValue() : null; |
209 | 209 | }, |
210 | 210 | ]); |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
228 | 228 | 'character sequences. The String type is most often used by GraphQL to ' . |
229 | 229 | 'represent free-form human-readable text.', |
230 | - 'serialize' => function ($value) { |
|
230 | + 'serialize' => function($value) { |
|
231 | 231 | return coerceString($value); |
232 | 232 | }, |
233 | - 'parseValue' => function ($value) { |
|
233 | + 'parseValue' => function($value) { |
|
234 | 234 | return coerceString($value); |
235 | 235 | }, |
236 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
236 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
237 | 237 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
238 | 238 | }, |
239 | 239 | ]); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | { |
265 | 265 | return arraySome( |
266 | 266 | specifiedScalarTypes(), |
267 | - function (ScalarType $specifiedScalarType) use ($type) { |
|
267 | + function(ScalarType $specifiedScalarType) use ($type) { |
|
268 | 268 | return $type->getName() === $specifiedScalarType->getName(); |
269 | 269 | } |
270 | 270 | ); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | function arraySome(array $array, callable $fn) |
23 | 23 | { |
24 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
24 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
25 | 25 | return $result || $fn($value); |
26 | 26 | }); |
27 | 27 | } |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * @return mixed |
419 | 419 | * @throws GraphQLError |
420 | 420 | */ |
421 | - $parseType = function (Lexer $lexer) { |
|
421 | + $parseType = function(Lexer $lexer) { |
|
422 | 422 | $this->expect($lexer, TokenKindEnum::COLON); |
423 | 423 | return $this->parseTypeReference($lexer); |
424 | 424 | }; |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @return mixed |
542 | 542 | * @throws GraphQLError |
543 | 543 | */ |
544 | - $parseValue = function (Lexer $lexer) { |
|
544 | + $parseValue = function(Lexer $lexer) { |
|
545 | 545 | $this->expect($lexer, TokenKindEnum::COLON); |
546 | 546 | return $this->parseValueLiteral($lexer, false); |
547 | 547 | }; |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @return mixed |
568 | 568 | * @throws GraphQLError |
569 | 569 | */ |
570 | - $parseValue = function (Lexer $lexer) { |
|
570 | + $parseValue = function(Lexer $lexer) { |
|
571 | 571 | $this->expect($lexer, TokenKindEnum::COLON); |
572 | 572 | return $this->parseConstValue($lexer); |
573 | 573 | }; |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | |
628 | 628 | // TODO: Consider adding experimental support fragment variables |
629 | 629 | |
630 | - $parseTypeCondition = function (Lexer $lexer) { |
|
630 | + $parseTypeCondition = function(Lexer $lexer) { |
|
631 | 631 | $this->expectKeyword($lexer, 'on'); |
632 | 632 | return $this->parseNamedType($lexer); |
633 | 633 | }; |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | { |
812 | 812 | $start = $lexer->getToken(); |
813 | 813 | |
814 | - $parseValue = function (Lexer $lexer, bool $isConst) { |
|
814 | + $parseValue = function(Lexer $lexer, bool $isConst) { |
|
815 | 815 | $this->expect($lexer, TokenKindEnum::COLON); |
816 | 816 | return $this->parseValueLiteral($lexer, $isConst); |
817 | 817 | }; |
@@ -53,7 +53,7 @@ |
||
53 | 53 | if ($code === 92) { |
54 | 54 | // \ |
55 | 55 | $value .= sliceString($body, $chunkStart, $pos + 1); |
56 | - $code = charCodeAt($body, $pos); |
|
56 | + $code = charCodeAt($body, $pos); |
|
57 | 57 | |
58 | 58 | switch ($code) { |
59 | 59 | case 34: |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | * @return mixed |
497 | 497 | * @throws GraphQLError |
498 | 498 | */ |
499 | - $parseType = function (LexerInterface $lexer) { |
|
499 | + $parseType = function(LexerInterface $lexer) { |
|
500 | 500 | $this->expect($lexer, TokenKindEnum::COLON); |
501 | 501 | return $this->parseTypeReference($lexer); |
502 | 502 | }; |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | * @return mixed |
627 | 627 | * @throws GraphQLError |
628 | 628 | */ |
629 | - $parseValue = function (LexerInterface $lexer) { |
|
629 | + $parseValue = function(LexerInterface $lexer) { |
|
630 | 630 | $this->expect($lexer, TokenKindEnum::COLON); |
631 | 631 | return $this->parseValueLiteral($lexer, false); |
632 | 632 | }; |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | * @return mixed |
654 | 654 | * @throws GraphQLError |
655 | 655 | */ |
656 | - $parseValue = function (LexerInterface $lexer) { |
|
656 | + $parseValue = function(LexerInterface $lexer) { |
|
657 | 657 | $this->expect($lexer, TokenKindEnum::COLON); |
658 | 658 | return $this->parseConstValue($lexer); |
659 | 659 | }; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | |
717 | 717 | // TODO: Consider adding experimental support fragment variables |
718 | 718 | |
719 | - $parseTypeCondition = function (LexerInterface $lexer) { |
|
719 | + $parseTypeCondition = function(LexerInterface $lexer) { |
|
720 | 720 | $this->expectKeyword($lexer, 'on'); |
721 | 721 | return $this->parseNamedType($lexer); |
722 | 722 | }; |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | { |
913 | 913 | $start = $lexer->getToken(); |
914 | 914 | |
915 | - $parseValue = function (LexerInterface $lexer, bool $isConst) { |
|
915 | + $parseValue = function(LexerInterface $lexer, bool $isConst) { |
|
916 | 916 | $this->expect($lexer, TokenKindEnum::COLON); |
917 | 917 | return $this->parseValueLiteral($lexer, $isConst); |
918 | 918 | }; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function getValuesAsArray(): array |
34 | 34 | { |
35 | - return array_map(function (SerializationInterface $node) { |
|
35 | + return array_map(function(SerializationInterface $node) { |
|
36 | 36 | return $node->toArray(); |
37 | 37 | }, $this->values); |
38 | 38 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function getTypesAsArray(): array |
28 | 28 | { |
29 | - return array_map(function (SerializationInterface $node) { |
|
29 | + return array_map(function(SerializationInterface $node) { |
|
30 | 30 | return $node->toArray(); |
31 | 31 | }, $this->types); |
32 | 32 | } |