فهرست منبع

[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.

Matthieu Vachon 14 سال پیش
والد
کامیت
87176e39d1
1فایلهای تغییر یافته به همراه0 افزوده شده و 3 حذف شده
  1. 0 3
      src/Symfony/Component/Form/Extension/Core/Type/DateType.php

+ 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