[Validator] Removed the Size constraint which did not exist in 2.0

This commit is contained in:
Bernhard Schussek 2012-07-25 20:30:38 +02:00
parent c6f0987771
commit 9622703302
4 changed files with 1 additions and 66 deletions

View File

@ -157,7 +157,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Regex':
return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Size':
case 'Symfony\Component\Validator\Constraints\Min':
case 'Symfony\Component\Validator\Constraints\Max':
return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE);
@ -220,9 +219,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Max':
return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Size':
return new ValueGuess(strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
}
return null;
@ -252,9 +248,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Min':
return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->limit)), Guess::LOW_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Size':
return new ValueGuess(sprintf('.{%s,%s}', strlen((string) $constraint->min), strlen((string) $constraint->max)), Guess::LOW_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Type':
if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);

View File

@ -23,6 +23,6 @@ CHANGELOG
which enables the BC behavior.
* added Count constraint
* added Length constraint
* deprecated the Size constraint and renamed it to Range
* added Range constraint
* deprecated the Min and Max constraints
* deprecated the MinLength and MaxLength constraints

View File

@ -1,32 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
*
* @api
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
class Size extends Range
{
/**
* {@inheritDoc}
*/
public function validatedBy()
{
return get_parent_class($this).'Validator';
}
}

View File

@ -1,26 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
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 RangeValidator
{
}