@@ -18,7 +18,7 @@ |
||
18 | 18 | $name = $this->printNode($node->getName()); |
19 | 19 | $value = $this->printNode($node->getValue()); |
20 | 20 | |
21 | - return $name.': '.$value; |
|
21 | + return $name . ': ' . $value; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -80,6 +80,6 @@ |
||
80 | 80 | */ |
81 | 81 | protected function getCacheKey($key): string |
82 | 82 | { |
83 | - return $this->getCachePrefix().$key; |
|
83 | + return $this->getCachePrefix() . $key; |
|
84 | 84 | } |
85 | 85 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | if (is_object($rootValue)) { |
111 | - $getter = 'get'.ucfirst($fieldName); |
|
111 | + $getter = 'get' . ucfirst($fieldName); |
|
112 | 112 | if (method_exists($rootValue, $getter)) { |
113 | 113 | $property = $rootValue->{$getter}(); |
114 | 114 | } elseif (property_exists($rootValue, $fieldName)) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | $promise = new \React\Promise\FulfilledPromise([]); |
154 | 154 | |
155 | - $resolve = function ( |
|
155 | + $resolve = function( |
|
156 | 156 | $results, |
157 | 157 | $fieldName, |
158 | 158 | $path, |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | if ($this->isPromise($result)) { |
173 | 173 | /** @var ExtendedPromiseInterface $result */ |
174 | - return $result->then(function ($resolvedResult) use ( |
|
174 | + return $result->then(function($resolvedResult) use ( |
|
175 | 175 | $fieldName, |
176 | 176 | $results |
177 | 177 | ) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | }; |
188 | 188 | |
189 | 189 | foreach ($fields as $fieldName => $fieldNodes) { |
190 | - $promise = $promise->then(function ($resolvedResults) use ( |
|
190 | + $promise = $promise->then(function($resolvedResults) use ( |
|
191 | 191 | $resolve, |
192 | 192 | $fieldName, |
193 | 193 | $path, |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | }); |
201 | 201 | } |
202 | 202 | |
203 | - $promise->then(function ($resolvedResults) use (&$finalResults) { |
|
203 | + $promise->then(function($resolvedResults) use (&$finalResults) { |
|
204 | 204 | $finalResults = $resolvedResults ?? []; |
205 | 205 | }); |
206 | 206 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | |
423 | 423 | /** @var ExtendedPromiseInterface $completed */ |
424 | 424 | return $completed->then(null, |
425 | - function ($error) use ($context, $fieldNodes, $path) { |
|
425 | + function($error) use ($context, $fieldNodes, $path) { |
|
426 | 426 | //@TODO Handle $error better |
427 | 427 | if ($error instanceof \Exception) { |
428 | 428 | $context->addError($this->buildLocatedError($error, |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | ) { |
506 | 506 | if ($this->isPromise($result)) { |
507 | 507 | /** @var ExtendedPromiseInterface $result */ |
508 | - return $result->then(function (&$value) use ( |
|
508 | + return $result->then(function(&$value) use ( |
|
509 | 509 | $returnType, |
510 | 510 | $fieldNodes, |
511 | 511 | $info, |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | |
682 | 682 | if ($this->isPromise($runtimeType)) { |
683 | 683 | /** @var ExtendedPromiseInterface $runtimeType */ |
684 | - return $runtimeType->then(function ($resolvedRuntimeType) use ( |
|
684 | + return $runtimeType->then(function($resolvedRuntimeType) use ( |
|
685 | 685 | $returnType, |
686 | 686 | $fieldNodes, |
687 | 687 | $info, |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | |
761 | 761 | if (!empty($promisedIsTypeOfResults)) { |
762 | 762 | return \React\Promise\all($promisedIsTypeOfResults) |
763 | - ->then(function ($isTypeOfResults) use ($possibleTypes) { |
|
763 | + ->then(function($isTypeOfResults) use ($possibleTypes) { |
|
764 | 764 | foreach ($isTypeOfResults as $index => $result) { |
765 | 765 | if ($result) { |
766 | 766 | return $possibleTypes[$index]; |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | if ($isContainsPromise) { |
1036 | 1036 | $keys = array_keys($finalResults); |
1037 | 1037 | $promise = \React\Promise\all(array_values($finalResults)); |
1038 | - $promise->then(function ($values) use ($keys, &$finalResults) { |
|
1038 | + $promise->then(function($values) use ($keys, &$finalResults) { |
|
1039 | 1039 | foreach ($values as $i => $value) { |
1040 | 1040 | $finalResults[$keys[$i]] = $value; |
1041 | 1041 | } |
@@ -1074,9 +1074,9 @@ discard block |
||
1074 | 1074 | $fieldName = $info->getFieldName(); |
1075 | 1075 | |
1076 | 1076 | throw new ExecutionException( |
1077 | - "Abstract type {$returnTypeName} must resolve to an Object type at runtime ". |
|
1078 | - "for field {$parentTypeName}.{$fieldName} with ". |
|
1079 | - 'value "'.$result.'", received "{$runtimeTypeName}".' |
|
1077 | + "Abstract type {$returnTypeName} must resolve to an Object type at runtime " . |
|
1078 | + "for field {$parentTypeName}.{$fieldName} with " . |
|
1079 | + 'value "' . $result . '", received "{$runtimeTypeName}".' |
|
1080 | 1080 | ); |
1081 | 1081 | } |
1082 | 1082 | |
@@ -1090,8 +1090,8 @@ discard block |
||
1090 | 1090 | if ($runtimeType !== $this->context->getSchema() |
1091 | 1091 | ->getType($runtimeType->getName())) { |
1092 | 1092 | throw new ExecutionException( |
1093 | - "Schema must contain unique named types but contains multiple types named \"{$runtimeTypeName}\". ". |
|
1094 | - "Make sure that `resolveType` function of abstract type \"{$returnTypeName}\" returns the same ". |
|
1093 | + "Schema must contain unique named types but contains multiple types named \"{$runtimeTypeName}\". " . |
|
1094 | + "Make sure that `resolveType` function of abstract type \"{$returnTypeName}\" returns the same " . |
|
1095 | 1095 | "type instance as referenced anywhere else within the schema." |
1096 | 1096 | ); |
1097 | 1097 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $directiveNode = $node->hasDirectives() |
59 | 59 | ? find($node->getDirectives(), |
60 | - function (NameAwareInterface $value) use ($directive) { |
|
60 | + function(NameAwareInterface $value) use ($directive) { |
|
61 | 61 | return $value->getNameValue() === $directive->getName(); |
62 | 62 | }) : null; |
63 | 63 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | $argumentNodeMap = keyMap($argumentNodes, |
101 | - function (ArgumentNode $value) { |
|
101 | + function(ArgumentNode $value) { |
|
102 | 102 | return $value->getNameValue(); |
103 | 103 | }); |
104 | 104 | |
@@ -317,9 +317,9 @@ discard block |
||
317 | 317 | $stringPath = $this->printPath($path); |
318 | 318 | |
319 | 319 | return new CoercingException( |
320 | - $message. |
|
321 | - (($stringPath !== '') ? ' at '.$stringPath : $stringPath). |
|
322 | - (($subMessage !== null) ? '; '.$subMessage : '.'), |
|
320 | + $message . |
|
321 | + (($stringPath !== '') ? ' at ' . $stringPath : $stringPath) . |
|
322 | + (($subMessage !== null) ? '; ' . $subMessage : '.'), |
|
323 | 323 | [$blameNode], |
324 | 324 | null, |
325 | 325 | null, |
@@ -340,15 +340,15 @@ discard block |
||
340 | 340 | |
341 | 341 | while ($currentPath) { |
342 | 342 | if (is_string($currentPath->getKey())) { |
343 | - $stringPath = '.'.$currentPath->getKey().$stringPath; |
|
343 | + $stringPath = '.' . $currentPath->getKey() . $stringPath; |
|
344 | 344 | } else { |
345 | - $stringPath = '['.(string)$currentPath->getKey().']'.$stringPath; |
|
345 | + $stringPath = '[' . (string)$currentPath->getKey() . ']' . $stringPath; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | $currentPath = $currentPath->getPrevious(); |
349 | 349 | } |
350 | 350 | |
351 | - return !empty($stringPath) ? 'value'.$stringPath : ''; |
|
351 | + return !empty($stringPath) ? 'value' . $stringPath : ''; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | |
463 | 463 | return new CoercedValue($parseResult, null); |
464 | - } catch (InvalidTypeException|CoercingException $ex) { |
|
464 | + } catch (InvalidTypeException | CoercingException $ex) { |
|
465 | 465 | return new CoercedValue(null, [ |
466 | 466 | $this->buildCoerceException( |
467 | 467 | sprintf('Expected type %s', (string)$type), |
@@ -497,12 +497,12 @@ discard block |
||
497 | 497 | } |
498 | 498 | |
499 | 499 | $suggestions = suggestionList((string)$value, |
500 | - array_map(function (EnumValue $enumValue) { |
|
500 | + array_map(function(EnumValue $enumValue) { |
|
501 | 501 | return $enumValue->getName(); |
502 | 502 | }, $type->getValues())); |
503 | 503 | |
504 | 504 | $didYouMean = (!empty($suggestions)) |
505 | - ? 'did you mean'.implode(',', $suggestions) |
|
505 | + ? 'did you mean' . implode(',', $suggestions) |
|
506 | 506 | : null; |
507 | 507 | |
508 | 508 | return new CoercedValue(null, [ |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | if (!isset($fields[$fieldName])) { |
609 | 609 | $suggestions = suggestionList($fieldName, array_keys($fields)); |
610 | 610 | $didYouMean = (!empty($suggestions)) |
611 | - ? 'did you mean'.implode(',', $suggestions) |
|
611 | + ? 'did you mean' . implode(',', $suggestions) |
|
612 | 612 | : null; |
613 | 613 | |
614 | 614 | $errors[] = $this->buildCoerceException( |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | return arrayEvery($argumentsA, |
42 | - function (ArgumentNode $argumentA) use ($argumentsB) { |
|
42 | + function(ArgumentNode $argumentA) use ($argumentsB) { |
|
43 | 43 | $argumentB = find($argumentsB, |
44 | - function (ArgumentNode $argument) use ($argumentA) { |
|
44 | + function(ArgumentNode $argument) use ($argumentA) { |
|
45 | 45 | return $argument->getNameValue() === $argumentA->getNameValue(); |
46 | 46 | }); |
47 | 47 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | /** @var ObjectFieldNode[] $fieldNodes */ |
246 | 246 | $fieldNodes = keyMap($node->getFields(), |
247 | - function (ObjectFieldNode $value) { |
|
247 | + function(ObjectFieldNode $value) { |
|
248 | 248 | return $value->getNameValue(); |
249 | 249 | }); |
250 | 250 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->schema = $schema; |
82 | 82 | $this->getFieldDefinitionFunction = null !== $getFieldDefinitionFunction |
83 | 83 | ? $getFieldDefinitionFunction |
84 | - : function ( |
|
84 | + : function( |
|
85 | 85 | SchemaInterface $schema, |
86 | 86 | TypeInterface $parentType, |
87 | 87 | FieldNode $fieldNode |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | return $count === 1 |
39 | 39 | ? $selected[0] |
40 | 40 | : \array_reduce($selected, |
41 | - function ($list, $item) use ($count, &$index) { |
|
42 | - $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '').($index === ($count - 1) ? ' or ' : ''). |
|
41 | + function($list, $item) use ($count, &$index) { |
|
42 | + $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
|
43 | 43 | $item; |
44 | 44 | $index++; |
45 | 45 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $result = \array_keys($optionsByDistance); |
77 | 77 | |
78 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
78 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
79 | 79 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
80 | 80 | }); |
81 | 81 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function quotedOrList(array $items): string |
93 | 93 | { |
94 | - return orList(array_map(function ($item) { |
|
95 | - return '"'.$item.'"'; |
|
94 | + return orList(array_map(function($item) { |
|
95 | + return '"' . $item . '"'; |
|
96 | 96 | }, $items)); |
97 | 97 | } |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | function arrayEvery(array $array, callable $fn): bool |
107 | 107 | { |
108 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
108 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
109 | 109 | return $result && $fn($value); |
110 | 110 | }, true); |
111 | 111 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | function arraySome(array $array, callable $fn) |
120 | 120 | { |
121 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
121 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
122 | 122 | return $result || $fn($value); |
123 | 123 | }); |
124 | 124 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function keyMap(array $array, callable $keyFn): array |
150 | 150 | { |
151 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
151 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
152 | 152 | $map[$keyFn($item)] = $item; |
153 | 153 | |
154 | 154 | return $map; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | function keyValueMap(array $array, callable $keyFn, callable $valFn): array |
166 | 166 | { |
167 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
167 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
168 | 168 | $map[$keyFn($item)] = $valFn($item); |
169 | 169 | |
170 | 170 | return $map; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | protected function setConfig(array $config) |
31 | 31 | { |
32 | 32 | foreach ($config as $key => $value) { |
33 | - $setter = 'set'.ucfirst($key); |
|
33 | + $setter = 'set' . ucfirst($key); |
|
34 | 34 | if (method_exists($this, $setter)) { |
35 | 35 | $this->$setter($value); |
36 | 36 | } elseif (property_exists($this, $key)) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $argumentNodes = $node->getArguments(); |
38 | 38 | $argumentNodeMap = keyMap($argumentNodes, |
39 | - function (ArgumentNode $argument) { |
|
39 | + function(ArgumentNode $argument) { |
|
40 | 40 | return $argument->getNameValue(); |
41 | 41 | }); |
42 | 42 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $argumentNodes = $node->getArguments(); |
76 | 76 | $argumentNodeMap = keyMap($argumentNodes, |
77 | - function (ArgumentNode $argument) { |
|
77 | + function(ArgumentNode $argument) { |
|
78 | 78 | return $argument->getNameValue(); |
79 | 79 | }); |
80 | 80 |