symfony/symfony — pull request #9094 by bes89 (2013-09-20 21:08:01+00:00)
Title: [WIP] [Validator] Allow to set "validatedBy" as option

This change makes the constraints more flexible by allowing to set the class (that validates the constraints) as option

Why? If i want to reuse an existing constraint e.g. Date but with my own validator i have to create a new class that extends the Date constraint class - just to override the "validatedBy" method!

With this change:
new Date(array('validatedBy' => "Yet\Another\DateValidator"));

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -

todo if this pr is will be accepted:

- [ ] submit changes to the documentation