Вход Регистрация
Файл: symfony-2.7/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php
Строк: 62
<?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 SymfonyComponentValidatorTestsValidator;

use 
SymfonyComponentTranslationIdentityTranslator;
use 
SymfonyComponentValidatorConstraintValidatorFactory;
use 
SymfonyComponentValidatorContextLegacyExecutionContextFactory;
use 
SymfonyComponentValidatorMetadataFactoryInterface;
use 
SymfonyComponentValidatorValidatorLegacyValidator;

class 
LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest
{
    protected function 
createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array())
    {
        
$translator = new IdentityTranslator();
        
$translator->setLocale('en');

        
$contextFactory = new LegacyExecutionContextFactory($metadataFactory$translator);
        
$validatorFactory = new ConstraintValidatorFactory();

        return new 
LegacyValidator($contextFactory$metadataFactory$validatorFactory$objectInitializers);
    }
}
Онлайн: 0
Реклама