@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $data = $this->executeOperation($operationName, $context, $fieldCollector, $valuesResolver); |
| 54 | 54 | |
| 55 | 55 | if ($data instanceof PromiseInterface) { |
| 56 | - $data->then(function ($resolvedData) use (&$data) { |
|
| 56 | + $data->then(function($resolvedData) use (&$data) { |
|
| 57 | 57 | $data = $resolvedData; |
| 58 | 58 | }); |
| 59 | 59 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | if ($result instanceof PromiseInterface) { |
| 94 | - return $result->then(null, function (ExecutionException $exception) use ($context) { |
|
| 94 | + return $result->then(null, function(ExecutionException $exception) use ($context) { |
|
| 95 | 95 | $context->addError($exception); |
| 96 | 96 | return \React\Promise\resolve(null); |
| 97 | 97 | }); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | return promiseReduce( |
| 25 | 25 | \array_keys($fields), |
| 26 | - function ($results, $fieldName) use ($parentType, $rootValue, $path, $fields) { |
|
| 26 | + function($results, $fieldName) use ($parentType, $rootValue, $path, $fields) { |
|
| 27 | 27 | $fieldNodes = $fields[$fieldName]; |
| 28 | 28 | $fieldPath = $path; |
| 29 | 29 | $fieldPath[] = $fieldName; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if ($result instanceof PromiseInterface) { |
| 38 | - return $result->then(function ($resolvedResult) use ($fieldName, $results) { |
|
| 38 | + return $result->then(function($resolvedResult) use ($fieldName, $results) { |
|
| 39 | 39 | $results[$fieldName] = $resolvedResult; |
| 40 | 40 | return $results; |
| 41 | 41 | }); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function executeFields(ObjectType $parentType, $rootValue, array $path, array $fields) |
| 23 | 23 | { |
| 24 | - $results = []; |
|
| 24 | + $results = []; |
|
| 25 | 25 | $containsPromise = false; |
| 26 | 26 | |
| 27 | 27 | foreach ($fields as $fieldName => $fieldNodes) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | continue; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $containsPromise = $containsPromise || $result instanceof PromiseInterface; |
|
| 37 | + $containsPromise = $containsPromise || $result instanceof PromiseInterface; |
|
| 38 | 38 | $results[$fieldName] = $result; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function handleError(\Throwable $exception): void |
| 30 | 30 | { |
| 31 | - $next = function () { |
|
| 31 | + $next = function() { |
|
| 32 | 32 | // NO-OP |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | foreach ($this->middleware as $middleware) { |
| 36 | - $next = function (\Throwable $exception) use ($middleware, $next) { |
|
| 36 | + $next = function(\Throwable $exception) use ($middleware, $next) { |
|
| 37 | 37 | return $middleware->handleError($exception, $next); |
| 38 | 38 | }; |
| 39 | 39 | } |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function handleExecutionError(ExecutionException $exception, ExecutionContext $context): void |
| 48 | 48 | { |
| 49 | - $next = function () { |
|
| 49 | + $next = function() { |
|
| 50 | 50 | // NO-OP |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | 53 | foreach ($this->middleware as $middleware) { |
| 54 | - $next = function (ExecutionException $exception, ExecutionContext $context) use ($middleware, $next) { |
|
| 54 | + $next = function(ExecutionException $exception, ExecutionContext $context) use ($middleware, $next) { |
|
| 55 | 55 | return $middleware->handleExecutionError($exception, $context, $next); |
| 56 | 56 | }; |
| 57 | 57 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function getLocationsAsArray(): ?array |
| 162 | 162 | { |
| 163 | - return !empty($this->locations) ? \array_map(function (SourceLocation $location) { |
|
| 163 | + return !empty($this->locations) ? \array_map(function(SourceLocation $location) { |
|
| 164 | 164 | return $location->toArray(); |
| 165 | 165 | }, $this->locations) : null; |
| 166 | 166 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $nodes = [$nodes]; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - $this->nodes = \array_filter($nodes, function ($node) { |
|
| 248 | + $this->nodes = \array_filter($nodes, function($node) { |
|
| 249 | 249 | return null !== $node; |
| 250 | 250 | }); |
| 251 | 251 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | protected function resolvePositions(?array $positions): self |
| 277 | 277 | { |
| 278 | 278 | if (null === $positions && !empty($this->nodes)) { |
| 279 | - $positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) { |
|
| 279 | + $positions = \array_reduce($this->nodes, function(array $list, ?NodeInterface $node) { |
|
| 280 | 280 | if (null !== $node) { |
| 281 | 281 | $location = $node->getLocation(); |
| 282 | 282 | if (null !== $location) { |
@@ -306,11 +306,11 @@ discard block |
||
| 306 | 306 | $locations = null; |
| 307 | 307 | |
| 308 | 308 | if (null !== $positions && null !== $source) { |
| 309 | - $locations = \array_map(function ($position) use ($source) { |
|
| 309 | + $locations = \array_map(function($position) use ($source) { |
|
| 310 | 310 | return SourceLocation::fromSource($source, $position); |
| 311 | 311 | }, $positions); |
| 312 | 312 | } elseif (!empty($this->nodes)) { |
| 313 | - $locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
| 313 | + $locations = \array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
| 314 | 314 | $location = $node->getLocation(); |
| 315 | 315 | if (null !== $location) { |
| 316 | 316 | $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart()); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $context->getContextValue(), $info); |
| 249 | 249 | |
| 250 | 250 | if ($result instanceof PromiseInterface) { |
| 251 | - return $result->then(null, function ($exception) use ($fieldNode, $info) { |
|
| 251 | + return $result->then(null, function($exception) use ($fieldNode, $info) { |
|
| 252 | 252 | return !$exception instanceof ExecutionException |
| 253 | 253 | ? $this->normalizeException($exception, [$fieldNode], $info->getPath()) |
| 254 | 254 | : $exception; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | ) { |
| 325 | 325 | try { |
| 326 | 326 | $completed = $result instanceof PromiseInterface |
| 327 | - ? $result->then(function ($resolvedResult) use ($returnType, $fieldNodes, $info, $path) { |
|
| 327 | + ? $result->then(function($resolvedResult) use ($returnType, $fieldNodes, $info, $path) { |
|
| 328 | 328 | return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolvedResult); |
| 329 | 329 | }) |
| 330 | 330 | : $this->completeValue($returnType, $fieldNodes, $info, $path, $result); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | if ($completed instanceof PromiseInterface) { |
| 333 | 333 | // Note: we don't rely on a `catch` method, but we do expect "thenable" |
| 334 | 334 | // to take a second callback for the error case. |
| 335 | - return $completed->then(null, function ($exception) use ($fieldNodes, $path, $returnType) { |
|
| 335 | + return $completed->then(null, function($exception) use ($fieldNodes, $path, $returnType) { |
|
| 336 | 336 | $this->handleFieldError($exception, $fieldNodes, $path, $returnType); |
| 337 | 337 | }); |
| 338 | 338 | } |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | ); |
| 531 | 531 | |
| 532 | 532 | if ($runtimeType instanceof PromiseInterface) { |
| 533 | - return $runtimeType->then(function ($resolvedRuntimeType) use ( |
|
| 533 | + return $runtimeType->then(function($resolvedRuntimeType) use ( |
|
| 534 | 534 | $returnType, |
| 535 | 535 | $fieldNodes, |
| 536 | 536 | $info, |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | $isTypeOf = $returnType->isTypeOf($result, $this->context->getContextValue(), $info); |
| 585 | 585 | |
| 586 | 586 | if ($isTypeOf instanceof PromiseInterface) { |
| 587 | - return $isTypeOf->then(function ($resolvedIsTypeOf) use ($returnType, $result, $fieldNodes, $path) { |
|
| 587 | + return $isTypeOf->then(function($resolvedIsTypeOf) use ($returnType, $result, $fieldNodes, $path) { |
|
| 588 | 588 | if (true === $resolvedIsTypeOf) { |
| 589 | 589 | return $this->executeSubFields($returnType, $fieldNodes, $path, $result); |
| 590 | 590 | } |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | if (!empty($promises)) { |
| 876 | - return \React\Promise\all($promises)->then(function ($resolvedPromises) use ($possibleTypes) { |
|
| 876 | + return \React\Promise\all($promises)->then(function($resolvedPromises) use ($possibleTypes) { |
|
| 877 | 877 | foreach ($resolvedPromises as $index => $result) { |
| 878 | 878 | if (true === $result) { |
| 879 | 879 | return $possibleTypes[$index]; |