Skip to content

Commit 63de796

Browse files
Update validation.rst
Constraints works also on private and protected methods hose name starts with "get", "is" or "has".
1 parent 3af815c commit 63de796

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

validation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ of the form fields::
519519
Constraint Targets
520520
------------------
521521

522-
Constraints can be applied to a class property (e.g. ``name``), a public
522+
Constraints can be applied to a class property (e.g. ``name``), a
523523
getter method (e.g. ``getFullName()``) or an entire class. Property constraints
524524
are the most common and easy to use. Getter constraints allow you to specify
525525
more complex validation rules. Finally, class constraints are intended
@@ -635,7 +635,7 @@ Getters
635635
~~~~~~~
636636

637637
Constraints can also be applied to the return value of a method. Symfony
638-
allows you to add a constraint to any public method whose name starts with
638+
allows you to add a constraint to any private, protected or public method whose name starts with
639639
"get", "is" or "has". In this guide, these types of methods are referred to
640640
as "getters".
641641

0 commit comments

Comments
 (0)