@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function write(NodeInterface $node): string |
17 | 17 | { |
18 | - return '$'.$node->getName(); |
|
18 | + return '$' . $node->getName(); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function write(NodeInterface $node): string |
17 | 17 | { |
18 | - return implode("\n\n", $node->getDefinitions())."\n"; |
|
18 | + return implode("\n\n", $node->getDefinitions()) . "\n"; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $name = $this->printNode($node->getName()); |
20 | 20 | $directives = $this->printNodes($node->getDirectives()); |
21 | 21 | |
22 | - return '...'.$name.wrap(' ', implode(' ', $directives)); |
|
22 | + return '...' . $name . wrap(' ', implode(' ', $directives)); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $selectionSet = $this->printNode($node->getSelectionSet()); |
24 | 24 | |
25 | 25 | return implode(' ', [ |
26 | - wrap('', $alias, ': ').$name.wrap('(', implode(', ', $arguments), |
|
26 | + wrap('', $alias, ': ') . $name . wrap('(', implode(', ', $arguments), |
|
27 | 27 | ')'), |
28 | 28 | implode(' ', $directives), |
29 | 29 | $selectionSet, |
@@ -25,9 +25,9 @@ |
||
25 | 25 | // Note: fragment variable definitions are experimental and may be changed |
26 | 26 | // or removed in the future. |
27 | 27 | return implode(' ', [ |
28 | - 'fragment '.$name.wrap('(', implode(', ', $variableDefinitions), |
|
28 | + 'fragment ' . $name . wrap('(', implode(', ', $variableDefinitions), |
|
29 | 29 | ')'), |
30 | - 'on '.$typeCondition.' '.implode(' ', $directives), |
|
30 | + 'on ' . $typeCondition . ' ' . implode(' ', $directives), |
|
31 | 31 | $selectionSet, |
32 | 32 | ]); |
33 | 33 | } |
@@ -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( |