@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $result = []; |
| 135 | 135 | |
| 136 | - if (! empty($this->errors)) { |
|
| 137 | - $errorsHandler = $this->errorsHandler ?: function (array $errors, callable $formatter) { |
|
| 136 | + if (!empty($this->errors)) { |
|
| 137 | + $errorsHandler = $this->errorsHandler ?: function(array $errors, callable $formatter) { |
|
| 138 | 138 | return array_map($formatter, $errors); |
| 139 | 139 | }; |
| 140 | 140 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $result['data'] = $this->data; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if (! empty($this->extensions)) { |
|
| 151 | + if (!empty($this->extensions)) { |
|
| 152 | 152 | $result['extensions'] = (array) $this->extensions; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -80,12 +80,12 @@ |
||
| 80 | 80 | // TODO: rework with generators when PHP minimum required version is changed to 5.5+ |
| 81 | 81 | $promisesOrValues = Utils::map( |
| 82 | 82 | $promisesOrValues, |
| 83 | - function ($item) { |
|
| 83 | + function($item) { |
|
| 84 | 84 | return $item instanceof Promise ? $item->adoptedPromise : $item; |
| 85 | 85 | } |
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | - $promise = all($promisesOrValues)->then(function ($values) use ($promisesOrValues) { |
|
| 88 | + $promise = all($promisesOrValues)->then(function($values) use ($promisesOrValues) { |
|
| 89 | 89 | $orderedResults = []; |
| 90 | 90 | |
| 91 | 91 | foreach ($promisesOrValues as $key => $value) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public static function runQueue() |
| 41 | 41 | { |
| 42 | 42 | $q = self::$queue; |
| 43 | - while ($q && ! $q->isEmpty()) { |
|
| 43 | + while ($q && !$q->isEmpty()) { |
|
| 44 | 44 | $task = $q->dequeue(); |
| 45 | 45 | $task(); |
| 46 | 46 | } |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | if (is_object($value) && method_exists($value, 'then')) { |
| 57 | 57 | $value->then( |
| 58 | - function ($resolvedValue) { |
|
| 58 | + function($resolvedValue) { |
|
| 59 | 59 | $this->resolve($resolvedValue); |
| 60 | 60 | }, |
| 61 | - function ($reason) { |
|
| 61 | + function($reason) { |
|
| 62 | 62 | $this->reject($reason); |
| 63 | 63 | } |
| 64 | 64 | ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function reject($reason) |
| 86 | 86 | { |
| 87 | - if (! $reason instanceof \Exception && ! $reason instanceof \Throwable) { |
|
| 87 | + if (!$reason instanceof \Exception && !$reason instanceof \Throwable) { |
|
| 88 | 88 | throw new \Exception('SyncPromise::reject() has to be called with an instance of \Throwable'); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | 116 | foreach ($this->waiting as $descriptor) { |
| 117 | - self::getQueue()->enqueue(function () use ($descriptor) { |
|
| 117 | + self::getQueue()->enqueue(function() use ($descriptor) { |
|
| 118 | 118 | /** @var $promise self */ |
| 119 | 119 | list($promise, $onFulfilled, $onRejected) = $descriptor; |
| 120 | 120 | |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | public function then(?callable $onFulfilled = null, ?callable $onRejected = null) |
| 153 | 153 | { |
| 154 | - if ($this->state === self::REJECTED && ! $onRejected) { |
|
| 154 | + if ($this->state === self::REJECTED && !$onRejected) { |
|
| 155 | 155 | return $this; |
| 156 | 156 | } |
| 157 | - if ($this->state === self::FULFILLED && ! $onFulfilled) { |
|
| 157 | + if ($this->state === self::FULFILLED && !$onFulfilled) { |
|
| 158 | 158 | return $this; |
| 159 | 159 | } |
| 160 | 160 | $tmp = new self(); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function convertThenable($thenable) |
| 33 | 33 | { |
| 34 | - if (! $thenable instanceof Deferred) { |
|
| 34 | + if (!$thenable instanceof Deferred) { |
|
| 35 | 35 | throw new InvariantViolation('Expected instance of GraphQL\Deferred, got ' . Utils::printSafe($thenable)); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if ($promiseOrValue instanceof Promise) { |
| 112 | 112 | $result[$index] = null; |
| 113 | 113 | $promiseOrValue->then( |
| 114 | - function ($value) use ($index, &$count, $total, &$result, $all) { |
|
| 114 | + function($value) use ($index, &$count, $total, &$result, $all) { |
|
| 115 | 115 | $result[$index] = $value; |
| 116 | 116 | $count++; |
| 117 | 117 | if ($count < $total) { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $promiseQueue = SyncPromise::getQueue(); |
| 147 | 147 | |
| 148 | 148 | while ($promise->adoptedPromise->state === SyncPromise::PENDING && |
| 149 | - ! ($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
| 149 | + !($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
| 150 | 150 | ) { |
| 151 | 151 | Deferred::runQueue(); |
| 152 | 152 | SyncPromise::runQueue(); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct($adoptedPromise, PromiseAdapter $adapter) |
| 25 | 25 | { |
| 26 | - Utils::invariant(! $adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . __CLASS__); |
|
| 26 | + Utils::invariant(!$adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . __CLASS__); |
|
| 27 | 27 | |
| 28 | 28 | $this->adapter = $adapter; |
| 29 | 29 | $this->adoptedPromise = $adoptedPromise; |
@@ -489,7 +489,7 @@ |
||
| 489 | 489 | case 117: |
| 490 | 490 | $position = $this->position; |
| 491 | 491 | list ($hex) = $this->readChars(4, true); |
| 492 | - if (! preg_match('/[0-9a-fA-F]{4}/', $hex)) { |
|
| 492 | + if (!preg_match('/[0-9a-fA-F]{4}/', $hex)) { |
|
| 493 | 493 | throw new SyntaxError( |
| 494 | 494 | $this->source, |
| 495 | 495 | $position - 1, |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $this->endToken = $endToken; |
| 68 | 68 | $this->source = $source; |
| 69 | 69 | |
| 70 | - if (! $startToken || ! $endToken) { |
|
| 70 | + if (!$startToken || !$endToken) { |
|
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $this->expect($openKind); |
| 300 | 300 | |
| 301 | 301 | $nodes = []; |
| 302 | - while (! $this->skip($closeKind)) { |
|
| 302 | + while (!$this->skip($closeKind)) { |
|
| 303 | 303 | $nodes[] = $parseFn($this); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | $this->expect($openKind); |
| 324 | 324 | |
| 325 | 325 | $nodes = [$parseFn($this)]; |
| 326 | - while (! $this->skip($closeKind)) { |
|
| 326 | + while (!$this->skip($closeKind)) { |
|
| 327 | 327 | $nodes[] = $parseFn($this); |
| 328 | 328 | } |
| 329 | 329 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $definitions = []; |
| 361 | 361 | do { |
| 362 | 362 | $definitions[] = $this->parseDefinition(); |
| 363 | - } while (! $this->skip(Token::EOF)); |
|
| 363 | + } while (!$this->skip(Token::EOF)); |
|
| 364 | 364 | |
| 365 | 365 | return new DocumentNode([ |
| 366 | 366 | 'definitions' => new NodeList($definitions), |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | return $this->peek(Token::PAREN_L) ? |
| 493 | 493 | $this->many( |
| 494 | 494 | Token::PAREN_L, |
| 495 | - function () { |
|
| 495 | + function() { |
|
| 496 | 496 | return $this->parseVariableDefinition(); |
| 497 | 497 | }, |
| 498 | 498 | Token::PAREN_R |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | [ |
| 548 | 548 | 'selections' => $this->many( |
| 549 | 549 | Token::BRACE_L, |
| 550 | - function () { |
|
| 550 | + function() { |
|
| 551 | 551 | return $this->parseSelection(); |
| 552 | 552 | }, |
| 553 | 553 | Token::BRACE_R |
@@ -568,8 +568,7 @@ discard block |
||
| 568 | 568 | private function parseSelection() |
| 569 | 569 | { |
| 570 | 570 | return $this->peek(Token::SPREAD) ? |
| 571 | - $this->parseFragment() : |
|
| 572 | - $this->parseField(); |
|
| 571 | + $this->parseFragment() : $this->parseField(); |
|
| 573 | 572 | } |
| 574 | 573 | |
| 575 | 574 | /** |
@@ -607,16 +606,15 @@ discard block |
||
| 607 | 606 | private function parseArguments($isConst) |
| 608 | 607 | { |
| 609 | 608 | $parseFn = $isConst ? |
| 610 | - function () { |
|
| 609 | + function() { |
|
| 611 | 610 | return $this->parseConstArgument(); |
| 612 | 611 | } : |
| 613 | - function () { |
|
| 612 | + function() { |
|
| 614 | 613 | return $this->parseArgument(); |
| 615 | 614 | }; |
| 616 | 615 | |
| 617 | 616 | return $this->peek(Token::PAREN_L) ? |
| 618 | - $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) : |
|
| 619 | - new NodeList([]); |
|
| 617 | + $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) : new NodeList([]); |
|
| 620 | 618 | } |
| 621 | 619 | |
| 622 | 620 | /** |
@@ -808,7 +806,7 @@ discard block |
||
| 808 | 806 | break; |
| 809 | 807 | |
| 810 | 808 | case Token::DOLLAR: |
| 811 | - if (! $isConst) { |
|
| 809 | + if (!$isConst) { |
|
| 812 | 810 | return $this->parseVariable(); |
| 813 | 811 | } |
| 814 | 812 | break; |
@@ -855,9 +853,9 @@ discard block |
||
| 855 | 853 | private function parseArray($isConst) |
| 856 | 854 | { |
| 857 | 855 | $start = $this->lexer->token; |
| 858 | - $parseFn = $isConst ? function () { |
|
| 856 | + $parseFn = $isConst ? function() { |
|
| 859 | 857 | return $this->parseConstValue(); |
| 860 | - } : function () { |
|
| 858 | + } : function() { |
|
| 861 | 859 | return $this->parseVariableValue(); |
| 862 | 860 | }; |
| 863 | 861 | |
@@ -878,7 +876,7 @@ discard block |
||
| 878 | 876 | $start = $this->lexer->token; |
| 879 | 877 | $this->expect(Token::BRACE_L); |
| 880 | 878 | $fields = []; |
| 881 | - while (! $this->skip(Token::BRACE_R)) { |
|
| 879 | + while (!$this->skip(Token::BRACE_R)) { |
|
| 882 | 880 | $fields[] = $this->parseObjectField($isConst); |
| 883 | 881 | } |
| 884 | 882 | |
@@ -1065,7 +1063,7 @@ discard block |
||
| 1065 | 1063 | |
| 1066 | 1064 | $operationTypes = $this->many( |
| 1067 | 1065 | Token::BRACE_L, |
| 1068 | - function () { |
|
| 1066 | + function() { |
|
| 1069 | 1067 | return $this->parseOperationTypeDefinition(); |
| 1070 | 1068 | }, |
| 1071 | 1069 | Token::BRACE_R |
@@ -1158,7 +1156,7 @@ discard block |
||
| 1158 | 1156 | $types[] = $this->parseNamedType(); |
| 1159 | 1157 | } while ($this->skip(Token::AMP) || |
| 1160 | 1158 | // Legacy support for the SDL? |
| 1161 | - (! empty($this->lexer->options['allowLegacySDLImplementsInterfaces']) && $this->peek(Token::NAME)) |
|
| 1159 | + (!empty($this->lexer->options['allowLegacySDLImplementsInterfaces']) && $this->peek(Token::NAME)) |
|
| 1162 | 1160 | ); |
| 1163 | 1161 | } |
| 1164 | 1162 | |
@@ -1172,7 +1170,7 @@ discard block |
||
| 1172 | 1170 | private function parseFieldsDefinition() |
| 1173 | 1171 | { |
| 1174 | 1172 | // Legacy support for the SDL? |
| 1175 | - if (! empty($this->lexer->options['allowLegacySDLEmptyFields']) && |
|
| 1173 | + if (!empty($this->lexer->options['allowLegacySDLEmptyFields']) && |
|
| 1176 | 1174 | $this->peek(Token::BRACE_L) && |
| 1177 | 1175 | $this->lexer->lookahead()->kind === Token::BRACE_R |
| 1178 | 1176 | ) { |
@@ -1185,7 +1183,7 @@ discard block |
||
| 1185 | 1183 | return $this->peek(Token::BRACE_L) |
| 1186 | 1184 | ? $this->many( |
| 1187 | 1185 | Token::BRACE_L, |
| 1188 | - function () { |
|
| 1186 | + function() { |
|
| 1189 | 1187 | return $this->parseFieldDefinition(); |
| 1190 | 1188 | }, |
| 1191 | 1189 | Token::BRACE_R |
@@ -1223,13 +1221,13 @@ discard block |
||
| 1223 | 1221 | */ |
| 1224 | 1222 | private function parseArgumentDefs() |
| 1225 | 1223 | { |
| 1226 | - if (! $this->peek(Token::PAREN_L)) { |
|
| 1224 | + if (!$this->peek(Token::PAREN_L)) { |
|
| 1227 | 1225 | return new NodeList([]); |
| 1228 | 1226 | } |
| 1229 | 1227 | |
| 1230 | 1228 | return $this->many( |
| 1231 | 1229 | Token::PAREN_L, |
| 1232 | - function () { |
|
| 1230 | + function() { |
|
| 1233 | 1231 | return $this->parseInputValueDef(); |
| 1234 | 1232 | }, |
| 1235 | 1233 | Token::PAREN_R |
@@ -1362,7 +1360,7 @@ discard block |
||
| 1362 | 1360 | return $this->peek(Token::BRACE_L) |
| 1363 | 1361 | ? $this->many( |
| 1364 | 1362 | Token::BRACE_L, |
| 1365 | - function () { |
|
| 1363 | + function() { |
|
| 1366 | 1364 | return $this->parseEnumValueDefinition(); |
| 1367 | 1365 | }, |
| 1368 | 1366 | Token::BRACE_R |
@@ -1420,7 +1418,7 @@ discard block |
||
| 1420 | 1418 | return $this->peek(Token::BRACE_L) |
| 1421 | 1419 | ? $this->many( |
| 1422 | 1420 | Token::BRACE_L, |
| 1423 | - function () { |
|
| 1421 | + function() { |
|
| 1424 | 1422 | return $this->parseInputValueDef(); |
| 1425 | 1423 | }, |
| 1426 | 1424 | Token::BRACE_R |
@@ -1559,7 +1557,7 @@ discard block |
||
| 1559 | 1557 | $directives = $this->parseDirectives(true); |
| 1560 | 1558 | $types = $this->parseUnionMemberTypes(); |
| 1561 | 1559 | if (count($directives) === 0 && |
| 1562 | - ! $types |
|
| 1560 | + !$types |
|
| 1563 | 1561 | ) { |
| 1564 | 1562 | throw $this->unexpected(); |
| 1565 | 1563 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function getVisitor(ValidationContext $context) |
| 27 | 27 | { |
| 28 | 28 | return [ |
| 29 | - NodeKind::ARGUMENT => function (ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 29 | + NodeKind::ARGUMENT => function(ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 30 | 30 | /** @var NodeList|Node[] $ancestors */ |
| 31 | 31 | $argDef = $context->getArgument(); |
| 32 | 32 | if ($argDef !== null) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | Utils::suggestionList( |
| 47 | 47 | $node->name->value, |
| 48 | 48 | array_map( |
| 49 | - function ($arg) { |
|
| 49 | + function($arg) { |
|
| 50 | 50 | return $arg->name; |
| 51 | 51 | }, |
| 52 | 52 | $fieldDef->args |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | Utils::suggestionList( |
| 67 | 67 | $node->name->value, |
| 68 | 68 | array_map( |
| 69 | - function ($arg) { |
|
| 69 | + function($arg) { |
|
| 70 | 70 | return $arg->name; |
| 71 | 71 | }, |
| 72 | 72 | $directive->args |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs) |
| 88 | 88 | { |
| 89 | 89 | $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName); |
| 90 | - if (! empty($suggestedArgs)) { |
|
| 90 | + if (!empty($suggestedArgs)) { |
|
| 91 | 91 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public static function unknownDirectiveArgMessage($argName, $directiveName, array $suggestedArgs) |
| 101 | 101 | { |
| 102 | 102 | $message = sprintf('Unknown argument "%s" on directive "@%s".', $argName, $directiveName); |
| 103 | - if (! empty($suggestedArgs)) { |
|
| 103 | + if (!empty($suggestedArgs)) { |
|
| 104 | 104 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 105 | 105 | } |
| 106 | 106 | |