@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return $middleware; |
116 | 116 | } |
117 | 117 | |
118 | - return \array_filter($middleware, function (ResolverMiddlewareInterface $mw) use ($resolverMiddleware) { |
|
118 | + return \array_filter($middleware, function(ResolverMiddlewareInterface $mw) use ($resolverMiddleware) { |
|
119 | 119 | return \in_array(\get_class($mw), $resolverMiddleware, true); |
120 | 120 | }); |
121 | 121 | } |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | { |
130 | 130 | return \array_reduce( |
131 | 131 | $middleware, |
132 | - function (callable $resolveCallback, ResolverMiddlewareInterface $middleware) { |
|
133 | - return function ($rootValue, array $arguments, $context = null, ?ResolveInfo $info = null) use ( |
|
132 | + function(callable $resolveCallback, ResolverMiddlewareInterface $middleware) { |
|
133 | + return function($rootValue, array $arguments, $context = null, ?ResolveInfo $info = null) use ( |
|
134 | 134 | $resolveCallback, |
135 | 135 | $middleware |
136 | 136 | ) { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getResolveCallback(): ?callable |
32 | 32 | { |
33 | - return function ($rootValue, array $arguments, $context = null, ?ResolveInfo $info = null) { |
|
33 | + return function($rootValue, array $arguments, $context = null, ?ResolveInfo $info = null) { |
|
34 | 34 | return $this->resolve($rootValue, $arguments, $context, $info); |
35 | 35 | }; |
36 | 36 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getResolveCallback(): ?callable |
13 | 13 | { |
14 | - return function (string $fieldName) { |
|
14 | + return function(string $fieldName) { |
|
15 | 15 | return $this->getResolver($fieldName); |
16 | 16 | }; |
17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getTypeResolver(): ?callable |
13 | 13 | { |
14 | - return function ($rootValue, $context = null, ?ResolveInfo $info = null) { |
|
14 | + return function($rootValue, $context = null, ?ResolveInfo $info = null) { |
|
15 | 15 | return $this->resolveType($rootValue, $context, $info); |
16 | 16 | }; |
17 | 17 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function getResolveCallback(): ?callable |
45 | 45 | { |
46 | - return function (string $fieldName) { |
|
46 | + return function(string $fieldName) { |
|
47 | 47 | $resolver = $this->getResolver($fieldName); |
48 | 48 | |
49 | 49 | return $resolver instanceof ResolverInterface |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | protected function enterFragmentDefinition(FragmentDefinitionNode $node): VisitorResult |
28 | 28 | { |
29 | - $this->validateFragementNode($node, function (FragmentDefinitionNode $node) { |
|
29 | + $this->validateFragementNode($node, function(FragmentDefinitionNode $node) { |
|
30 | 30 | return fragmentOnNonCompositeMessage((string)$node, (string)$node->getTypeCondition()); |
31 | 31 | }); |
32 | 32 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | protected function enterInlineFragment(InlineFragmentNode $node): VisitorResult |
40 | 40 | { |
41 | - $this->validateFragementNode($node, function (InlineFragmentNode $node) { |
|
41 | + $this->validateFragementNode($node, function(InlineFragmentNode $node) { |
|
42 | 42 | return inlineFragmentOnNonCompositeMessage((string)$node->getTypeCondition()); |
43 | 43 | }); |
44 | 44 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | protected function enterDocument(DocumentNode $node): VisitorResult |
28 | 28 | { |
29 | - $this->operationCount = \count(\array_filter($node->getDefinitions(), function ($definition) { |
|
29 | + $this->operationCount = \count(\array_filter($node->getDefinitions(), function($definition) { |
|
30 | 30 | return $definition instanceof OperationDefinitionNode; |
31 | 31 | })); |
32 | 32 |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function getFragment(string $name): ?FragmentDefinitionNode |
169 | 169 | { |
170 | 170 | if (empty($this->fragments)) { |
171 | - $this->fragments = array_reduce($this->document->getDefinitions(), function ($fragments, $definition) { |
|
171 | + $this->fragments = array_reduce($this->document->getDefinitions(), function($fragments, $definition) { |
|
172 | 172 | if ($definition instanceof FragmentDefinitionNode) { |
173 | 173 | $fragments[$definition->getNameValue()] = $definition; |
174 | 174 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $usages = []; |
245 | 245 | $typeInfo = new TypeInfo($this->schema); |
246 | 246 | |
247 | - $enterCallback = function (NodeInterface $node) use (&$usages, $typeInfo): VisitorResult { |
|
247 | + $enterCallback = function(NodeInterface $node) use (&$usages, $typeInfo): VisitorResult { |
|
248 | 248 | if ($node instanceof VariableDefinitionNode) { |
249 | 249 | return new VisitorResult(null); |
250 | 250 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | return $count === 1 |
38 | 38 | ? $selected[0] |
39 | - : \array_reduce($selected, function ($list, $item) use ($count, &$index) { |
|
39 | + : \array_reduce($selected, function($list, $item) use ($count, &$index) { |
|
40 | 40 | $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
41 | 41 | $item; |
42 | 42 | $index++; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $result = \array_keys($optionsByDistance); |
72 | 72 | |
73 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
73 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
74 | 74 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
75 | 75 | }); |
76 | 76 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | function quotedOrList(array $items): string |
87 | 87 | { |
88 | - return orList(\array_map(function ($item) { |
|
88 | + return orList(\array_map(function($item) { |
|
89 | 89 | return '"' . $item . '"'; |
90 | 90 | }, $items)); |
91 | 91 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function arrayEvery(array $array, callable $fn): bool |
100 | 100 | { |
101 | - return \array_reduce($array, function ($result, $value) use ($fn) { |
|
101 | + return \array_reduce($array, function($result, $value) use ($fn) { |
|
102 | 102 | return $result && $fn($value); |
103 | 103 | }, true); |
104 | 104 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | function arraySome(array $array, callable $fn) |
112 | 112 | { |
113 | - return \array_reduce($array, function ($result, $value) use ($fn) { |
|
113 | + return \array_reduce($array, function($result, $value) use ($fn) { |
|
114 | 114 | return $result || $fn($value); |
115 | 115 | }); |
116 | 116 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | function keyMap(array $array, callable $keyFn): array |
140 | 140 | { |
141 | - return \array_reduce($array, function ($map, $item) use ($keyFn) { |
|
141 | + return \array_reduce($array, function($map, $item) use ($keyFn) { |
|
142 | 142 | $map[$keyFn($item)] = $item; |
143 | 143 | return $map; |
144 | 144 | }, []); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function keyValueMap(array $array, callable $keyFn, callable $valFn): array |
154 | 154 | { |
155 | - return \array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
155 | + return \array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
156 | 156 | $map[$keyFn($item)] = $valFn($item); |
157 | 157 | return $map; |
158 | 158 | }, []); |
@@ -165,13 +165,13 @@ discard block |
||
165 | 165 | function promiseForMap(array $map): PromiseInterface |
166 | 166 | { |
167 | 167 | $keys = \array_keys($map); |
168 | - $promisesOrValues = \array_map(function ($name) use ($map) { |
|
168 | + $promisesOrValues = \array_map(function($name) use ($map) { |
|
169 | 169 | return $map[$name]; |
170 | 170 | }, $keys); |
171 | 171 | |
172 | - return \React\Promise\all($promisesOrValues)->then(function ($values) use ($keys) { |
|
172 | + return \React\Promise\all($promisesOrValues)->then(function($values) use ($keys) { |
|
173 | 173 | $i = 0; |
174 | - return \array_reduce($values, function ($resolvedObject, $value) use ($keys, &$i) { |
|
174 | + return \array_reduce($values, function($resolvedObject, $value) use ($keys, &$i) { |
|
175 | 175 | $resolvedObject[$keys[$i++]] = $value; |
176 | 176 | return $resolvedObject; |
177 | 177 | }, []); |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | */ |
187 | 187 | function promiseReduce(array $values, callable $fn, $initial = null) |
188 | 188 | { |
189 | - return \array_reduce($values, function ($previous, $value) use ($fn) { |
|
189 | + return \array_reduce($values, function($previous, $value) use ($fn) { |
|
190 | 190 | return $previous instanceof PromiseInterface |
191 | - ? $previous->then(function ($resolvedValue) use ($fn, $value) { |
|
191 | + ? $previous->then(function($resolvedValue) use ($fn, $value) { |
|
192 | 192 | return $fn($resolvedValue, $value); |
193 | 193 | }) |
194 | 194 | : $fn($previous, $value); |