Ver Fonte

Merge remote branch 'maoueh/date_type_dead_code'

* maoueh/date_type_dead_code:
  [Form] Removed dead code in the buildForm method of DateType.php  * With the introduction of the getAllowedOptionValues mechanics, the check    is performed prior to the buildForm call. There is no more needs to check    it again in DateType.
Fabien Potencier há 14 anos atrás
pai
commit
43817de633

+ 0 - 3
src/Symfony/Component/Form/Extension/Core/Type/DateType.php

@@ -14,7 +14,6 @@ namespace Symfony\Component\Form\Extension\Core\Type;
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\Form\FormInterface;
 use Symfony\Component\Form\FormBuilder;
-use Symfony\Component\Form\Exception\FormException;
 use Symfony\Component\Form\Extension\Core\ChoiceList\PaddedChoiceList;
 use Symfony\Component\Form\Extension\Core\ChoiceList\MonthChoiceList;
 use Symfony\Component\Form\FormView;
@@ -80,8 +79,6 @@ class DateType extends AbstractType
             $builder->appendNormTransformer(new ReversedTransformer(
                 new DateTimeToArrayTransformer($options['data_timezone'], $options['data_timezone'], array('year', 'month', 'day'))
             ));
-        } else if ($options['input'] !== 'datetime') {
-            throw new FormException('The "input" option must be "datetime", "string", "timestamp" or "array".');
         }
 
         $builder