diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/LegacyUniqueEntityValidator2Dot4ApiTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/LegacyUniqueEntityValidator2Dot4ApiTest.php deleted file mode 100644 index 3e1151d520..0000000000 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/LegacyUniqueEntityValidator2Dot4ApiTest.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\Bridge\Doctrine\Tests\Validator\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.4 - * @author Bernhard Schussek - */ -class LegacyUniqueEntityValidator2Dot4ApiTest extends UniqueEntityValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 506e3d0823..ed2f3ab97c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -503,9 +503,7 @@ class Configuration implements ConfigurationInterface // API version already during container configuration // (to adjust service classes etc.) // See https://github.com/symfony/symfony/issues/11580 - $v['validation']['api'] = PHP_VERSION_ID < 50309 - ? '2.4' - : '2.5-bc'; + $v['validation']['api'] = '2.5-bc'; return $v; }) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 4797038315..590c262c66 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -744,19 +744,13 @@ class FrameworkExtension extends Extension $validatorBuilder->addMethodCall('setMetadataCache', array(new Reference($config['cache']))); } - switch ($config['api']) { - case '2.4': - $api = Validation::API_VERSION_2_4; - break; - case '2.5': - $api = Validation::API_VERSION_2_5; - // the validation class needs to be changed only for the 2.5 api since the deprecated interface is - // set as the default interface - $container->setParameter('validator.class', 'Symfony\Component\Validator\Validator\ValidatorInterface'); - break; - default: - $api = Validation::API_VERSION_2_5_BC; - break; + if ('2.5' === $config['api']) { + $api = Validation::API_VERSION_2_5; + } else { + // 2.4 is now the same as 2.5 BC + $api = Validation::API_VERSION_2_5_BC; + // the validation class needs to be changed for BC + $container->setParameter('validator.class', 'Symfony\Component\Validator\ValidatorInterface'); } $validatorBuilder->addMethodCall('setApiVersion', array($api)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml index c161a1e3d2..ccfd44e5ca 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - Symfony\Component\Validator\ValidatorInterface + Symfony\Component\Validator\Validator\ValidatorInterface Symfony\Component\Validator\ValidatorBuilderInterface Symfony\Component\Validator\Validation Symfony\Component\Validator\Mapping\Cache\ApcCache diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 9a4ad2770a..0fdb592ca6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -131,7 +131,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase 'static_method' => array('loadValidatorMetadata'), 'translation_domain' => 'validators', 'strict_email' => false, - 'api' => PHP_VERSION_ID < 50309 ? '2.4' : '2.5-bc', + 'api' => '2.5-bc', ), 'annotations' => array( 'cache' => 'file', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_4_api.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_4_api.php deleted file mode 100644 index 120b7eed52..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/validation_2_4_api.php +++ /dev/null @@ -1,9 +0,0 @@ -loadFromExtension('framework', array( - 'secret' => 's3cr3t', - 'validation' => array( - 'enabled' => true, - 'api' => '2.4', - ), -)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_4_api.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_4_api.xml deleted file mode 100644 index 247c66d8df..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/validation_2_4_api.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_4_api.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_4_api.yml deleted file mode 100644 index cce573fb67..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/validation_2_4_api.yml +++ /dev/null @@ -1,5 +0,0 @@ -framework: - secret: s3cr3t - validation: - enabled: true - api: 2.4 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 87d2408b79..7d2b2762dc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -382,22 +382,6 @@ abstract class FrameworkExtensionTest extends TestCase // no cache, no annotations, no static methods } - public function testValidation2Dot4Api() - { - $container = $this->createContainerFromFile('validation_2_4_api'); - - $calls = $container->getDefinition('validator.builder')->getMethodCalls(); - - $this->assertCount(6, $calls); - $this->assertSame('addXmlMappings', $calls[3][0]); - $this->assertSame('addMethodMapping', $calls[4][0]); - $this->assertSame(array('loadValidatorMetadata'), $calls[4][1]); - $this->assertSame('setApiVersion', $calls[5][0]); - $this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]); - $this->assertSame('Symfony\Component\Validator\ValidatorInterface', $container->getParameter('validator.class')); - // no cache, no annotations - } - public function testValidation2Dot5Api() { $container = $this->createContainerFromFile('validation_2_5_api'); @@ -443,11 +427,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertSame('setApiVersion', $calls[5][0]); // no cache, no annotations - if (PHP_VERSION_ID < 50309) { - $this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]); - } else { - $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); - } + $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); } /** @@ -467,11 +447,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertSame('setApiVersion', $calls[5][0]); // no cache, no annotations - if (PHP_VERSION_ID < 50309) { - $this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]); - } else { - $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); - } + $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); } public function testFormsCanBeEnabledWithoutCsrfProtection() diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php index d62a315839..99b8e47c39 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -224,14 +224,12 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setParameter('{{ foo }}', 'bar') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($form->getTransformationFailure()) ->assertRaised(); } @@ -261,14 +259,12 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setParameter('{{ foo }}', 'bar') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($form->getTransformationFailure()) ->assertRaised(); } @@ -298,13 +294,11 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($form->getTransformationFailure()) ->assertRaised(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/LegacyFormValidator2Dot4ApiTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/LegacyFormValidator2Dot4ApiTest.php deleted file mode 100644 index fb3208facd..0000000000 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/LegacyFormValidator2Dot4ApiTest.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\Form\Tests\Extension\Validator\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyFormValidator2Dot4ApiTest extends FormValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidator2Dot4ApiTest.php b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidator2Dot4ApiTest.php deleted file mode 100644 index 4cba36374d..0000000000 --- a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidator2Dot4ApiTest.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\Security\Core\Tests\Validator\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.4 - * @author Bernhard Schussek - */ -class LegacyUserPasswordValidator2Dot4ApiTest extends UserPasswordValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php index d65070ee8f..5abf0cb901 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -65,11 +65,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa // Initialize the context with some constraint so that we can // successfully build a violation. - // The 2.4 API does not keep a reference to the current - // constraint yet. There the violation stores null. - $this->constraint = Validation::API_VERSION_2_4 === $this->getApiVersion() - ? null - : new NotNull(); + $this->constraint = new NotNull(); $this->context = $this->createContext(); $this->validator = $this->createValidator(); @@ -106,22 +102,6 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected function createContext() { $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); - - if (Validation::API_VERSION_2_4 === $this->getApiVersion()) { - return $this->getMockBuilder('Symfony\Component\Validator\ExecutionContext') - ->setConstructorArgs(array( - new StubGlobalExecutionContext($this->root), - $translator, - null, - $this->metadata, - $this->value, - $this->group, - $this->propertyPath, - )) - ->setMethods(array('validate', 'validateValue')) - ->getMock(); - } - $validator = $this->getMock('Symfony\Component\Validator\Validator\ValidatorInterface'); $contextualValidator = $this->getMock('Symfony\Component\Validator\Validator\ContextualValidatorInterface'); @@ -187,17 +167,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected function setGroup($group) { $this->group = $group; - - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $this->context->setGroup($group); - break; - } + $this->context->setGroup($group); } protected function setObject($object) @@ -207,16 +177,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa ? new ClassMetadata(get_class($object)) : null; - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - break; - } + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); } protected function setProperty($object, $property) @@ -226,32 +187,13 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa ? new PropertyMetadata(get_class($object), $property) : null; - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - break; - } + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); } protected function setValue($value) { $this->value = $value; - - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - break; - } + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); } protected function setRoot($root) @@ -264,81 +206,40 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected function setPropertyPath($propertyPath) { $this->propertyPath = $propertyPath; - - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - break; - } + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); } protected function expectNoValidate() { - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context->expects($this->never()) - ->method('validate'); - $this->context->expects($this->never()) - ->method('validateValue'); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $validator = $this->context->getValidator()->inContext($this->context); - $validator->expects($this->never()) - ->method('atPath'); - $validator->expects($this->never()) - ->method('validate'); - break; - } + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expects($this->never()) + ->method('atPath'); + $validator->expects($this->never()) + ->method('validate'); } protected function expectValidateAt($i, $propertyPath, $value, $group) { - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context->expects($this->at($i)) - ->method('validate') - ->with($value, $propertyPath, $group); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $validator = $this->context->getValidator()->inContext($this->context); - $validator->expects($this->at(2 * $i)) - ->method('atPath') - ->with($propertyPath) - ->will($this->returnValue($validator)); - $validator->expects($this->at(2 * $i + 1)) - ->method('validate') - ->with($value, $this->logicalOr(null, array()), $group); - break; - } + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expects($this->at(2 * $i)) + ->method('atPath') + ->with($propertyPath) + ->will($this->returnValue($validator)); + $validator->expects($this->at(2 * $i + 1)) + ->method('validate') + ->with($value, $this->logicalOr(null, array()), $group); } protected function expectValidateValueAt($i, $propertyPath, $value, $constraints, $group = null) { - switch ($this->getApiVersion()) { - case Validation::API_VERSION_2_4: - $this->context->expects($this->at($i)) - ->method('validateValue') - ->with($value, $constraints, $propertyPath, $group); - break; - case Validation::API_VERSION_2_5: - case Validation::API_VERSION_2_5_BC: - $contextualValidator = $this->context->getValidator()->inContext($this->context); - $contextualValidator->expects($this->at(2 * $i)) - ->method('atPath') - ->with($propertyPath) - ->will($this->returnValue($contextualValidator)); - $contextualValidator->expects($this->at(2 * $i + 1)) - ->method('validate') - ->with($value, $constraints, $group); - break; - } + $contextualValidator = $this->context->getValidator()->inContext($this->context); + $contextualValidator->expects($this->at(2 * $i)) + ->method('atPath') + ->with($propertyPath) + ->will($this->returnValue($contextualValidator)); + $contextualValidator->expects($this->at(2 * $i + 1)) + ->method('validate') + ->with($value, $constraints, $group); } protected function assertNoViolation() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyAllValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyAllValidator2Dot4ApiTest.php deleted file mode 100644 index 2d2a1eb833..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyAllValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyAllValidator2Dot4ApiTest extends AllValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyBlankValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyBlankValidator2Dot4ApiTest.php deleted file mode 100644 index 3c47b99b71..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyBlankValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyBlankValidator2Dot4ApiTest extends BlankValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCallbackValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCallbackValidator2Dot4ApiTest.php deleted file mode 100644 index 9cb42de80f..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCallbackValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyCallbackValidator2Dot4ApiTest extends CallbackValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCardSchemeValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCardSchemeValidator2Dot4ApiTest.php deleted file mode 100644 index 37141dad43..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCardSchemeValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyCardSchemeValidator2Dot4ApiTest extends CardSchemeValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyChoiceValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyChoiceValidator2Dot4ApiTest.php deleted file mode 100644 index 725e574a23..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyChoiceValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyChoiceValidator2Dot4ApiTest extends ChoiceValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArray2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArray2Dot4ApiTest.php deleted file mode 100644 index 9077936de9..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArray2Dot4ApiTest.php +++ /dev/null @@ -1,22 +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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -class LegacyCollectionValidatorArray2Dot4ApiTest extends CollectionValidatorArrayTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArrayObject2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArrayObject2Dot4ApiTest.php deleted file mode 100644 index 1146502341..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorArrayObject2Dot4ApiTest.php +++ /dev/null @@ -1,22 +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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -class LegacyCollectionValidatorArrayObject2Dot4ApiTest extends CollectionValidatorArrayObjectTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorCustomArrayObject2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorCustomArrayObject2Dot4ApiTest.php deleted file mode 100644 index f5a9bd53cd..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCollectionValidatorCustomArrayObject2Dot4ApiTest.php +++ /dev/null @@ -1,22 +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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -class LegacyCollectionValidatorCustomArrayObject2Dot4ApiTest extends CollectionValidatorCustomArrayObjectTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorArray2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorArray2Dot4ApiTest.php deleted file mode 100644 index 645d6b74dd..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorArray2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyCountValidatorArray2Dot4ApiTest extends CountValidatorArrayTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorCountable2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorCountable2Dot4ApiTest.php deleted file mode 100644 index f8531ba298..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCountValidatorCountable2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyCountValidatorCountable2Dot4ApiTest extends CountValidatorCountableTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCurrencyValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyCurrencyValidator2Dot4ApiTest.php deleted file mode 100644 index 5a042f0d5c..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyCurrencyValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyCurrencyValidator2Dot4ApiTest extends CurrencyValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateTimeValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateTimeValidator2Dot4ApiTest.php deleted file mode 100644 index 27d35a85d7..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateTimeValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyDateTimeValidator2Dot4ApiTest extends DateTimeValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateValidator2Dot4ApiTest.php deleted file mode 100644 index 7d54e42839..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyDateValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyDateValidator2Dot4ApiTest extends DateValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyEmailValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyEmailValidator2Dot4ApiTest.php deleted file mode 100644 index a29f918d15..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyEmailValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyEmailValidator2Dot4ApiTest extends EmailValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyEqualToValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyEqualToValidator2Dot4ApiTest.php deleted file mode 100644 index 6f1d2ccbc1..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyEqualToValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyEqualToValidator2Dot4ApiTest extends EqualToValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyExpressionValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyExpressionValidator2Dot4ApiTest.php deleted file mode 100644 index 5188c36965..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyExpressionValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyExpressionValidator2Dot4ApiTest extends ExpressionValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFalseValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyFalseValidator2Dot4ApiTest.php deleted file mode 100644 index cbd1791cc9..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFalseValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyFalseValidator2Dot4ApiTest extends FalseValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorObject2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorObject2Dot4ApiTest.php deleted file mode 100644 index 27896a6445..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorObject2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyFileValidatorObject2Dot4ApiTest extends FileValidatorObjectTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorPath2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorPath2Dot4ApiTest.php deleted file mode 100644 index c195a13d37..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyFileValidatorPath2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyFileValidatorPath2Dot4ApiTest extends FileValidatorPathTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanOrEqualValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanOrEqualValidator2Dot4ApiTest.php deleted file mode 100644 index 90ef99e8f2..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanOrEqualValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyGreaterThanOrEqualValidator2Dot4ApiTest extends GreaterThanOrEqualValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanValidator2Dot4ApiTest.php deleted file mode 100644 index 3edb2ffc17..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyGreaterThanValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyGreaterThanValidator2Dot4ApiTest extends GreaterThanValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIbanValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyIbanValidator2Dot4ApiTest.php deleted file mode 100644 index b89c2f168c..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIbanValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyIbanValidator2Dot4ApiTest extends IbanValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIdenticalToValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyIdenticalToValidator2Dot4ApiTest.php deleted file mode 100644 index 2847e79623..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIdenticalToValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyIdenticalToValidator2Dot4ApiTest extends IdenticalToValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyImageValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyImageValidator2Dot4ApiTest.php deleted file mode 100644 index c4b56aa65e..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyImageValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyImageValidator2Dot4ApiTest extends ImageValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIpValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyIpValidator2Dot4ApiTest.php deleted file mode 100644 index ca3b506449..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIpValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyIpValidator2Dot4ApiTest extends IpValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIsbnValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyIsbnValidator2Dot4ApiTest.php deleted file mode 100644 index d2b6adfaf7..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIsbnValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyIsbnValidator2Dot4ApiTest extends IsbnValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIssnValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyIssnValidator2Dot4ApiTest.php deleted file mode 100644 index 1c37e38134..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyIssnValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyIssnValidator2Dot4ApiTest extends IssnValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLanguageValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLanguageValidator2Dot4ApiTest.php deleted file mode 100644 index 4a08c77b9c..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLanguageValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLanguageValidator2Dot4ApiTest extends LanguageValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLengthValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLengthValidator2Dot4ApiTest.php deleted file mode 100644 index 7174c04c94..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLengthValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLengthValidator2Dot4ApiTest extends LengthValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanOrEqualValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanOrEqualValidator2Dot4ApiTest.php deleted file mode 100644 index 7a817fe795..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanOrEqualValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLessThanOrEqualValidator2Dot4ApiTest extends LessThanOrEqualValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanValidator2Dot4ApiTest.php deleted file mode 100644 index 4e11330d8a..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLessThanValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLessThanValidator2Dot4ApiTest extends LessThanValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLocaleValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLocaleValidator2Dot4ApiTest.php deleted file mode 100644 index 2120384dae..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLocaleValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLocaleValidator2Dot4ApiTest extends LocaleValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLuhnValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyLuhnValidator2Dot4ApiTest.php deleted file mode 100644 index 49b2cebd6f..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyLuhnValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyLuhnValidator2Dot4ApiTest extends LuhnValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotBlankValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotBlankValidator2Dot4ApiTest.php deleted file mode 100644 index f5ac29017a..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotBlankValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyNotBlankValidator2Dot4ApiTest extends NotBlankValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotEqualToValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotEqualToValidator2Dot4ApiTest.php deleted file mode 100644 index f9e51a8ada..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotEqualToValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyNotEqualToValidator2Dot4ApiTest extends NotEqualToValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotIdenticalToValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotIdenticalToValidator2Dot4ApiTest.php deleted file mode 100644 index 9a38be7bb8..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotIdenticalToValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyNotIdenticalToValidator2Dot4ApiTest extends NotIdenticalToValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotNullValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotNullValidator2Dot4ApiTest.php deleted file mode 100644 index 98197c7439..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNotNullValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyNotNullValidator2Dot4ApiTest extends NotNullValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNullValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyNullValidator2Dot4ApiTest.php deleted file mode 100644 index dacf1d2023..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyNullValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyNullValidator2Dot4ApiTest extends NullValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyRangeValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyRangeValidator2Dot4ApiTest.php deleted file mode 100644 index a3df8dfefe..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyRangeValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyRangeValidator2Dot4ApiTest extends RangeValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyRegexValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyRegexValidator2Dot4ApiTest.php deleted file mode 100644 index 50f25f0303..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyRegexValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyRegexValidator2Dot4ApiTest extends RegexValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTimeValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyTimeValidator2Dot4ApiTest.php deleted file mode 100644 index 318597590b..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTimeValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyTimeValidator2Dot4ApiTest extends TimeValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTrueValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyTrueValidator2Dot4ApiTest.php deleted file mode 100644 index 8d8c54ceb9..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTrueValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyTrueValidator2Dot4ApiTest extends TrueValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTypeValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyTypeValidator2Dot4ApiTest.php deleted file mode 100644 index c249240e7f..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyTypeValidator2Dot4ApiTest.php +++ /dev/null @@ -1,36 +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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyTypeValidator2Dot4ApiTest extends TypeValidatorTest -{ - /** - * PhpUnit calls data providers of test suites before launching the test - * suite. If this property is not replicated in every test class, only one - * file will ever be created and stored in TypeValidatorTest::$file. After - * the execution of the first TypeValidator test case, tearDownAfterClass() - * is called and closes the file. Hence the resource is not available - * anymore in the other TypeValidator test cases. - */ - protected static $file; - - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyUrlValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyUrlValidator2Dot4ApiTest.php deleted file mode 100644 index 55564c9f91..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyUrlValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyUrlValidator2Dot4ApiTest extends UrlValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LegacyUuidValidator2Dot4ApiTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LegacyUuidValidator2Dot4ApiTest.php deleted file mode 100644 index c421404bfe..0000000000 --- a/src/Symfony/Component/Validator/Tests/Constraints/LegacyUuidValidator2Dot4ApiTest.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\Tests\Constraints; - -use Symfony\Component\Validator\Validation; - -/** - * @since 2.5.3 - * @author Bernhard Schussek - */ -class LegacyUuidValidator2Dot4ApiTest extends UrlValidatorTest -{ - protected function getApiVersion() - { - return Validation::API_VERSION_2_4; - } -} diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php index ce4b1ad88e..56f9bd4ab8 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php @@ -19,15 +19,6 @@ use Symfony\Component\Validator\Validator\LegacyValidator; class LegacyValidator2Dot5ApiTest extends Abstract2Dot5ApiTest { - protected function setUp() - { - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - - parent::setUp(); - } - protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { $translator = new IdentityTranslator(); diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php index 0c0ce3546d..42e6e40311 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php @@ -19,15 +19,6 @@ use Symfony\Component\Validator\Validator\LegacyValidator; class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest { - protected function setUp() - { - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - - parent::setUp(); - } - protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { $translator = new IdentityTranslator(); diff --git a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php index 0a15737f75..e717d9a521 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php @@ -114,21 +114,8 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase { $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - if (PHP_VERSION_ID < 50309) { - // Old implementation on PHP < 5.3.9 - $this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator()); - } else { - // Legacy compatible implementation on PHP >= 5.3.9 - $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); - } - } - - public function testLegacySetApiVersion24() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - - $this->assertSame($this->builder, $this->builder->setApiVersion(Validation::API_VERSION_2_4)); - $this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator()); + // Legacy compatible implementation + $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); } public function testSetApiVersion25() @@ -141,10 +128,6 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase { $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - $this->assertSame($this->builder, $this->builder->setApiVersion(Validation::API_VERSION_2_5_BC)); $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); } diff --git a/src/Symfony/Component/Validator/Validation.php b/src/Symfony/Component/Validator/Validation.php index b304dbb935..a03d21584b 100644 --- a/src/Symfony/Component/Validator/Validation.php +++ b/src/Symfony/Component/Validator/Validation.php @@ -20,6 +20,7 @@ final class Validation { /** * The Validator API provided by Symfony 2.4 and older. + * @deprecated use API_VERSION_2_5_BC instead. */ const API_VERSION_2_4 = 1; diff --git a/src/Symfony/Component/Validator/Validator/LegacyValidator.php b/src/Symfony/Component/Validator/Validator/LegacyValidator.php index 1d4153733d..8995f2cfdd 100644 --- a/src/Symfony/Component/Validator/Validator/LegacyValidator.php +++ b/src/Symfony/Component/Validator/Validator/LegacyValidator.php @@ -19,15 +19,6 @@ use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface; /** * A validator that supports both the API of Symfony < 2.5 and Symfony 2.5+. * - * This class is incompatible with PHP versions < 5.3.9, because it implements - * two different interfaces specifying the same method validate(): - * - * - {@link \Symfony\Component\Validator\ValidatorInterface} - * - {@link \Symfony\Component\Validator\Validator\ValidatorInterface} - * - * In PHP versions prior to 5.3.9, either use {@link RecursiveValidator} or the - * deprecated class {@link \Symfony\Component\Validator\Validator} instead. - * * @since 2.5 * @author Bernhard Schussek * diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index c9eece4474..460ddb8bc5 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -34,7 +34,6 @@ use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader; use Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader; use Symfony\Component\Validator\Validator\LegacyValidator; use Symfony\Component\Validator\Validator\RecursiveValidator; -use Symfony\Component\Validator\Validator as ValidatorV24; /** * The default implementation of {@link ValidatorBuilderInterface}. @@ -332,15 +331,6 @@ class ValidatorBuilder implements ValidatorBuilderInterface )); } - if (PHP_VERSION_ID < 50309 && $apiVersion === Validation::API_VERSION_2_5_BC) { - throw new InvalidArgumentException(sprintf( - 'The Validator API that is compatible with both Symfony 2.4 '. - 'and Symfony 2.5 can only be used on PHP 5.3.9 and higher. '. - 'Your current PHP version is %s.', - PHP_VERSION - )); - } - $this->apiVersion = $apiVersion; return $this; @@ -355,9 +345,7 @@ class ValidatorBuilder implements ValidatorBuilderInterface $apiVersion = $this->apiVersion; if (null === $apiVersion) { - $apiVersion = PHP_VERSION_ID < 50309 - ? Validation::API_VERSION_2_4 - : Validation::API_VERSION_2_5_BC; + $apiVersion = Validation::API_VERSION_2_5_BC; } if (!$metadataFactory) { @@ -410,10 +398,6 @@ class ValidatorBuilder implements ValidatorBuilderInterface $translator->setLocale('en'); } - if (Validation::API_VERSION_2_4 === $apiVersion) { - return new ValidatorV24($metadataFactory, $validatorFactory, $translator, $this->translationDomain, $this->initializers); - } - if (Validation::API_VERSION_2_5 === $apiVersion) { $contextFactory = new ExecutionContextFactory($translator, $this->translationDomain); diff --git a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php index dc4f4277b4..6e2dd96a2d 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php +++ b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php @@ -178,7 +178,6 @@ interface ValidatorBuilderInterface * * @return ValidatorBuilderInterface The builder object * - * @see Validation::API_VERSION_2_4 * @see Validation::API_VERSION_2_5 * @see Validation::API_VERSION_2_5_BC */