@@ -27,12 +27,12 @@ |
||
27 | 27 | if (!$definition instanceof ExecutableDefinitionNodeInterface) { |
28 | 28 | /** @noinspection PhpUndefinedMethodInspection */ |
29 | 29 | $this->context->reportError( |
30 | - new ValidationException( |
|
30 | + new ValidationException( |
|
31 | 31 | nonExecutableDefinitionMessage( |
32 | - $definition instanceof SchemaDefinitionNode ? 'schema' : $definition->getNameValue() |
|
32 | + $definition instanceof SchemaDefinitionNode ? 'schema' : $definition->getNameValue() |
|
33 | 33 | ), |
34 | 34 | [$definition] |
35 | - ) |
|
35 | + ) |
|
36 | 36 | ); |
37 | 37 | } |
38 | 38 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | if (null === $type) { |
34 | 34 | $this->context->reportError( |
35 | - new ValidationException( |
|
35 | + new ValidationException( |
|
36 | 36 | unknownTypeMessage($typeName, suggestionList($typeName, |
37 | - \array_keys($schema->getTypeMap()))), |
|
37 | + \array_keys($schema->getTypeMap()))), |
|
38 | 38 | [$node] |
39 | - ) |
|
39 | + ) |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @inheritdoc |
59 | 59 | */ |
60 | 60 | protected function enterInterfaceTypeDefinition( |
61 | - InterfaceTypeDefinitionNode $node |
|
61 | + InterfaceTypeDefinitionNode $node |
|
62 | 62 | ): ?NodeInterface |
63 | 63 | { |
64 | 64 | return null; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @inheritdoc |
78 | 78 | */ |
79 | 79 | protected function enterInputObjectTypeDefinition( |
80 | - InputObjectTypeDefinitionNode $node |
|
80 | + InputObjectTypeDefinitionNode $node |
|
81 | 81 | ): ?NodeInterface |
82 | 82 | { |
83 | 83 | return null; |
@@ -49,11 +49,11 @@ |
||
49 | 49 | |
50 | 50 | if (null !== $defaultValue && $type instanceof NonNullType) { |
51 | 51 | $this->context->reportError( |
52 | - new ValidationException( |
|
52 | + new ValidationException( |
|
53 | 53 | variableDefaultValueNotAllowedMessage($variableName, $type, |
54 | - $type->getOfType()), |
|
54 | + $type->getOfType()), |
|
55 | 55 | [$defaultValue] |
56 | - ) |
|
56 | + ) |
|
57 | 57 | ); |
58 | 58 | } |
59 | 59 |
@@ -44,10 +44,10 @@ |
||
44 | 44 | |
45 | 45 | if (isset($this->knownInputNames[$fieldName])) { |
46 | 46 | $this->context->reportError( |
47 | - new ValidationException( |
|
47 | + new ValidationException( |
|
48 | 48 | duplicateInputFieldMessage($fieldName), |
49 | 49 | [$this->knownInputNames[$fieldName], $node->getName()] |
50 | - ) |
|
50 | + ) |
|
51 | 51 | ); |
52 | 52 | } else { |
53 | 53 | $this->knownInputNames[$fieldName] = $node->getName(); |
@@ -40,21 +40,21 @@ discard block |
||
40 | 40 | $schema = $this->context->getSchema(); |
41 | 41 | $fieldName = $node->getNameValue(); |
42 | 42 | $suggestedTypeNames = $this->getSuggestedTypeNames($schema, |
43 | - $type, $fieldName); |
|
43 | + $type, $fieldName); |
|
44 | 44 | $suggestedFieldNames = \count($suggestedTypeNames) !== 0 |
45 | 45 | ? [] |
46 | 46 | : $this->getSuggestedFieldNames($type, $fieldName); |
47 | 47 | |
48 | 48 | $this->context->reportError( |
49 | - new ValidationException( |
|
49 | + new ValidationException( |
|
50 | 50 | undefinedFieldMessage( |
51 | - $fieldName, |
|
52 | - (string)$type, |
|
53 | - $suggestedTypeNames, |
|
54 | - $suggestedFieldNames |
|
51 | + $fieldName, |
|
52 | + (string)$type, |
|
53 | + $suggestedTypeNames, |
|
54 | + $suggestedFieldNames |
|
55 | 55 | ), |
56 | 56 | [$node] |
57 | - ) |
|
57 | + ) |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | } |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | * @return array |
76 | 76 | */ |
77 | 77 | protected function getSuggestedTypeNames( |
78 | - SchemaInterface $schema, |
|
79 | - TypeInterface $type, |
|
80 | - string $fieldName |
|
78 | + SchemaInterface $schema, |
|
79 | + TypeInterface $type, |
|
80 | + string $fieldName |
|
81 | 81 | ): array { |
82 | 82 | if (!$type instanceof AbstractTypeInterface) { |
83 | 83 | // Otherwise, must be an Object type, which does not have possible fields. |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $suggestedInterfaceTypes = \array_keys($interfaceUsageCount); |
112 | 112 | |
113 | 113 | \uasort($suggestedInterfaceTypes, |
114 | - function ($a, $b) use ($interfaceUsageCount) { |
|
115 | - return $interfaceUsageCount[$b] - $interfaceUsageCount[$a]; |
|
116 | - }); |
|
114 | + function ($a, $b) use ($interfaceUsageCount) { |
|
115 | + return $interfaceUsageCount[$b] - $interfaceUsageCount[$a]; |
|
116 | + }); |
|
117 | 117 | |
118 | 118 | return \array_merge($suggestedInterfaceTypes, $suggestedObjectTypes); |
119 | 119 | } |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | * @throws \Exception |
130 | 130 | */ |
131 | 131 | protected function getSuggestedFieldNames( |
132 | - OutputTypeInterface $type, |
|
133 | - string $fieldName |
|
132 | + OutputTypeInterface $type, |
|
133 | + string $fieldName |
|
134 | 134 | ): array { |
135 | 135 | if (!($type instanceof ObjectType || $type instanceof InterfaceType)) { |
136 | 136 | // Otherwise, must be a Union type, which does not define fields. |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $suggestedInterfaceTypes = \array_keys($interfaceUsageCount); |
112 | 112 | |
113 | 113 | \uasort($suggestedInterfaceTypes, |
114 | - function ($a, $b) use ($interfaceUsageCount) { |
|
114 | + function($a, $b) use ($interfaceUsageCount) { |
|
115 | 115 | return $interfaceUsageCount[$b] - $interfaceUsageCount[$a]; |
116 | 116 | }); |
117 | 117 |
@@ -30,10 +30,10 @@ |
||
30 | 30 | |
31 | 31 | if (isset($knownDirectives[$directiveName])) { |
32 | 32 | $this->context->reportError( |
33 | - new ValidationException( |
|
33 | + new ValidationException( |
|
34 | 34 | duplicateDirectiveMessage($directiveName), |
35 | 35 | [$knownDirectives[$directiveName], $directive] |
36 | - ) |
|
36 | + ) |
|
37 | 37 | ); |
38 | 38 | } else { |
39 | 39 | $knownDirectives[$directiveName] = $directive; |
@@ -31,19 +31,19 @@ |
||
31 | 31 | if (getNamedType($type) instanceof LeafTypeInterface) { |
32 | 32 | if (null !== $selectionSet) { |
33 | 33 | $this->context->reportError( |
34 | - new ValidationException( |
|
34 | + new ValidationException( |
|
35 | 35 | noSubselectionAllowedMessage((string)$node, |
36 | - (string)$type), |
|
36 | + (string)$type), |
|
37 | 37 | [$selectionSet] |
38 | - ) |
|
38 | + ) |
|
39 | 39 | ); |
40 | 40 | } |
41 | 41 | } elseif (null === $selectionSet) { |
42 | 42 | $this->context->reportError( |
43 | - new ValidationException( |
|
43 | + new ValidationException( |
|
44 | 44 | requiresSubselectionMessage((string)$node, (string)$type), |
45 | 45 | [$node] |
46 | - ) |
|
46 | + ) |
|
47 | 47 | ); |
48 | 48 | } |
49 | 49 | } |
@@ -43,10 +43,10 @@ |
||
43 | 43 | |
44 | 44 | if (isset($this->knownVariableNames[$variableName])) { |
45 | 45 | $this->context->reportError( |
46 | - new ValidationException( |
|
46 | + new ValidationException( |
|
47 | 47 | duplicateVariableMessage($variableName), |
48 | 48 | [$this->knownVariableNames[$variableName], $variable->getName()] |
49 | - ) |
|
49 | + ) |
|
50 | 50 | ); |
51 | 51 | } else { |
52 | 52 | $this->knownVariableNames[$variableName] = $variable->getName(); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | if (null === $fragment) { |
29 | 29 | $this->context->reportError( |
30 | - new ValidationException(unknownFragmentMessage($fragmentName), |
|
30 | + new ValidationException(unknownFragmentMessage($fragmentName), |
|
31 | 31 | [$node->getName()]) |
32 | 32 | ); |
33 | 33 | } |