Skip to content

Commit

Permalink
Merge d8b23af into 65428ce
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Mar 25, 2021
2 parents 65428ce + d8b23af commit 11e102a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Validator/DocumentValidator.php
Expand Up @@ -300,7 +300,7 @@ public static function isValidLiteralValue(Type $type, $valueNode)
$emptyDoc = new DocumentNode(['definitions' => []]);
$typeInfo = new TypeInfo($emptySchema, $type);
$context = new ValidationContext($emptySchema, $emptyDoc, $typeInfo);
$validator = new ValuesOfCorrectType();
$validator = self::getRule(ValuesOfCorrectType::class);
$visitor = $validator->getVisitor($context);
Visitor::visit($valueNode, Visitor::visitWithTypeInfo($typeInfo, $visitor));

Expand Down
16 changes: 8 additions & 8 deletions src/Validator/Rules/ValuesOfCorrectType.php
Expand Up @@ -64,7 +64,7 @@ public function getVisitor(ValidationContext $context)

$context->reportError(
new Error(
self::getBadValueMessage((string) $type, Printer::doPrint($node), null, $context, $fieldName),
static::getBadValueMessage((string) $type, Printer::doPrint($node), null, $context, $fieldName),
$node
)
);
Expand Down Expand Up @@ -111,7 +111,7 @@ static function ($field) : string {

$context->reportError(
new Error(
self::requiredFieldMessage($type->name, $fieldName, (string) $fieldType),
static::requiredFieldMessage($type->name, $fieldName, (string) $fieldType),
$node
)
);
Expand All @@ -137,7 +137,7 @@ static function ($field) : string {

$context->reportError(
new Error(
self::unknownFieldMessage($parentType->name, $node->name->value, $didYouMean),
static::unknownFieldMessage($parentType->name, $node->name->value, $didYouMean),
$node
)
);
Expand All @@ -149,7 +149,7 @@ static function ($field) : string {
} elseif (! $type->getValue($node->value)) {
$context->reportError(
new Error(
self::getBadValueMessage(
static::getBadValueMessage(
$type->name,
Printer::doPrint($node),
$this->enumTypeSuggestion($type, $node),
Expand Down Expand Up @@ -200,7 +200,7 @@ private function isValidScalar(ValidationContext $context, ValueNode $node, $fie
if (! $type instanceof ScalarType) {
$context->reportError(
new Error(
self::getBadValueMessage(
static::getBadValueMessage(
(string) $locationType,
Printer::doPrint($node),
$this->enumTypeSuggestion($type, $node),
Expand All @@ -222,7 +222,7 @@ private function isValidScalar(ValidationContext $context, ValueNode $node, $fie
// Ensure a reference to the original error is maintained.
$context->reportError(
new Error(
self::getBadValueMessage(
static::getBadValueMessage(
(string) $locationType,
Printer::doPrint($node),
$error->getMessage(),
Expand Down Expand Up @@ -281,10 +281,10 @@ private static function getBadValueMessage($typeName, $valueName, $message = nul
if ($context) {
$arg = $context->getArgument();
if ($arg) {
return self::badArgumentValueMessage($typeName, $valueName, $fieldName, $arg->name, $message);
return static::badArgumentValueMessage($typeName, $valueName, $fieldName, $arg->name, $message);
}
}

return self::badValueMessage($typeName, $valueName, $message);
return static::badValueMessage($typeName, $valueName, $message);
}
}

0 comments on commit 11e102a

Please sign in to comment.