From 46b77928f746a4231d064774b5b67fd892c7ce86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 4 Aug 2013 17:50:34 +0200 Subject: rm vendor --- .../Validator/Type/BaseValidatorExtension.php | 56 --------------- .../Validator/Type/FormTypeValidatorExtension.php | 84 ---------------------- .../Type/RepeatedTypeValidatorExtension.php | 45 ------------ .../Type/SubmitTypeValidatorExtension.php | 28 -------- 4 files changed, 213 deletions(-) delete mode 100644 vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php delete mode 100644 vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php delete mode 100644 vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php delete mode 100644 vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/SubmitTypeValidatorExtension.php (limited to 'vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type') diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php deleted file mode 100644 index 7c5e6784..00000000 --- a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php +++ /dev/null @@ -1,56 +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\Extension\Validator\Type; - -use Symfony\Component\Form\AbstractTypeExtension; -use Symfony\Component\OptionsResolver\Options; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -/** - * Encapsulates common logic of {@link FormTypeValidatorExtension} and - * {@link SubmitTypeValidatorExtension}. - * - * @author Bernhard Schussek - */ -abstract class BaseValidatorExtension extends AbstractTypeExtension -{ - /** - * {@inheritdoc} - */ - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - // Make sure that validation groups end up as null, closure or array - $validationGroupsNormalizer = function (Options $options, $groups) { - if (false === $groups) { - return array(); - } - - if (empty($groups)) { - return null; - } - - if (is_callable($groups)) { - return $groups; - } - - return (array) $groups; - }; - - $resolver->setDefaults(array( - 'validation_groups' => null, - )); - - $resolver->setNormalizers(array( - 'validation_groups' => $validationGroupsNormalizer, - )); - } -} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php deleted file mode 100644 index 344bddad..00000000 --- a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php +++ /dev/null @@ -1,84 +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\Extension\Validator\Type; - -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; -use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener; -use Symfony\Component\Validator\ValidatorInterface; -use Symfony\Component\OptionsResolver\Options; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -/** - * @author Bernhard Schussek - */ -class FormTypeValidatorExtension extends BaseValidatorExtension -{ - /** - * @var ValidatorInterface - */ - private $validator; - - /** - * @var ViolationMapper - */ - private $violationMapper; - - public function __construct(ValidatorInterface $validator) - { - $this->validator = $validator; - $this->violationMapper = new ViolationMapper(); - } - - /** - * {@inheritdoc} - */ - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder->addEventSubscriber(new ValidationListener($this->validator, $this->violationMapper)); - } - - /** - * {@inheritdoc} - */ - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - parent::setDefaultOptions($resolver); - - // Constraint should always be converted to an array - $constraintsNormalizer = function (Options $options, $constraints) { - return is_object($constraints) ? array($constraints) : (array) $constraints; - }; - - $resolver->setDefaults(array( - 'error_mapping' => array(), - 'constraints' => array(), - 'cascade_validation' => false, - 'invalid_message' => 'This value is not valid.', - 'invalid_message_parameters' => array(), - 'extra_fields_message' => 'This form should not contain extra fields.', - 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', - )); - - $resolver->setNormalizers(array( - 'constraints' => $constraintsNormalizer, - )); - } - - /** - * {@inheritdoc} - */ - public function getExtendedType() - { - return 'form'; - } -} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php deleted file mode 100644 index 858ff0fa..00000000 --- a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php +++ /dev/null @@ -1,45 +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\Extension\Validator\Type; - -use Symfony\Component\Form\AbstractTypeExtension; -use Symfony\Component\OptionsResolver\Options; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; - -/** - * @author Bernhard Schussek - */ -class RepeatedTypeValidatorExtension extends AbstractTypeExtension -{ - /** - * {@inheritdoc} - */ - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - // Map errors to the first field - $errorMapping = function (Options $options) { - return array('.' => $options['first_name']); - }; - - $resolver->setDefaults(array( - 'error_mapping' => $errorMapping, - )); - } - - /** - * {@inheritdoc} - */ - public function getExtendedType() - { - return 'repeated'; - } -} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/SubmitTypeValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/SubmitTypeValidatorExtension.php deleted file mode 100644 index 5aad67fb..00000000 --- a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/SubmitTypeValidatorExtension.php +++ /dev/null @@ -1,28 +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\Extension\Validator\Type; - -use Symfony\Component\Form\AbstractTypeExtension; - -/** - * @author Bernhard Schussek - */ -class SubmitTypeValidatorExtension extends AbstractTypeExtension -{ - /** - * {@inheritdoc} - */ - public function getExtendedType() - { - return 'submit'; - } -} -- cgit v1.2.3