File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -71,19 +71,16 @@ you can create your own named set or requirements to be reused consistently ever
71
71
}
72
72
}
73
73
74
+ Add ``@Annotation `` or ``#[\Attribute] `` to the constraint class if you want to
75
+ use it as an annotation/attribute in other classes. If the constraint has
76
+ configuration options, define them as public properties on the constraint class.
77
+
74
78
.. versionadded :: 5.2
75
79
76
80
The ability to use PHP attributes to configure constraints was introduced in
77
81
Symfony 5.2. Prior to this, Doctrine Annotations were the only way to
78
82
annotate constraints.
79
83
80
- .. note ::
81
-
82
- The ``@Annotation `` or ``#[\Attribute] `` annotation is necessary for this new constraint in
83
- order to make it available for use in classes via annotations.
84
- Options for your constraint are represented as public properties on the
85
- constraint class.
86
-
87
84
You can now use it anywhere you need it:
88
85
89
86
.. configuration-block ::
You can’t perform that action at this time.
0 commit comments