[Validator] Deprecated the Size constraint

This commit is contained in:
Bernhard Schussek 2012-07-11 11:42:36 +02:00
parent d661837ec0
commit 0be602deef
4 changed files with 25 additions and 0 deletions

View File

@ -1136,6 +1136,26 @@
private $recursiveCollection;
```
* The `Size` constraint was deprecated and will be removed in Symfony 2.3. You should
use the constraints `Min` and `Max` instead.
Before:
```
/** @Assert\Size(min = 2, max = 16) */
private $numberOfCpus;
```
After:
```
/**
* @Assert\Min(2)
* @Assert\Max(16)
*/
private $numberOfCpus;
```
### Session
* Flash messages now return an array based on their type. The old method is

View File

@ -22,3 +22,4 @@ CHANGELOG
recursively anymore by default. `Valid` contains a new property `deep`
which enables the BC behavior.
* added MinCount and MaxCount constraint
* deprecated the Size constraint

View File

@ -17,6 +17,8 @@ use Symfony\Component\Validator\Constraint;
* @Annotation
*
* @api
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
class Size extends Constraint
{

View File

@ -18,6 +18,8 @@ use Symfony\Component\Validator\ConstraintValidator;
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
class SizeValidator extends ConstraintValidator
{