From 4fb631e00ff43ff14315167b12ad7b4d035747a0 Mon Sep 17 00:00:00 2001 From: Quentin Dequippe Date: Wed, 21 Jan 2026 11:55:03 +0100 Subject: [PATCH] Fix typo invalid exception type --- validation/custom_constraint.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index e6f0352e84..b6c1ffc92d 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -463,6 +463,7 @@ Now, the constraint validator will get an object as the first argument to use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; + use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; class ConfirmedPaymentReceiptValidator extends ConstraintValidator @@ -477,7 +478,7 @@ Now, the constraint validator will get an object as the first argument to } if (!$constraint instanceof ConfirmedPaymentReceipt) { - throw new UnexpectedValueException($constraint, ConfirmedPaymentReceipt::class); + throw new UnexpectedTypeException($constraint, ConfirmedPaymentReceipt::class); } $receiptEmail = $receipt->getPayload()['email'] ?? null;