throw UnexpectedValueException instead

This commit is contained in:
Christian Flothmann 2019-04-06 23:02:44 +02:00
parent a84842b519
commit de12e2382e

View File

@ -15,6 +15,7 @@ use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
use Symfony\Contracts\HttpClient\Exception\ExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
@ -61,7 +62,7 @@ class NotCompromisedPasswordValidator extends ConstraintValidator
}
if (null !== $value && !is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
throw new UnexpectedTypeException($value, 'string');
throw new UnexpectedValueException($value, 'string');
}
$value = (string) $value;