Skip to content

Commit 8a614eb

Browse files
committed
Minor reword
1 parent ac5e9d5 commit 8a614eb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

validation/custom_constraint.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,16 @@ First you need to create a Constraint class and extend :class:`Symfony\\Componen
4444
public $message = 'The string "{{ string }}" contains an illegal character: it can only contain letters or numbers.';
4545
}
4646
47+
Add ``@Annotation`` or ``#[\Attribute]`` to the constraint class if you want to
48+
use it as an annotation/attribute in other classes. If the constraint has
49+
configuration options, define them as public properties on the constraint class.
50+
4751
.. versionadded:: 5.2
4852

4953
The ability to use PHP attributes to configure constraints was introduced in
5054
Symfony 5.2. Prior to this, Doctrine Annotations were the only way to
5155
annotate constraints.
5256

53-
.. note::
54-
55-
The ``@Annotation`` or ``#[\Attribute]`` annotation is necessary for this new constraint in
56-
order to make it available for use in classes via annotations.
57-
Options for your constraint are represented as public properties on the
58-
constraint class.
59-
6057
Creating the Validator itself
6158
-----------------------------
6259

0 commit comments

Comments
 (0)