@@ -2,10 +2,10 @@ Callback
22========
33
44The purpose of the Callback constraint is to create completely custom
5- validation rules and to assign any validation errors to specific fields on
6- your object. If you're using validation with forms, this means that you can
7- make these custom errors display next to a specific field, instead of simply
8- at the top of your form.
5+ validation rules and to assign any validation errors to specific fields
6+ on your object. If you're using validation with forms, this means that you
7+ can make these custom errors display next to a specific field, instead of
8+ simply at the top of your form.
99
1010This process works by specifying one or more *callback * methods, each of
1111which will be called during the validation process. Each of those methods
@@ -93,9 +93,9 @@ Configuration
9393 The Callback Method
9494-------------------
9595
96- The callback method is passed a special ``ExecutionContextInterface `` object. You
97- can set "violations" directly on this object and determine to which field
98- those errors should be attributed::
96+ The callback method is passed a special ``ExecutionContextInterface `` object.
97+ You can set "violations" directly on this object and determine to which
98+ field those errors should be attributed::
9999
100100 // ...
101101 use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -160,10 +160,10 @@ have access to the object instance, they receive the object as the first argumen
160160External Callbacks and Closures
161161-------------------------------
162162
163- If you want to execute a static callback method that is not located in the class
164- of the validated object, you can configure the constraint to invoke an array
165- callable as supported by PHP's :phpfunction: `call_user_func ` function. Suppose
166- your validation function is ``Vendor\Package\Validator::validate() ``::
163+ If you want to execute a static callback method that is not located in the
164+ class of the validated object, you can configure the constraint to invoke
165+ an array callable as supported by PHP's :phpfunction: `call_user_func ` function.
166+ Suppose your validation function is ``Vendor\Package\Validator::validate() ``::
167167
168168 namespace Vendor\Package;
169169
@@ -243,8 +243,8 @@ You can then use the following configuration to invoke this validator:
243243
244244 .. note ::
245245
246- The Callback constraint does *not * support global callback functions nor
247- is it possible to specify a global function or a :term: `service ` method
246+ The Callback constraint does *not * support global callback functions
247+ nor is it possible to specify a global function or a :term: `service ` method
248248 as callback. To validate using a service, you should
249249 :doc: `create a custom validation constraint </cookbook/validation/custom_constraint >`
250250 and add that new constraint to your class.
0 commit comments