@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'is also used as an input type, ensure "parseValue" and "parseLiteral" ' . |
| 66 | 66 | 'functions are also provided.' |
| 67 | 67 | ); |
| 68 | - if (! isset($this->config['parseValue']) && ! isset($this->config['parseLiteral'])) { |
|
| 68 | + if (!isset($this->config['parseValue']) && !isset($this->config['parseLiteral'])) { |
|
| 69 | 69 | return; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function __construct(array $config) |
| 34 | 34 | { |
| 35 | - if (! isset($config['name'])) { |
|
| 35 | + if (!isset($config['name'])) { |
|
| 36 | 36 | $config['name'] = $this->tryInferName(); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $resolveType = $this->config['resolveType'] ?? null; |
| 115 | 115 | |
| 116 | 116 | Utils::invariant( |
| 117 | - ! isset($resolveType) || is_callable($resolveType), |
|
| 117 | + !isset($resolveType) || is_callable($resolveType), |
|
| 118 | 118 | sprintf( |
| 119 | 119 | '%s must provide "resolveType" as a function, but got: %s', |
| 120 | 120 | $this->name, |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | { |
| 75 | 75 | $map = []; |
| 76 | 76 | foreach ($config as $name => $argConfig) { |
| 77 | - if (! is_array($argConfig)) { |
|
| 77 | + if (!is_array($argConfig)) { |
|
| 78 | 78 | $argConfig = ['type' => $argConfig]; |
| 79 | 79 | } |
| 80 | 80 | $map[] = new self($argConfig + ['name' => $name]); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | { |
| 64 | 64 | $config = new static(); |
| 65 | 65 | |
| 66 | - if (! empty($options)) { |
|
| 66 | + if (!empty($options)) { |
|
| 67 | 67 | if (isset($options['query'])) { |
| 68 | 68 | $config->setQuery($options['query']); |
| 69 | 69 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if (is_callable($fields)) { |
| 91 | 91 | $fields = $fields(); |
| 92 | 92 | } |
| 93 | - if (! is_array($fields)) { |
|
| 93 | + if (!is_array($fields)) { |
|
| 94 | 94 | throw new InvariantViolation( |
| 95 | 95 | sprintf('%s fields must be an array or a callable which returns such an array.', $type->name) |
| 96 | 96 | ); |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | $map = []; |
| 99 | 99 | foreach ($fields as $name => $field) { |
| 100 | 100 | if (is_array($field)) { |
| 101 | - if (! isset($field['name'])) { |
|
| 102 | - if (! is_string($name)) { |
|
| 101 | + if (!isset($field['name'])) { |
|
| 102 | + if (!is_string($name)) { |
|
| 103 | 103 | throw new InvariantViolation( |
| 104 | 104 | sprintf( |
| 105 | 105 | '%s fields must be an associative array with field names as keys or a function which returns such an array.', |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $field['name'] = $name; |
| 112 | 112 | } |
| 113 | - if (isset($field['args']) && ! is_array($field['args'])) { |
|
| 113 | + if (isset($field['args']) && !is_array($field['args'])) { |
|
| 114 | 114 | throw new InvariantViolation( |
| 115 | 115 | sprintf('%s.%s args must be an array.', $type->name, $name) |
| 116 | 116 | ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } elseif ($field instanceof self) { |
| 120 | 120 | $fieldDef = $field; |
| 121 | 121 | } else { |
| 122 | - if (! is_string($name) || ! $field) { |
|
| 122 | + if (!is_string($name) || !$field) { |
|
| 123 | 123 | throw new InvariantViolation( |
| 124 | 124 | sprintf( |
| 125 | 125 | '%s.%s field config must be an array, but got: %s', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | throw new InvariantViolation(sprintf('%s.%s: %s', $parentType->name, $this->name, $e->getMessage())); |
| 208 | 208 | } |
| 209 | 209 | Utils::invariant( |
| 210 | - ! isset($this->config['isDeprecated']), |
|
| 210 | + !isset($this->config['isDeprecated']), |
|
| 211 | 211 | sprintf( |
| 212 | 212 | '%s.%s should provide "deprecationReason" instead of "isDeprecated".', |
| 213 | 213 | $parentType->name, |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct($adoptedPromise, PromiseAdapter $adapter) |
| 26 | 26 | { |
| 27 | - Utils::invariant(! $adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . self::class); |
|
| 27 | + Utils::invariant(!$adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . self::class); |
|
| 28 | 28 | |
| 29 | 29 | $this->adapter = $adapter; |
| 30 | 30 | $this->adoptedPromise = $adoptedPromise; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function convertThenable($thenable) |
| 35 | 35 | { |
| 36 | - if (! $thenable instanceof Deferred) { |
|
| 36 | + if (!$thenable instanceof Deferred) { |
|
| 37 | 37 | throw new InvariantViolation('Expected instance of GraphQL\Deferred, got ' . Utils::printSafe($thenable)); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if ($promiseOrValue instanceof Promise) { |
| 114 | 114 | $result[$index] = null; |
| 115 | 115 | $promiseOrValue->then( |
| 116 | - static function ($value) use ($index, &$count, $total, &$result, $all) { |
|
| 116 | + static function($value) use ($index, &$count, $total, &$result, $all) { |
|
| 117 | 117 | $result[$index] = $value; |
| 118 | 118 | $count++; |
| 119 | 119 | if ($count < $total) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $promiseQueue = SyncPromise::getQueue(); |
| 149 | 149 | |
| 150 | 150 | while ($promise->adoptedPromise->state === SyncPromise::PENDING && |
| 151 | - ! ($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
| 151 | + !($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
| 152 | 152 | ) { |
| 153 | 153 | Deferred::runQueue(); |
| 154 | 154 | SyncPromise::runQueue(); |
@@ -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 | - static function ($item) { |
|
| 83 | + static function($item) { |
|
| 84 | 84 | return $item instanceof Promise ? $item->adoptedPromise : $item; |
| 85 | 85 | } |
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | - $promise = all($promisesOrValues)->then(static function ($values) use ($promisesOrValues) { |
|
| 88 | + $promise = all($promisesOrValues)->then(static function($values) use ($promisesOrValues) { |
|
| 89 | 89 | $orderedResults = []; |
| 90 | 90 | |
| 91 | 91 | foreach ($promisesOrValues as $key => $value) { |
@@ -25,17 +25,17 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | return [ |
| 27 | 27 | NodeKind::OPERATION_DEFINITION => [ |
| 28 | - 'enter' => static function () use (&$variableNameDefined) { |
|
| 28 | + 'enter' => static function() use (&$variableNameDefined) { |
|
| 29 | 29 | $variableNameDefined = []; |
| 30 | 30 | }, |
| 31 | - 'leave' => static function (OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 31 | + 'leave' => static function(OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 32 | 32 | $usages = $context->getRecursiveVariableUsages($operation); |
| 33 | 33 | |
| 34 | 34 | foreach ($usages as $usage) { |
| 35 | 35 | $node = $usage['node']; |
| 36 | 36 | $varName = $node->name->value; |
| 37 | 37 | |
| 38 | - if (! empty($variableNameDefined[$varName])) { |
|
| 38 | + if (!empty($variableNameDefined[$varName])) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | }, |
| 51 | 51 | ], |
| 52 | - NodeKind::VARIABLE_DEFINITION => static function (VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 52 | + NodeKind::VARIABLE_DEFINITION => static function(VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 53 | 53 | $variableNameDefined[$def->variable->name->value] = true; |
| 54 | 54 | }, |
| 55 | 55 | ]; |