Skip to content

Commit de12e23

Browse files
committed
throw UnexpectedValueException instead
1 parent a84842b commit de12e23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Validator/Constraints/NotCompromisedPasswordValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Validator\Constraint;
1616
use Symfony\Component\Validator\ConstraintValidator;
1717
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
18+
use Symfony\Component\Validator\Exception\UnexpectedValueException;
1819
use Symfony\Contracts\HttpClient\Exception\ExceptionInterface;
1920
use Symfony\Contracts\HttpClient\HttpClientInterface;
2021

@@ -61,7 +62,7 @@ public function validate($value, Constraint $constraint)
6162
}
6263

6364
if (null !== $value && !is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
64-
throw new UnexpectedTypeException($value, 'string');
65+
throw new UnexpectedValueException($value, 'string');
6566
}
6667

6768
$value = (string) $value;

0 commit comments

Comments
 (0)