@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | public function getVisitor(ValidationContext $context) |
| 24 | 24 | { |
| 25 | 25 | return [ |
| 26 | - NodeKind::FIELD => function (FieldNode $node) use ($context) { |
|
| 26 | + NodeKind::FIELD => function(FieldNode $node) use ($context) { |
|
| 27 | 27 | $type = $context->getParentType(); |
| 28 | - if (! $type) { |
|
| 28 | + if (!$type) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -84,19 +84,19 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | foreach ($schema->getPossibleTypes($type) as $possibleType) { |
| 86 | 86 | $fields = $possibleType->getFields(); |
| 87 | - if (! isset($fields[$fieldName])) { |
|
| 87 | + if (!isset($fields[$fieldName])) { |
|
| 88 | 88 | continue; |
| 89 | 89 | } |
| 90 | 90 | // This object type defines this field. |
| 91 | 91 | $suggestedObjectTypes[] = $possibleType->name; |
| 92 | 92 | foreach ($possibleType->getInterfaces() as $possibleInterface) { |
| 93 | 93 | $fields = $possibleInterface->getFields(); |
| 94 | - if (! isset($fields[$fieldName])) { |
|
| 94 | + if (!isset($fields[$fieldName])) { |
|
| 95 | 95 | continue; |
| 96 | 96 | } |
| 97 | 97 | // This interface type defines this field. |
| 98 | 98 | $interfaceUsageCount[$possibleInterface->name] = |
| 99 | - ! isset($interfaceUsageCount[$possibleInterface->name]) |
|
| 99 | + !isset($interfaceUsageCount[$possibleInterface->name]) |
|
| 100 | 100 | ? 0 |
| 101 | 101 | : $interfaceUsageCount[$possibleInterface->name] + 1; |
| 102 | 102 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $suggestions = Utils::quotedOrList($suggestedTypeNames); |
| 154 | 154 | |
| 155 | 155 | $message .= sprintf(' Did you mean to use an inline fragment on %s?', $suggestions); |
| 156 | - } elseif (! empty($suggestedFieldNames)) { |
|
| 156 | + } elseif (!empty($suggestedFieldNames)) { |
|
| 157 | 157 | $suggestions = Utils::quotedOrList($suggestedFieldNames); |
| 158 | 158 | |
| 159 | 159 | $message .= sprintf(' Did you mean %s?', $suggestions); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $context, |
| 29 | 29 | [ |
| 30 | 30 | NodeKind::OPERATION_DEFINITION => [ |
| 31 | - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context) { |
|
| 31 | + 'leave' => function(OperationDefinitionNode $operationDefinition) use ($context) { |
|
| 32 | 32 | $maxDepth = $this->fieldDepth($operationDefinition); |
| 33 | 33 | |
| 34 | 34 | if ($maxDepth <= $this->getMaxQueryDepth()) { |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | $this->fragmentDefs = []; |
| 27 | 27 | |
| 28 | 28 | return [ |
| 29 | - NodeKind::OPERATION_DEFINITION => function ($node) { |
|
| 29 | + NodeKind::OPERATION_DEFINITION => function($node) { |
|
| 30 | 30 | $this->operationDefs[] = $node; |
| 31 | 31 | |
| 32 | 32 | return Visitor::skipNode(); |
| 33 | 33 | }, |
| 34 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $def) { |
|
| 34 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $def) { |
|
| 35 | 35 | $this->fragmentDefs[] = $def; |
| 36 | 36 | |
| 37 | 37 | return Visitor::skipNode(); |
| 38 | 38 | }, |
| 39 | 39 | NodeKind::DOCUMENT => [ |
| 40 | - 'leave' => function () use ($context) { |
|
| 40 | + 'leave' => function() use ($context) { |
|
| 41 | 41 | $fragmentNameUsed = []; |
| 42 | 42 | |
| 43 | 43 | foreach ($this->operationDefs as $operation) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | foreach ($this->fragmentDefs as $fragmentDef) { |
| 50 | 50 | $fragName = $fragmentDef->name->value; |
| 51 | - if (! empty($fragmentNameUsed[$fragName])) { |
|
| 51 | + if (!empty($fragmentNameUsed[$fragName])) { |
|
| 52 | 52 | continue; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -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; |