merged branch bschussek/remove_size (PR #5048)
Commits
-------
9622703
[Validator] Removed the Size constraint which did not exist in 2.0
Discussion
----------
[Validator] Removed the Size constraint which did not exist in 2.0
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
This commit is contained in:
commit
9b11485f21
@ -157,7 +157,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
case 'Symfony\Component\Validator\Constraints\Regex':
|
case 'Symfony\Component\Validator\Constraints\Regex':
|
||||||
return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE);
|
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\Min':
|
||||||
case 'Symfony\Component\Validator\Constraints\Max':
|
case 'Symfony\Component\Validator\Constraints\Max':
|
||||||
return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE);
|
return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE);
|
||||||
@ -220,9 +219,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
|
|
||||||
case 'Symfony\Component\Validator\Constraints\Max':
|
case 'Symfony\Component\Validator\Constraints\Max':
|
||||||
return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
|
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;
|
return null;
|
||||||
@ -252,9 +248,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
|
|||||||
case 'Symfony\Component\Validator\Constraints\Min':
|
case 'Symfony\Component\Validator\Constraints\Min':
|
||||||
return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->limit)), Guess::LOW_CONFIDENCE);
|
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':
|
case 'Symfony\Component\Validator\Constraints\Type':
|
||||||
if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
|
if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
|
||||||
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
|
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
|
||||||
|
@ -23,6 +23,6 @@ CHANGELOG
|
|||||||
which enables the BC behavior.
|
which enables the BC behavior.
|
||||||
* added Count constraint
|
* added Count constraint
|
||||||
* added Length constraint
|
* added Length constraint
|
||||||
* deprecated the Size constraint and renamed it to Range
|
* added Range constraint
|
||||||
* deprecated the Min and Max constraints
|
* deprecated the Min and Max constraints
|
||||||
* deprecated the MinLength and MaxLength constraints
|
* deprecated the MinLength and MaxLength constraints
|
||||||
|
@ -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';
|
|
||||||
}
|
|
||||||
}
|
|
@ -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
|
|
||||||
{
|
|
||||||
}
|
|
Reference in New Issue
Block a user