use Doctrine\Common\Annotations\Reader;
use Shopware\Bundle\FormBundle\DependencyInjection\Factory\ConstraintValidatorFactory;
use Symfony\Component\Validator\Validation;
class Validator{ public static function create(Reader
$annotationsReader, ConstraintValidatorFactory
$validatorFactory) { $validatorBuilder = Validation::
createValidatorBuilder();
$validatorBuilder->
enableAnnotationMapping($annotationsReader);
$validatorBuilder->
setConstraintValidatorFactory($validatorFactory);
return $validatorBuilder->
getValidator();
}}