@@ -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 | ); |
@@ -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: |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | function arraySome(array $array, callable $fn) |
25 | 25 | { |
26 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
26 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
27 | 27 | return $result || $fn($value); |
28 | 28 | }); |
29 | 29 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function keyMap(array $array, callable $keyFn): array |
37 | 37 | { |
38 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
38 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
39 | 39 | $map[$keyFn($item)] = $item; |
40 | 40 | return $map; |
41 | 41 | }, []); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function keyValMap(array $array, callable $keyFn, callable $valFn): array |
51 | 51 | { |
52 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
52 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
53 | 53 | $map[$keyFn($item)] = $valFn($item); |
54 | 54 | return $map; |
55 | 55 | }, []); |
@@ -101,7 +101,7 @@ |
||
101 | 101 | $coercedObject = []; |
102 | 102 | |
103 | 103 | /** @var ObjectFieldNode[] $fieldNodes */ |
104 | - $fieldNodes = keyMap($node->getFields(), function (FieldNode $value) { |
|
104 | + $fieldNodes = keyMap($node->getFields(), function(FieldNode $value) { |
|
105 | 105 | return $value->getNameValue(); |
106 | 106 | }); |
107 | 107 |
@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function getMultiple($keys, $default = null) |
61 | 61 | { |
62 | - return array_filter($this->cache, function ($key) use ($keys) { |
|
62 | + return array_filter($this->cache, function($key) use ($keys) { |
|
63 | 63 | return \in_array($key, $keys, true); |
64 | 64 | }, ARRAY_FILTER_USE_KEY); |
65 | 65 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | { |
73 | 73 | return arraySome( |
74 | 74 | specifiedScalarTypes(), |
75 | - function (ScalarType $specifiedScalarType) use ($type) { |
|
75 | + function(ScalarType $specifiedScalarType) use ($type) { |
|
76 | 76 | /** @noinspection PhpUndefinedMethodInspection */ |
77 | 77 | return $type->getName() === $specifiedScalarType->getName(); |
78 | 78 | } |
@@ -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.', |
@@ -36,38 +36,38 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function register() |
38 | 38 | { |
39 | - $this->container->add(GraphQL::BOOLEAN, function () { |
|
39 | + $this->container->add(GraphQL::BOOLEAN, function() { |
|
40 | 40 | return GraphQLScalarType([ |
41 | 41 | 'name' => TypeNameEnum::BOOLEAN, |
42 | 42 | 'description' => 'The `Boolean` scalar type represents `true` or `false`.', |
43 | - 'serialize' => function ($value) { |
|
43 | + 'serialize' => function($value) { |
|
44 | 44 | return coerceBoolean($value); |
45 | 45 | }, |
46 | - 'parseValue' => function ($value) { |
|
46 | + 'parseValue' => function($value) { |
|
47 | 47 | return coerceBoolean($value); |
48 | 48 | }, |
49 | 49 | |
50 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
50 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
51 | 51 | /** @var BooleanValueNode $astNode */ |
52 | 52 | return $astNode->getKind() === NodeKindEnum::BOOLEAN ? $astNode->getValue() : null; |
53 | 53 | }, |
54 | 54 | ]); |
55 | 55 | }, true/* $shared */); |
56 | 56 | |
57 | - $this->container->add(GraphQL::FLOAT, function () { |
|
57 | + $this->container->add(GraphQL::FLOAT, function() { |
|
58 | 58 | return GraphQLScalarType([ |
59 | 59 | 'name' => TypeNameEnum::FLOAT, |
60 | 60 | 'description' => |
61 | 61 | 'The `Float` scalar type represents signed double-precision fractional ' . |
62 | 62 | 'values as specified by ' . |
63 | 63 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).', |
64 | - 'serialize' => function ($value) { |
|
64 | + 'serialize' => function($value) { |
|
65 | 65 | return coerceFloat($value); |
66 | 66 | }, |
67 | - 'parseValue' => function ($value) { |
|
67 | + 'parseValue' => function($value) { |
|
68 | 68 | return coerceFloat($value); |
69 | 69 | }, |
70 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
70 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
71 | 71 | /** @var FloatValueNode $astNode */ |
72 | 72 | return $astNode->getKind() === NodeKindEnum::FLOAT || $astNode->getKind() === NodeKindEnum::INT |
73 | 73 | ? $astNode->getValue() |
@@ -76,26 +76,26 @@ discard block |
||
76 | 76 | ]); |
77 | 77 | }, true/* $shared */); |
78 | 78 | |
79 | - $this->container->add(GraphQL::INT, function () { |
|
79 | + $this->container->add(GraphQL::INT, function() { |
|
80 | 80 | return GraphQLScalarType([ |
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) { |
|
85 | + 'serialize' => function($value) { |
|
86 | 86 | return coerceInt($value); |
87 | 87 | }, |
88 | - 'parseValue' => function ($value) { |
|
88 | + 'parseValue' => function($value) { |
|
89 | 89 | return coerceInt($value); |
90 | 90 | }, |
91 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
91 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
92 | 92 | /** @var IntValueNode $astNode */ |
93 | 93 | return $astNode->getKind() === NodeKindEnum::INT ? $astNode->getValue() : null; |
94 | 94 | }, |
95 | 95 | ]); |
96 | 96 | }, true/* $shared */); |
97 | 97 | |
98 | - $this->container->add(GraphQL::ID, function () { |
|
98 | + $this->container->add(GraphQL::ID, function() { |
|
99 | 99 | return GraphQLScalarType([ |
100 | 100 | 'name' => TypeNameEnum::ID, |
101 | 101 | 'description' => |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | 'response as a String; however, it is not intended to be human-readable. ' . |
105 | 105 | 'When expected as an input type, any string (such as `"4"`) or integer ' . |
106 | 106 | '(such as `4`) input value will be accepted as an ID.', |
107 | - 'serialize' => function ($value) { |
|
107 | + 'serialize' => function($value) { |
|
108 | 108 | return coerceString($value); |
109 | 109 | }, |
110 | - 'parseValue' => function ($value) { |
|
110 | + 'parseValue' => function($value) { |
|
111 | 111 | return coerceString($value); |
112 | 112 | }, |
113 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
113 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
114 | 114 | /** @var StringValueNode $astNode */ |
115 | 115 | return $astNode->getKind() === NodeKindEnum::STRING || $astNode->getKind() === NodeKindEnum::INT |
116 | 116 | ? $astNode->getValue() |
@@ -119,20 +119,20 @@ discard block |
||
119 | 119 | ]); |
120 | 120 | }, true/* $shared */); |
121 | 121 | |
122 | - $this->container->add(GraphQL::STRING, function () { |
|
122 | + $this->container->add(GraphQL::STRING, function() { |
|
123 | 123 | return GraphQLScalarType([ |
124 | 124 | 'name' => TypeNameEnum::STRING, |
125 | 125 | 'description' => |
126 | 126 | 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
127 | 127 | 'character sequences. The String type is most often used by GraphQL to ' . |
128 | 128 | 'represent free-form human-readable text.', |
129 | - 'serialize' => function ($value) { |
|
129 | + 'serialize' => function($value) { |
|
130 | 130 | return coerceString($value); |
131 | 131 | }, |
132 | - 'parseValue' => function ($value) { |
|
132 | + 'parseValue' => function($value) { |
|
133 | 133 | return coerceString($value); |
134 | 134 | }, |
135 | - 'parseLiteral' => function (NodeInterface $astNode) { |
|
135 | + 'parseLiteral' => function(NodeInterface $astNode) { |
|
136 | 136 | /** @var StringValueNode $astNode */ |
137 | 137 | return $astNode->getKind() === NodeKindEnum::STRING ? $astNode->getValue() : null; |
138 | 138 | }, |