Skip to content

Commit 3bed3b8

Browse files
committed
minor #17441 Replace annotation by attribute (ffouillet)
This PR was submitted for the 6.1 branch but it was merged into the 6.0 branch instead. Discussion ---------- Replace annotation by attribute Replace Annotation in custom constraint declaration by #[\Attribute] which is more up to date <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 620e6b4 Update custom_constraint.rst
2 parents 14a9818 + 620e6b4 commit 3bed3b8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

validation/custom_constraint.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ email. First, create a constraint and override the ``getTargets()`` method::
214214

215215
use Symfony\Component\Validator\Constraint;
216216

217-
/**
218-
* @Annotation
219-
*/
217+
#[\Attribute]
220218
class ConfirmedPaymentReceipt extends Constraint
221219
{
222220
public string $userDoesNotMatchMessage = 'User\'s e-mail address does not match that of the receipt';

0 commit comments

Comments
 (0)