@@ -50,7 +50,7 @@ |
||
50 | 50 | { |
51 | 51 | return arraySome( |
52 | 52 | specifiedDirectives(), |
53 | - function (Directive $specifiedDirective) use ($directive) { |
|
53 | + function(Directive $specifiedDirective) use ($directive) { |
|
54 | 54 | return $specifiedDirective->getName() === $directive->getName(); |
55 | 55 | } |
56 | 56 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getExtendedTypes(): array |
114 | 114 | { |
115 | - $extendedTypes = \array_map(function ($type) { |
|
115 | + $extendedTypes = \array_map(function($type) { |
|
116 | 116 | return $this->getExtendedType($type); |
117 | 117 | }, $this->info->getSchema()->getTypeMap()); |
118 | 118 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | return \array_merge( |
136 | 136 | $existingDirectives, |
137 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
137 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
138 | 138 | return $this->definitionBuilder->buildDirective($node); |
139 | 139 | }, $this->info->getDirectiveDefinitions()) |
140 | 140 | ); |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | return newObjectType([ |
241 | 241 | 'name' => $typeName, |
242 | 242 | 'description' => $type->getDescription(), |
243 | - 'interfaces' => function () use ($type) { |
|
243 | + 'interfaces' => function() use ($type) { |
|
244 | 244 | return $this->extendImplementedInterfaces($type); |
245 | 245 | }, |
246 | - 'fields' => function () use ($type) { |
|
246 | + 'fields' => function() use ($type) { |
|
247 | 247 | return $this->extendFieldMap($type); |
248 | 248 | }, |
249 | 249 | 'astNode' => $type->getAstNode(), |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | return newInterfaceType([ |
270 | 270 | 'name' => $typeName, |
271 | 271 | 'description' => $type->getDescription(), |
272 | - 'fields' => function () use ($type) { |
|
272 | + 'fields' => function() use ($type) { |
|
273 | 273 | return $this->extendFieldMap($type); |
274 | 274 | }, |
275 | 275 | 'astNode' => $type->getAstNode(), |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return newUnionType([ |
300 | 300 | 'name' => $type->getName(), |
301 | 301 | 'description' => $type->getDescription(), |
302 | - 'types' => \array_map(function ($unionType) { |
|
302 | + 'types' => \array_map(function($unionType) { |
|
303 | 303 | return $this->getExtendedType($unionType); |
304 | 304 | }, $type->getTypes()), |
305 | 305 | 'astNode' => $type->getAstNode(), |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | { |
317 | 317 | $typeName = $type->getName(); |
318 | 318 | |
319 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
319 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
320 | 320 | return $this->getExtendedType($interface); |
321 | 321 | }, $type->getInterfaces()); |
322 | 322 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | return $count === 1 |
37 | 37 | ? $selected[0] |
38 | - : \array_reduce($selected, function ($list, $item) use ($count, &$index) { |
|
38 | + : \array_reduce($selected, function($list, $item) use ($count, &$index) { |
|
39 | 39 | $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
40 | 40 | $item; |
41 | 41 | $index++; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $result = \array_keys($optionsByDistance); |
71 | 71 | |
72 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
72 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
73 | 73 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
74 | 74 | }); |
75 | 75 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function quotedOrList(array $items): string |
86 | 86 | { |
87 | - return orList(\array_map(function ($item) { |
|
87 | + return orList(\array_map(function($item) { |
|
88 | 88 | return '"' . $item . '"'; |
89 | 89 | }, $items)); |
90 | 90 | } |
@@ -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 | }, []); |
@@ -370,7 +370,7 @@ |
||
370 | 370 | */ |
371 | 371 | protected function printMany(array $nodes): array |
372 | 372 | { |
373 | - return \array_map(function ($node) { |
|
373 | + return \array_map(function($node) { |
|
374 | 374 | return $this->print($node); |
375 | 375 | }, $nodes); |
376 | 376 | } |
@@ -36,8 +36,8 @@ |
||
36 | 36 | return false; |
37 | 37 | } |
38 | 38 | |
39 | - return arrayEvery($argumentsA, function (ArgumentNode $argumentA) use ($argumentsB) { |
|
40 | - $argumentB = find($argumentsB, function (ArgumentNode $argument) use ($argumentA) { |
|
39 | + return arrayEvery($argumentsA, function(ArgumentNode $argumentA) use ($argumentsB) { |
|
40 | + $argumentB = find($argumentsB, function(ArgumentNode $argument) use ($argumentA) { |
|
41 | 41 | return $argument->getNameValue() === $argumentA->getNameValue(); |
42 | 42 | }); |
43 | 43 |
@@ -179,7 +179,7 @@ |
||
179 | 179 | $values = []; |
180 | 180 | |
181 | 181 | /** @var ObjectFieldNode[] $fieldNodes */ |
182 | - $fieldNodes = keyMap($node->getFields(), function (ObjectFieldNode $value) { |
|
182 | + $fieldNodes = keyMap($node->getFields(), function(ObjectFieldNode $value) { |
|
183 | 183 | return $value->getNameValue(); |
184 | 184 | }); |
185 | 185 |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $promise = new FulfilledPromise([]); |
172 | 172 | |
173 | - $resolve = function ($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) { |
|
173 | + $resolve = function($results, $fieldName, $path, $objectType, $rootValue, $fieldNodes) { |
|
174 | 174 | $fieldPath = $path; |
175 | 175 | $fieldPath[] = $fieldName; |
176 | 176 | try { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | if ($this->isPromise($result)) { |
183 | 183 | /** @var ExtendedPromiseInterface $result */ |
184 | - return $result->then(function ($resolvedResult) use ($fieldName, $results) { |
|
184 | + return $result->then(function($resolvedResult) use ($fieldName, $results) { |
|
185 | 185 | $results[$fieldName] = $resolvedResult; |
186 | 186 | return $results; |
187 | 187 | }); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | }; |
194 | 194 | |
195 | 195 | foreach ($fields as $fieldName => $fieldNodes) { |
196 | - $promise = $promise->then(function ($resolvedResults) use ( |
|
196 | + $promise = $promise->then(function($resolvedResults) use ( |
|
197 | 197 | $resolve, |
198 | 198 | $fieldName, |
199 | 199 | $path, |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | }); |
206 | 206 | } |
207 | 207 | |
208 | - $promise->then(function ($resolvedResults) use (&$finalResults) { |
|
208 | + $promise->then(function($resolvedResults) use (&$finalResults) { |
|
209 | 209 | $finalResults = $resolvedResults ?? []; |
210 | 210 | }); |
211 | 211 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | if ($this->isPromise($completed)) { |
283 | 283 | $context = $this->context; |
284 | 284 | /** @var ExtendedPromiseInterface $completed */ |
285 | - return $completed->then(null, function ($error) use ($context, $fieldNodes, $path) { |
|
285 | + return $completed->then(null, function($error) use ($context, $fieldNodes, $path) { |
|
286 | 286 | //@TODO Handle $error better |
287 | 287 | if ($error instanceof \Exception) { |
288 | 288 | $context->addError($this->buildLocatedError($error, $fieldNodes, $path)); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | if ($doesContainPromise) { |
376 | 376 | $keys = \array_keys($finalResults); |
377 | 377 | $promise = promiseAll(\array_values($finalResults)); |
378 | - $promise->then(function ($values) use ($keys, &$finalResults) { |
|
378 | + $promise->then(function($values) use ($keys, &$finalResults) { |
|
379 | 379 | /** @noinspection ForeachSourceInspection */ |
380 | 380 | foreach ($values as $i => $value) { |
381 | 381 | $finalResults[$keys[$i]] = $value; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | ) { |
474 | 474 | if ($this->isPromise($result)) { |
475 | 475 | /** @var ExtendedPromiseInterface $result */ |
476 | - return $result->then(function (&$value) use ($returnType, $fieldNodes, $info, $path) { |
|
476 | + return $result->then(function(&$value) use ($returnType, $fieldNodes, $info, $path) { |
|
477 | 477 | return $this->completeValue($returnType, $fieldNodes, $info, $path, $value); |
478 | 478 | }); |
479 | 479 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | |
562 | 562 | if ($this->isPromise($runtimeType)) { |
563 | 563 | /** @var ExtendedPromiseInterface $runtimeType */ |
564 | - return $runtimeType->then(function ($resolvedRuntimeType) use ( |
|
564 | + return $runtimeType->then(function($resolvedRuntimeType) use ( |
|
565 | 565 | $returnType, |
566 | 566 | $fieldNodes, |
567 | 567 | $info, |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | |
691 | 691 | if (!empty($promisedIsTypeOfResults)) { |
692 | 692 | return promiseAll($promisedIsTypeOfResults) |
693 | - ->then(function ($isTypeOfResults) use ($possibleTypes) { |
|
693 | + ->then(function($isTypeOfResults) use ($possibleTypes) { |
|
694 | 694 | /** @noinspection ForeachSourceInspection */ |
695 | 695 | foreach ($isTypeOfResults as $index => $result) { |
696 | 696 | if ($result) { |
@@ -691,13 +691,13 @@ |
||
691 | 691 | |
692 | 692 | return new Conflict( |
693 | 693 | $responseName, |
694 | - array_map(function (Conflict $conflict) { |
|
694 | + array_map(function(Conflict $conflict) { |
|
695 | 695 | return [$conflict->getResponseName(), $conflict->getReason()]; |
696 | 696 | }, $conflicts), |
697 | - array_reduce($conflicts, function ($allFields, Conflict $conflict) { |
|
697 | + array_reduce($conflicts, function($allFields, Conflict $conflict) { |
|
698 | 698 | return array_merge($allFields, $conflict->getFieldsA()); |
699 | 699 | }, [$nodeA]), |
700 | - array_reduce($conflicts, function ($allFields, Conflict $conflict) { |
|
700 | + array_reduce($conflicts, function($allFields, Conflict $conflict) { |
|
701 | 701 | return array_merge($allFields, $conflict->getFieldsB()); |
702 | 702 | }, [$nodeB]) |
703 | 703 | ); |
@@ -124,7 +124,7 @@ |
||
124 | 124 | { |
125 | 125 | return arraySome( |
126 | 126 | introspectionTypes(), |
127 | - function (NamedTypeInterface $introspectionType) use ($type) { |
|
127 | + function(NamedTypeInterface $introspectionType) use ($type) { |
|
128 | 128 | /** @noinspection PhpUndefinedMethodInspection */ |
129 | 129 | return $type->getName() === $introspectionType->getName(); |
130 | 130 | } |