From 620e6b428c228e2808d6672e982e01dbab242e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Fouillet?= <35224226+ffouillet@users.noreply.github.com> Date: Sat, 19 Nov 2022 17:35:56 +0100 Subject: [PATCH] Update custom_constraint.rst Replace Annotation in custom constraint declaration by #[Attribute] which is more up to date --- validation/custom_constraint.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index 1d95b64c822..f193535900c 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -214,9 +214,7 @@ email. First, create a constraint and override the ``getTargets()`` method:: use Symfony\Component\Validator\Constraint; - /** - * @Annotation - */ + #[\Attribute] class ConfirmedPaymentReceipt extends Constraint { public string $userDoesNotMatchMessage = 'User\'s e-mail address does not match that of the receipt';