From 3a8f10b5724402243feae3310662a8925f8e9f94 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 2 Jan 2024 14:51:01 +0100 Subject: [PATCH] fix the exception being thrown --- src/Symfony/Component/Validator/Constraints/JsonValidator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Validator/Constraints/JsonValidator.php b/src/Symfony/Component/Validator/Constraints/JsonValidator.php index 176331f6f0314..a2a26d574d909 100644 --- a/src/Symfony/Component/Validator/Constraints/JsonValidator.php +++ b/src/Symfony/Component/Validator/Constraints/JsonValidator.php @@ -14,6 +14,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Imad ZAIRIG @@ -34,7 +35,7 @@ public function validate($value, Constraint $constraint) } if (!\is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedTypeException($value, 'string'); + throw new UnexpectedValueException($value, 'string'); } $value = (string) $value; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy