Skip to content

Commit 9e2f506

Browse files
committed
bug #30939 [Validator] throw UnexpectedValueException instead (xabbuh)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Validator] throw UnexpectedValueException instead | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | #FOSSHackathons #EUFOSSA Commits ------- de12e23 throw UnexpectedValueException instead
2 parents 758f028 + de12e23 commit 9e2f506

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)