[Validator] Deprecated the Size constraint
This commit is contained in:
parent
d661837ec0
commit
0be602deef
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user