removed the Validator BC layer for PHP < 5.3.9

This commit is contained in:
Fabien Potencier 2015-01-08 23:22:31 +01:00
parent a4139c0be5
commit 5aa44eec3d
65 changed files with 46 additions and 1515 deletions

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\Bridge\Doctrine\Tests\Validator\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.4
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyUniqueEntityValidator2Dot4ApiTest extends UniqueEntityValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -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;
})

View File

@ -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));

View File

@ -5,7 +5,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="validator.class">Symfony\Component\Validator\ValidatorInterface</parameter>
<parameter key="validator.class">Symfony\Component\Validator\Validator\ValidatorInterface</parameter>
<parameter key="validator.builder.class">Symfony\Component\Validator\ValidatorBuilderInterface</parameter>
<parameter key="validator.builder.factory.class">Symfony\Component\Validator\Validation</parameter>
<parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>

View File

@ -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',

View File

@ -1,9 +0,0 @@
<?php
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'api' => '2.4',
),
));

View File

@ -1,12 +0,0 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<framework:config secret="s3cr3t">
<framework:validation enabled="true" api="2.4" />
</framework:config>
</container>

View File

@ -1,5 +0,0 @@
framework:
secret: s3cr3t
validation:
enabled: true
api: 2.4

View File

@ -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()

View File

@ -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();
}

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\Form\Tests\Extension\Validator\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyFormValidator2Dot4ApiTest extends FormValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Security\Core\Tests\Validator\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.4
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyUserPasswordValidator2Dot4ApiTest extends UserPasswordValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -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()

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyAllValidator2Dot4ApiTest extends AllValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyBlankValidator2Dot4ApiTest extends BlankValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyCallbackValidator2Dot4ApiTest extends CallbackValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyCardSchemeValidator2Dot4ApiTest extends CardSchemeValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyChoiceValidator2Dot4ApiTest extends ChoiceValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -1,22 +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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
class LegacyCollectionValidatorArray2Dot4ApiTest extends CollectionValidatorArrayTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -1,22 +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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
class LegacyCollectionValidatorArrayObject2Dot4ApiTest extends CollectionValidatorArrayObjectTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -1,22 +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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
class LegacyCollectionValidatorCustomArrayObject2Dot4ApiTest extends CollectionValidatorCustomArrayObjectTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyCountValidatorArray2Dot4ApiTest extends CountValidatorArrayTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyCountValidatorCountable2Dot4ApiTest extends CountValidatorCountableTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyCurrencyValidator2Dot4ApiTest extends CurrencyValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyDateTimeValidator2Dot4ApiTest extends DateTimeValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyDateValidator2Dot4ApiTest extends DateValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyEmailValidator2Dot4ApiTest extends EmailValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyEqualToValidator2Dot4ApiTest extends EqualToValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyExpressionValidator2Dot4ApiTest extends ExpressionValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyFalseValidator2Dot4ApiTest extends FalseValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyFileValidatorObject2Dot4ApiTest extends FileValidatorObjectTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyFileValidatorPath2Dot4ApiTest extends FileValidatorPathTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyGreaterThanOrEqualValidator2Dot4ApiTest extends GreaterThanOrEqualValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyGreaterThanValidator2Dot4ApiTest extends GreaterThanValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyIbanValidator2Dot4ApiTest extends IbanValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyIdenticalToValidator2Dot4ApiTest extends IdenticalToValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyImageValidator2Dot4ApiTest extends ImageValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyIpValidator2Dot4ApiTest extends IpValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyIsbnValidator2Dot4ApiTest extends IsbnValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyIssnValidator2Dot4ApiTest extends IssnValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLanguageValidator2Dot4ApiTest extends LanguageValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLengthValidator2Dot4ApiTest extends LengthValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLessThanOrEqualValidator2Dot4ApiTest extends LessThanOrEqualValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLessThanValidator2Dot4ApiTest extends LessThanValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLocaleValidator2Dot4ApiTest extends LocaleValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyLuhnValidator2Dot4ApiTest extends LuhnValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyNotBlankValidator2Dot4ApiTest extends NotBlankValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyNotEqualToValidator2Dot4ApiTest extends NotEqualToValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyNotIdenticalToValidator2Dot4ApiTest extends NotIdenticalToValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyNotNullValidator2Dot4ApiTest extends NotNullValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyNullValidator2Dot4ApiTest extends NullValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyRangeValidator2Dot4ApiTest extends RangeValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyRegexValidator2Dot4ApiTest extends RegexValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyTimeValidator2Dot4ApiTest extends TimeValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyTrueValidator2Dot4ApiTest extends TrueValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -1,36 +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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
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;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyUrlValidator2Dot4ApiTest extends UrlValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

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\Tests\Constraints;
use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class LegacyUuidValidator2Dot4ApiTest extends UrlValidatorTest
{
protected function getApiVersion()
{
return Validation::API_VERSION_2_4;
}
}

View File

@ -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();

View File

@ -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();

View File

@ -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());
}

View File

@ -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;

View File

@ -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 <bschussek@gmail.com>
*

View File

@ -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);

View File

@ -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
*/