symfony/symfony — pull request #3893 by Felds (2012-04-12 03:36:27+00:00)
Title: [Validator] Added range constraint

When using the Min and Max constraints in combination and a non-numeric value is submitted, both show an "invalid" message at the same time.

Another approach that I can see could be making their type validation optional, ignoring every non-numeric value when asked to, but this would change their current API, and I don't think it's a smart move for something so critical as validation.

This new Constraint works around that by creating a combined min/max constraint without changing their existing API and also simplifying the configuration by reducing the number of annotations needed to perform this validation.