From 9622703302825bf3d6889175bca06569ef7fedef Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Wed, 25 Jul 2012 20:30:38 +0200 Subject: [PATCH] [Validator] Removed the Size constraint which did not exist in 2.0 --- .../Validator/ValidatorTypeGuesser.php | 7 ---- src/Symfony/Component/Validator/CHANGELOG.md | 2 +- .../Component/Validator/Constraints/Size.php | 32 ------------------- .../Validator/Constraints/SizeValidator.php | 26 --------------- 4 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 src/Symfony/Component/Validator/Constraints/Size.php delete mode 100644 src/Symfony/Component/Validator/Constraints/SizeValidator.php diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index ea21f09044..2249ddad59 100755 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -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); diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index dbc3e0b0d7..e49881a528 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -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 diff --git a/src/Symfony/Component/Validator/Constraints/Size.php b/src/Symfony/Component/Validator/Constraints/Size.php deleted file mode 100644 index 625f86e528..0000000000 --- a/src/Symfony/Component/Validator/Constraints/Size.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * 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'; - } -} diff --git a/src/Symfony/Component/Validator/Constraints/SizeValidator.php b/src/Symfony/Component/Validator/Constraints/SizeValidator.php deleted file mode 100644 index 605e74b5c1..0000000000 --- a/src/Symfony/Component/Validator/Constraints/SizeValidator.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * 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 - * - * @api - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ -class SizeValidator extends RangeValidator -{ -}