@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $astDefinition = $context->getDocument()->definitions; |
| 73 | 73 | |
| 74 | 74 | foreach ($astDefinition as $def) { |
| 75 | - if (! ($def instanceof DirectiveDefinitionNode)) { |
|
| 75 | + if (!($def instanceof DirectiveDefinitionNode)) { |
|
| 76 | 76 | continue; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $locationsMap[$def->name->value] = array_map( |
| 80 | - static function ($name) { |
|
| 80 | + static function($name) { |
|
| 81 | 81 | return $name->value; |
| 82 | 82 | }, |
| 83 | 83 | $def->locations |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return [ |
| 88 | - NodeKind::DIRECTIVE => function ( |
|
| 88 | + NodeKind::DIRECTIVE => function( |
|
| 89 | 89 | DirectiveNode $node, |
| 90 | 90 | $key, |
| 91 | 91 | $parent, |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $name = $node->name->value; |
| 99 | 99 | $locations = $locationsMap[$name] ?? null; |
| 100 | 100 | |
| 101 | - if (! $locations) { |
|
| 101 | + if (!$locations) { |
|
| 102 | 102 | $context->reportError(new Error( |
| 103 | 103 | self::unknownDirectiveMessage($name), |
| 104 | 104 | [$node] |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors); |
| 111 | 111 | |
| 112 | - if (! $candidateLocation || in_array($candidateLocation, $locations, true)) { |
|
| 112 | + if (!$candidateLocation || in_array($candidateLocation, $locations, true)) { |
|
| 113 | 113 | return; |
| 114 | 114 | } |
| 115 | 115 | $context->reportError( |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | return [ |
| 53 | 53 | NodeKind::FIELD => [ |
| 54 | - 'enter' => static function (FieldNode $node) use (&$fieldName) { |
|
| 54 | + 'enter' => static function(FieldNode $node) use (&$fieldName) { |
|
| 55 | 55 | $fieldName = $node->name->value; |
| 56 | 56 | }, |
| 57 | 57 | ], |
| 58 | - NodeKind::NULL => static function (NullValueNode $node) use ($context, &$fieldName) { |
|
| 58 | + NodeKind::NULL => static function(NullValueNode $node) use ($context, &$fieldName) { |
|
| 59 | 59 | $type = $context->getInputType(); |
| 60 | - if (! ($type instanceof NonNull)) { |
|
| 60 | + if (!($type instanceof NonNull)) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,21 +68,21 @@ discard block |
||
| 68 | 68 | ) |
| 69 | 69 | ); |
| 70 | 70 | }, |
| 71 | - NodeKind::LST => function (ListValueNode $node) use ($context, &$fieldName) { |
|
| 71 | + NodeKind::LST => function(ListValueNode $node) use ($context, &$fieldName) { |
|
| 72 | 72 | // Note: TypeInfo will traverse into a list's item type, so look to the |
| 73 | 73 | // parent input type to check if it is a list. |
| 74 | 74 | $type = Type::getNullableType($context->getParentInputType()); |
| 75 | - if (! $type instanceof ListOfType) { |
|
| 75 | + if (!$type instanceof ListOfType) { |
|
| 76 | 76 | $this->isValidScalar($context, $node, $fieldName); |
| 77 | 77 | |
| 78 | 78 | return Visitor::skipNode(); |
| 79 | 79 | } |
| 80 | 80 | }, |
| 81 | - NodeKind::OBJECT => function (ObjectValueNode $node) use ($context, &$fieldName) { |
|
| 81 | + NodeKind::OBJECT => function(ObjectValueNode $node) use ($context, &$fieldName) { |
|
| 82 | 82 | // Note: TypeInfo will traverse into a list's item type, so look to the |
| 83 | 83 | // parent input type to check if it is a list. |
| 84 | 84 | $type = Type::getNamedType($context->getInputType()); |
| 85 | - if (! $type instanceof InputObjectType) { |
|
| 85 | + if (!$type instanceof InputObjectType) { |
|
| 86 | 86 | $this->isValidScalar($context, $node, $fieldName); |
| 87 | 87 | |
| 88 | 88 | return Visitor::skipNode(); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $nodeFields = iterator_to_array($node->fields); |
| 94 | 94 | $fieldNodeMap = array_combine( |
| 95 | 95 | array_map( |
| 96 | - static function ($field) { |
|
| 96 | + static function($field) { |
|
| 97 | 97 | return $field->name->value; |
| 98 | 98 | }, |
| 99 | 99 | $nodeFields |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | foreach ($inputFields as $fieldName => $fieldDef) { |
| 104 | 104 | $fieldType = $fieldDef->getType(); |
| 105 | - if (isset($fieldNodeMap[$fieldName]) || ! ($fieldType instanceof NonNull) || ($fieldDef->defaultValueExists())) { |
|
| 105 | + if (isset($fieldNodeMap[$fieldName]) || !($fieldType instanceof NonNull) || ($fieldDef->defaultValueExists())) { |
|
| 106 | 106 | continue; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | ); |
| 115 | 115 | } |
| 116 | 116 | }, |
| 117 | - NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) use ($context) { |
|
| 117 | + NodeKind::OBJECT_FIELD => static function(ObjectFieldNode $node) use ($context) { |
|
| 118 | 118 | $parentType = Type::getNamedType($context->getParentInputType()); |
| 119 | 119 | /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $fieldType */ |
| 120 | 120 | $fieldType = $context->getInputType(); |
| 121 | - if ($fieldType || ! ($parentType instanceof InputObjectType)) { |
|
| 121 | + if ($fieldType || !($parentType instanceof InputObjectType)) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $node->name->value, |
| 127 | 127 | array_keys($parentType->getFields()) |
| 128 | 128 | ); |
| 129 | - $didYouMean = $suggestions |
|
| 129 | + $didYouMean = $suggestions |
|
| 130 | 130 | ? 'Did you mean ' . Utils::orList($suggestions) . '?' |
| 131 | 131 | : null; |
| 132 | 132 | |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | ) |
| 138 | 138 | ); |
| 139 | 139 | }, |
| 140 | - NodeKind::ENUM => function (EnumValueNode $node) use ($context, &$fieldName) { |
|
| 140 | + NodeKind::ENUM => function(EnumValueNode $node) use ($context, &$fieldName) { |
|
| 141 | 141 | $type = Type::getNamedType($context->getInputType()); |
| 142 | - if (! $type instanceof EnumType) { |
|
| 142 | + if (!$type instanceof EnumType) { |
|
| 143 | 143 | $this->isValidScalar($context, $node, $fieldName); |
| 144 | - } elseif (! $type->getValue($node->value)) { |
|
| 144 | + } elseif (!$type->getValue($node->value)) { |
|
| 145 | 145 | $context->reportError( |
| 146 | 146 | new Error( |
| 147 | 147 | self::getBadValueMessage( |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | ); |
| 157 | 157 | } |
| 158 | 158 | }, |
| 159 | - NodeKind::INT => function (IntValueNode $node) use ($context, &$fieldName) { |
|
| 159 | + NodeKind::INT => function(IntValueNode $node) use ($context, &$fieldName) { |
|
| 160 | 160 | $this->isValidScalar($context, $node, $fieldName); |
| 161 | 161 | }, |
| 162 | - NodeKind::FLOAT => function (FloatValueNode $node) use ($context, &$fieldName) { |
|
| 162 | + NodeKind::FLOAT => function(FloatValueNode $node) use ($context, &$fieldName) { |
|
| 163 | 163 | $this->isValidScalar($context, $node, $fieldName); |
| 164 | 164 | }, |
| 165 | - NodeKind::STRING => function (StringValueNode $node) use ($context, &$fieldName) { |
|
| 165 | + NodeKind::STRING => function(StringValueNode $node) use ($context, &$fieldName) { |
|
| 166 | 166 | $this->isValidScalar($context, $node, $fieldName); |
| 167 | 167 | }, |
| 168 | - NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context, &$fieldName) { |
|
| 168 | + NodeKind::BOOLEAN => function(BooleanValueNode $node) use ($context, &$fieldName) { |
|
| 169 | 169 | $this->isValidScalar($context, $node, $fieldName); |
| 170 | 170 | }, |
| 171 | 171 | ]; |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $locationType */ |
| 187 | 187 | $locationType = $context->getInputType(); |
| 188 | 188 | |
| 189 | - if (! $locationType) { |
|
| 189 | + if (!$locationType) { |
|
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | $type = Type::getNamedType($locationType); |
| 194 | 194 | |
| 195 | - if (! $type instanceof ScalarType) { |
|
| 195 | + if (!$type instanceof ScalarType) { |
|
| 196 | 196 | $context->reportError( |
| 197 | 197 | new Error( |
| 198 | 198 | self::getBadValueMessage( |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $suggestions = Utils::suggestionList( |
| 240 | 240 | Printer::doPrint($node), |
| 241 | 241 | array_map( |
| 242 | - static function (EnumValueDefinition $value) { |
|
| 242 | + static function(EnumValueDefinition $value) { |
|
| 243 | 243 | return $value->name; |
| 244 | 244 | }, |
| 245 | 245 | $type->getValues() |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | return $this->invokeIfNeeded( |
| 61 | 61 | $context, |
| 62 | 62 | [ |
| 63 | - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) { |
|
| 63 | + NodeKind::SELECTION_SET => function(SelectionSetNode $selectionSet) use ($context) { |
|
| 64 | 64 | $this->fieldNodeAndDefs = $this->collectFieldASTsAndDefs( |
| 65 | 65 | $context, |
| 66 | 66 | $context->getParentType(), |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | $this->fieldNodeAndDefs |
| 70 | 70 | ); |
| 71 | 71 | }, |
| 72 | - NodeKind::VARIABLE_DEFINITION => function ($def) { |
|
| 72 | + NodeKind::VARIABLE_DEFINITION => function($def) { |
|
| 73 | 73 | $this->variableDefs[] = $def; |
| 74 | 74 | |
| 75 | 75 | return Visitor::skipNode(); |
| 76 | 76 | }, |
| 77 | 77 | NodeKind::OPERATION_DEFINITION => [ |
| 78 | - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context, &$complexity) { |
|
| 78 | + 'leave' => function(OperationDefinitionNode $operationDefinition) use ($context, &$complexity) { |
|
| 79 | 79 | $errors = $context->getErrors(); |
| 80 | 80 | |
| 81 | - if (! empty($errors)) { |
|
| 81 | + if (!empty($errors)) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | $this->variableDefs, |
| 192 | 192 | $this->getRawVariableValues() |
| 193 | 193 | ); |
| 194 | - if (! empty($errors)) { |
|
| 194 | + if (!empty($errors)) { |
|
| 195 | 195 | throw new Error(implode( |
| 196 | 196 | "\n\n", |
| 197 | 197 | array_map( |
| 198 | - static function ($error) { |
|
| 198 | + static function($error) { |
|
| 199 | 199 | return $error->getMessage(); |
| 200 | 200 | }, |
| 201 | 201 | $errors |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** @var bool $directiveArgsIf */ |
| 208 | 208 | $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if']; |
| 209 | 209 | |
| 210 | - return ! $directiveArgsIf; |
|
| 210 | + return !$directiveArgsIf; |
|
| 211 | 211 | } |
| 212 | 212 | if ($directiveNode->name->value === Directive::SKIP_NAME) { |
| 213 | 213 | $directive = Directive::skipDirective(); |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | $rawVariableValues |
| 250 | 250 | ); |
| 251 | 251 | |
| 252 | - if (! empty($errors)) { |
|
| 252 | + if (!empty($errors)) { |
|
| 253 | 253 | throw new Error(implode( |
| 254 | 254 | "\n\n", |
| 255 | 255 | array_map( |
| 256 | - static function ($error) { |
|
| 256 | + static function($error) { |
|
| 257 | 257 | return $error->getMessage(); |
| 258 | 258 | }, |
| 259 | 259 | $errors |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function getVisitor(ValidationContext $context) |
| 26 | 26 | { |
| 27 | 27 | return [ |
| 28 | - NodeKind::DOCUMENT => static function (DocumentNode $node) use ($context) { |
|
| 28 | + NodeKind::DOCUMENT => static function(DocumentNode $node) use ($context) { |
|
| 29 | 29 | /** @var FragmentDefinitionNode|OperationDefinitionNode|TypeSystemDefinitionNode $definition */ |
| 30 | 30 | foreach ($node->definitions as $definition) { |
| 31 | 31 | if ($definition instanceof OperationDefinitionNode || |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | protected function invokeIfNeeded(ValidationContext $context, array $validators) |
| 64 | 64 | { |
| 65 | 65 | // is disabled? |
| 66 | - if (! $this->isEnabled()) { |
|
| 66 | + if (!$this->isEnabled()) { |
|
| 67 | 67 | return []; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | // Importantly this does not include inline fragments. |
| 81 | 81 | $definitions = $context->getDocument()->definitions; |
| 82 | 82 | foreach ($definitions as $node) { |
| 83 | - if (! ($node instanceof FragmentDefinitionNode)) { |
|
| 83 | + if (!($node instanceof FragmentDefinitionNode)) { |
|
| 84 | 84 | continue; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | $responseName = $this->getFieldName($selection); |
| 137 | - if (! isset($_astAndDefs[$responseName])) { |
|
| 137 | + if (!isset($_astAndDefs[$responseName])) { |
|
| 138 | 138 | $_astAndDefs[$responseName] = new ArrayObject(); |
| 139 | 139 | } |
| 140 | 140 | // create field context |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function getVisitor(ValidationContext $context) |
| 29 | 29 | { |
| 30 | 30 | return [ |
| 31 | - NodeKind::ARGUMENT => static function (ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 31 | + NodeKind::ARGUMENT => static function(ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
| 32 | 32 | $argDef = $context->getArgument(); |
| 33 | 33 | if ($argDef !== null) { |
| 34 | 34 | return null; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | Utils::suggestionList( |
| 49 | 49 | $node->name->value, |
| 50 | 50 | array_map( |
| 51 | - static function ($arg) { |
|
| 51 | + static function($arg) { |
|
| 52 | 52 | return $arg->name; |
| 53 | 53 | }, |
| 54 | 54 | $fieldDef->args |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | Utils::suggestionList( |
| 69 | 69 | $node->name->value, |
| 70 | 70 | array_map( |
| 71 | - static function ($arg) { |
|
| 71 | + static function($arg) { |
|
| 72 | 72 | return $arg->name; |
| 73 | 73 | }, |
| 74 | 74 | $directive->args |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs) |
| 90 | 90 | { |
| 91 | 91 | $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName); |
| 92 | - if (! empty($suggestedArgs)) { |
|
| 92 | + if (!empty($suggestedArgs)) { |
|
| 93 | 93 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public static function unknownDirectiveArgMessage($argName, $directiveName, array $suggestedArgs) |
| 103 | 103 | { |
| 104 | 104 | $message = sprintf('Unknown argument "%s" on directive "@%s".', $argName, $directiveName); |
| 105 | - if (! empty($suggestedArgs)) { |
|
| 105 | + if (!empty($suggestedArgs)) { |
|
| 106 | 106 | $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $this->cachedFieldsAndFragmentNames = new SplObjectStorage(); |
| 60 | 60 | |
| 61 | 61 | return [ |
| 62 | - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) { |
|
| 62 | + NodeKind::SELECTION_SET => function(SelectionSetNode $selectionSet) use ($context) { |
|
| 63 | 63 | $conflicts = $this->findConflictsWithinSelectionSet( |
| 64 | 64 | $context, |
| 65 | 65 | $context->getParentType(), |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | $responseName = $selection->alias ? $selection->alias->value : $fieldName; |
| 260 | 260 | |
| 261 | - if (! isset($astAndDefs[$responseName])) { |
|
| 261 | + if (!isset($astAndDefs[$responseName])) { |
|
| 262 | 262 | $astAndDefs[$responseName] = []; |
| 263 | 263 | } |
| 264 | 264 | $astAndDefs[$responseName][] = [$parentType, $selection, $fieldDef]; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $fields[$i], |
| 318 | 318 | $fields[$j] |
| 319 | 319 | ); |
| 320 | - if (! $conflict) { |
|
| 320 | + if (!$conflict) { |
|
| 321 | 321 | continue; |
| 322 | 322 | } |
| 323 | 323 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $type1 = $def1 === null ? null : $def1->getType(); |
| 369 | 369 | $type2 = $def2 === null ? null : $def2->getType(); |
| 370 | 370 | |
| 371 | - if (! $areMutuallyExclusive) { |
|
| 371 | + if (!$areMutuallyExclusive) { |
|
| 372 | 372 | // Two aliases must refer to the same field. |
| 373 | 373 | $name1 = $ast1->name->value; |
| 374 | 374 | $name2 = $ast2->name->value; |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | ]; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if (! $this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) { |
|
| 383 | + if (!$this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) { |
|
| 384 | 384 | return [ |
| 385 | 385 | [$responseName, 'they have differing arguments'], |
| 386 | 386 | [$ast1], |
@@ -442,11 +442,11 @@ discard block |
||
| 442 | 442 | break; |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | - if (! $argument2) { |
|
| 445 | + if (!$argument2) { |
|
| 446 | 446 | return false; |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - if (! $this->sameValue($argument1->value, $argument2->value)) { |
|
| 449 | + if (!$this->sameValue($argument1->value, $argument2->value)) { |
|
| 450 | 450 | return false; |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | private function sameValue(Node $value1, Node $value2) |
| 461 | 461 | { |
| 462 | - return (! $value1 && ! $value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); |
|
| 462 | + return (!$value1 && !$value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | /** |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | // maps, each field from the first field map must be compared to every field |
| 615 | 615 | // in the second field map to find potential conflicts. |
| 616 | 616 | foreach ($fieldMap1 as $responseName => $fields1) { |
| 617 | - if (! isset($fieldMap2[$responseName])) { |
|
| 617 | + if (!isset($fieldMap2[$responseName])) { |
|
| 618 | 618 | continue; |
| 619 | 619 | } |
| 620 | 620 | |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | $fields1[$i], |
| 631 | 631 | $fields2[$j] |
| 632 | 632 | ); |
| 633 | - if (! $conflict) { |
|
| 633 | + if (!$conflict) { |
|
| 634 | 634 | continue; |
| 635 | 635 | } |
| 636 | 636 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $comparedFragments[$fragmentName] = true; |
| 665 | 665 | |
| 666 | 666 | $fragment = $context->getFragment($fragmentName); |
| 667 | - if (! $fragment) { |
|
| 667 | + if (!$fragment) { |
|
| 668 | 668 | return; |
| 669 | 669 | } |
| 670 | 670 | |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | |
| 765 | 765 | $fragment1 = $context->getFragment($fragmentName1); |
| 766 | 766 | $fragment2 = $context->getFragment($fragmentName2); |
| 767 | - if (! $fragment1 || ! $fragment2) { |
|
| 767 | + if (!$fragment1 || !$fragment2) { |
|
| 768 | 768 | return; |
| 769 | 769 | } |
| 770 | 770 | |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | [ |
| 838 | 838 | $responseName, |
| 839 | 839 | array_map( |
| 840 | - static function ($conflict) { |
|
| 840 | + static function($conflict) { |
|
| 841 | 841 | return $conflict[0]; |
| 842 | 842 | }, |
| 843 | 843 | $conflicts |
@@ -845,14 +845,14 @@ discard block |
||
| 845 | 845 | ], |
| 846 | 846 | array_reduce( |
| 847 | 847 | $conflicts, |
| 848 | - static function ($allFields, $conflict) { |
|
| 848 | + static function($allFields, $conflict) { |
|
| 849 | 849 | return array_merge($allFields, $conflict[1]); |
| 850 | 850 | }, |
| 851 | 851 | [$ast1] |
| 852 | 852 | ), |
| 853 | 853 | array_reduce( |
| 854 | 854 | $conflicts, |
| 855 | - static function ($allFields, $conflict) { |
|
| 855 | + static function($allFields, $conflict) { |
|
| 856 | 856 | return array_merge($allFields, $conflict[2]); |
| 857 | 857 | }, |
| 858 | 858 | [$ast2] |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | { |
| 880 | 880 | if (is_array($reason)) { |
| 881 | 881 | $tmp = array_map( |
| 882 | - static function ($tmp) { |
|
| 882 | + static function($tmp) { |
|
| 883 | 883 | [$responseName, $subReason] = $tmp; |
| 884 | 884 | |
| 885 | 885 | $reasonMessage = self::reasonMessage($subReason); |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | public function getVisitor(ValidationContext $context) |
| 20 | 20 | { |
| 21 | 21 | return [ |
| 22 | - NodeKind::INLINE_FRAGMENT => static function (InlineFragmentNode $node) use ($context) { |
|
| 23 | - if (! $node->typeCondition) { |
|
| 22 | + NodeKind::INLINE_FRAGMENT => static function(InlineFragmentNode $node) use ($context) { |
|
| 23 | + if (!$node->typeCondition) { |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); |
| 28 | - if (! $type || Type::isCompositeType($type)) { |
|
| 28 | + if (!$type || Type::isCompositeType($type)) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | [$node->typeCondition] |
| 35 | 35 | )); |
| 36 | 36 | }, |
| 37 | - NodeKind::FRAGMENT_DEFINITION => static function (FragmentDefinitionNode $node) use ($context) { |
|
| 37 | + NodeKind::FRAGMENT_DEFINITION => static function(FragmentDefinitionNode $node) use ($context) { |
|
| 38 | 38 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); |
| 39 | 39 | |
| 40 | - if (! $type || Type::isCompositeType($type)) { |
|
| 40 | + if (!$type || Type::isCompositeType($type)) { |
|
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | return [ |
| 25 | 25 | NodeKind::OPERATION_DEFINITION => [ |
| 26 | - 'enter' => static function () use (&$variableNameDefined) { |
|
| 26 | + 'enter' => static function() use (&$variableNameDefined) { |
|
| 27 | 27 | $variableNameDefined = []; |
| 28 | 28 | }, |
| 29 | - 'leave' => static function (OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 29 | + 'leave' => static function(OperationDefinitionNode $operation) use (&$variableNameDefined, $context) { |
|
| 30 | 30 | $usages = $context->getRecursiveVariableUsages($operation); |
| 31 | 31 | |
| 32 | 32 | foreach ($usages as $usage) { |
| 33 | 33 | $node = $usage['node']; |
| 34 | 34 | $varName = $node->name->value; |
| 35 | 35 | |
| 36 | - if (! empty($variableNameDefined[$varName])) { |
|
| 36 | + if (!empty($variableNameDefined[$varName])) { |
|
| 37 | 37 | continue; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | }, |
| 49 | 49 | ], |
| 50 | - NodeKind::VARIABLE_DEFINITION => static function (VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 50 | + NodeKind::VARIABLE_DEFINITION => static function(VariableDefinitionNode $def) use (&$variableNameDefined) { |
|
| 51 | 51 | $variableNameDefined[$def->variable->name->value] = true; |
| 52 | 52 | }, |
| 53 | 53 | ]; |