Last Updated: February 25, 2016
·
967
· gxela

Symfony 2.0 to 2.3 update MaxLength, MinLength Validator Constraints

PHP Fatal error:  Class 'Symfony\\Component\\Validator\\Constraints\\MaxLength' not found in 

in your validation.[yml|xml|php] change:

<constraint name="MinLength">
    <option name="limit">2</option>
    <option name="message">user.reset_password.too_short</option>

to:

<constraint name="Length">
    <option name="min">2</option>
    <option name="minMessage">user.reset_password.too_short</option>

https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md#validator