throw UnexpectedValueException instead
This commit is contained in:
parent
a84842b519
commit
de12e2382e
@ -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;
|
||||
|
Reference in New Issue
Block a user